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

Commit 00d56be6 authored by Yuanyuan Liu's avatar Yuanyuan Liu
Browse files

icnss: Remove vote for hardware resources when FW is not down



There's a race condition that could happen between PDR and driver
unloading, where platform removes its hardware resources vote
at the end of driver de-initialization in between the 2 stages
of WLAN FW reset recipe, which led to a bad state in WLAN HW.
To avoid this, check WLAN FW state before removing hardware
resources vote. Do not remove vote during driver unloading if
WLAN FW is in down state. The vote will be released within FW
ready indication handler once WLAN FW is recovered.

Change-Id: Ic45c42c4d05676e60a8fb7a8b5cae306b1c3344e
CRs-Fixed: 2158466
Signed-off-by: default avatarYuanyuan Liu <yuanliu@codeaurora.org>
parent a5cabe93
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1132,6 +1132,9 @@ static int icnss_hw_power_off(struct icnss_priv *priv)
	if (test_bit(HW_ALWAYS_ON, &quirks))
		return 0;

	if (test_bit(ICNSS_FW_DOWN, &priv->state))
		return 0;

	icnss_pr_dbg("HW Power off: 0x%lx\n", priv->state);

	spin_lock(&priv->on_off_lock);