Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbbde97c authored by Yue Ma's avatar Yue Ma
Browse files

cnss2: Avoid blocking target to reboot or shutdown



Use wait_for_completion_killable() instead of wait_for_completion() to
avold blocking target to reboot or shutdown during WLAN device power
on/off.

Change-Id: If60848fe9d61e506347e3c6b0fe8c8604cee6c79
Signed-off-by: default avatarYue Ma <yuem@codeaurora.org>
parent f20188bc
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -558,8 +558,10 @@ int cnss_driver_event_post(struct cnss_plat_data *plat_priv,
	if (!(flags & CNSS_EVENT_SYNC))
		goto out;

	if (flags & CNSS_EVENT_UNINTERRUPTIBLE)
	if (flags & CNSS_EVENT_UNKILLABLE)
		wait_for_completion(&event->complete);
	else if (flags & CNSS_EVENT_UNINTERRUPTIBLE)
		ret = wait_for_completion_killable(&event->complete);
	else
		ret = wait_for_completion_interruptible(&event->complete);

@@ -2113,6 +2115,8 @@ static int cnss_reboot_notifier(struct notifier_block *nb,
		container_of(nb, struct cnss_plat_data, reboot_nb);

	set_bit(CNSS_IN_REBOOT, &plat_priv->driver_state);
	del_timer(&plat_priv->fw_boot_timer);
	complete_all(&plat_priv->power_up_complete);
	cnss_pr_dbg("Reboot is in progress with action %d\n", action);

	return NOTIFY_DONE;
+2 −0
Original line number Diff line number Diff line
@@ -25,8 +25,10 @@

#define CNSS_EVENT_SYNC   BIT(0)
#define CNSS_EVENT_UNINTERRUPTIBLE BIT(1)
#define CNSS_EVENT_UNKILLABLE BIT(2)
#define CNSS_EVENT_SYNC_UNINTERRUPTIBLE (CNSS_EVENT_SYNC | \
				CNSS_EVENT_UNINTERRUPTIBLE)
#define CNSS_EVENT_SYNC_UNKILLABLE (CNSS_EVENT_SYNC | CNSS_EVENT_UNKILLABLE)

enum cnss_dev_bus_type {
	CNSS_BUS_NONE = -1,