Skip to content

Commit 87ffa98

Browse files
Mukesh Ojhagregkh
authored andcommitted
firmware_loader: Refactor kill_pending_fw_fallback_reqs()
Rename 'only_kill_custom' and refactor logic related to it to be more meaningful. Signed-off-by: Mukesh Ojha <[email protected]> Acked-by: Luis Chamberlain <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0217f39 commit 87ffa98

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

drivers/base/firmware_loader/fallback.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ static inline int fw_sysfs_wait_timeout(struct fw_priv *fw_priv, long timeout)
4646

4747
static LIST_HEAD(pending_fw_head);
4848

49-
void kill_pending_fw_fallback_reqs(bool only_kill_custom)
49+
void kill_pending_fw_fallback_reqs(bool kill_all)
5050
{
5151
struct fw_priv *fw_priv;
5252
struct fw_priv *next;
5353

5454
mutex_lock(&fw_lock);
5555
list_for_each_entry_safe(fw_priv, next, &pending_fw_head,
5656
pending_list) {
57-
if (!fw_priv->need_uevent || !only_kill_custom)
57+
if (kill_all || !fw_priv->need_uevent)
5858
__fw_load_abort(fw_priv);
5959
}
6060
mutex_unlock(&fw_lock);

drivers/base/firmware_loader/fallback.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ int firmware_fallback_sysfs(struct firmware *fw, const char *name,
1313
struct device *device,
1414
u32 opt_flags,
1515
int ret);
16-
void kill_pending_fw_fallback_reqs(bool only_kill_custom);
16+
void kill_pending_fw_fallback_reqs(bool kill_all);
1717

1818
void fw_fallback_set_cache_timeout(void);
1919
void fw_fallback_set_default_timeout(void);
@@ -28,7 +28,7 @@ static inline int firmware_fallback_sysfs(struct firmware *fw, const char *name,
2828
return ret;
2929
}
3030

31-
static inline void kill_pending_fw_fallback_reqs(bool only_kill_custom) { }
31+
static inline void kill_pending_fw_fallback_reqs(bool kill_all) { }
3232
static inline void fw_fallback_set_cache_timeout(void) { }
3333
static inline void fw_fallback_set_default_timeout(void) { }
3434
#endif /* CONFIG_FW_LOADER_USER_HELPER */

drivers/base/firmware_loader/main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,10 +1524,10 @@ static int fw_pm_notify(struct notifier_block *notify_block,
15241524
case PM_SUSPEND_PREPARE:
15251525
case PM_RESTORE_PREPARE:
15261526
/*
1527-
* kill pending fallback requests with a custom fallback
1528-
* to avoid stalling suspend.
1527+
* Here, kill pending fallback requests will only kill
1528+
* non-uevent firmware request to avoid stalling suspend.
15291529
*/
1530-
kill_pending_fw_fallback_reqs(true);
1530+
kill_pending_fw_fallback_reqs(false);
15311531
device_cache_fw_images();
15321532
break;
15331533

@@ -1612,7 +1612,7 @@ static int fw_shutdown_notify(struct notifier_block *unused1,
16121612
* Kill all pending fallback requests to avoid both stalling shutdown,
16131613
* and avoid a deadlock with the usermode_lock.
16141614
*/
1615-
kill_pending_fw_fallback_reqs(false);
1615+
kill_pending_fw_fallback_reqs(true);
16161616

16171617
return NOTIFY_DONE;
16181618
}

0 commit comments

Comments
 (0)