Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <quic_mojha@quicinc.com>
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/1698330459-31776-1-git-send-email-quic_mojha@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mukesh Ojha and committed by
Greg Kroah-Hartman
87ffa98e 0217f394

+8 -8
+2 -2
drivers/base/firmware_loader/fallback.c
··· 46 46 47 47 static LIST_HEAD(pending_fw_head); 48 48 49 - void kill_pending_fw_fallback_reqs(bool only_kill_custom) 49 + void kill_pending_fw_fallback_reqs(bool kill_all) 50 50 { 51 51 struct fw_priv *fw_priv; 52 52 struct fw_priv *next; ··· 54 54 mutex_lock(&fw_lock); 55 55 list_for_each_entry_safe(fw_priv, next, &pending_fw_head, 56 56 pending_list) { 57 - if (!fw_priv->need_uevent || !only_kill_custom) 57 + if (kill_all || !fw_priv->need_uevent) 58 58 __fw_load_abort(fw_priv); 59 59 } 60 60 mutex_unlock(&fw_lock);
+2 -2
drivers/base/firmware_loader/fallback.h
··· 13 13 struct device *device, 14 14 u32 opt_flags, 15 15 int ret); 16 - void kill_pending_fw_fallback_reqs(bool only_kill_custom); 16 + void kill_pending_fw_fallback_reqs(bool kill_all); 17 17 18 18 void fw_fallback_set_cache_timeout(void); 19 19 void fw_fallback_set_default_timeout(void); ··· 28 28 return ret; 29 29 } 30 30 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) { } 32 32 static inline void fw_fallback_set_cache_timeout(void) { } 33 33 static inline void fw_fallback_set_default_timeout(void) { } 34 34 #endif /* CONFIG_FW_LOADER_USER_HELPER */
+4 -4
drivers/base/firmware_loader/main.c
··· 1524 1524 case PM_SUSPEND_PREPARE: 1525 1525 case PM_RESTORE_PREPARE: 1526 1526 /* 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. 1529 1529 */ 1530 - kill_pending_fw_fallback_reqs(true); 1530 + kill_pending_fw_fallback_reqs(false); 1531 1531 device_cache_fw_images(); 1532 1532 break; 1533 1533 ··· 1612 1612 * Kill all pending fallback requests to avoid both stalling shutdown, 1613 1613 * and avoid a deadlock with the usermode_lock. 1614 1614 */ 1615 - kill_pending_fw_fallback_reqs(false); 1615 + kill_pending_fw_fallback_reqs(true); 1616 1616 1617 1617 return NOTIFY_DONE; 1618 1618 }