diff mbox

[5/8] wclore: Fix timout errors after recovery

Message ID 20180619094342.81831-6-tony@atomide.com (mailing list archive)
State Accepted
Commit db68052bdf581eb5e7f74da4a5bb5933113dbaaf
Delegated to: Kalle Valo
Headers show

Commit Message

Tony Lindgren June 19, 2018, 9:43 a.m. UTC
After enabling runtime PM, if we force hardware reset multiple times with:

# echo 1 > /sys/kernel/debug/ieee80211/phy0/wlcore/start_recovery

We will after few tries get the following error:

wlcore: ERROR timeout waiting for the hardware to complete initialization

And then wlcore is unable to reconnect until after the wlcore related modules
are reloaded.

Let's fix this by moving pm_runtime_put() earlier before we restart the hardware.
And let's use the sync version to make sure we're done before we restart.

Note that we still will get -EBUSY warning from wl12xx_sdio_set_power() but let's
fix that separately once we know exactly why we get the warning.

Reported-by: Eyal Reizer <eyalr@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/net/wireless/ti/wlcore/main.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Kalle Valo June 27, 2018, 3:41 p.m. UTC | #1
Tony Lindgren <tony@atomide.com> wrote:

> After enabling runtime PM, if we force hardware reset multiple times with:
> 
> # echo 1 > /sys/kernel/debug/ieee80211/phy0/wlcore/start_recovery
> 
> We will after few tries get the following error:
> 
> wlcore: ERROR timeout waiting for the hardware to complete initialization
> 
> And then wlcore is unable to reconnect until after the wlcore related modules
> are reloaded.
> 
> Let's fix this by moving pm_runtime_put() earlier before we restart the hardware.
> And let's use the sync version to make sure we're done before we restart.
> 
> Note that we still will get -EBUSY warning from wl12xx_sdio_set_power() but let's
> fix that separately once we know exactly why we get the warning.
> 
> Reported-by: Eyal Reizer <eyalr@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

I'll do s/wclore/wlcore/ to the title.
Tony Lindgren June 28, 2018, 9:07 a.m. UTC | #2
* Kalle Valo <kvalo@codeaurora.org> [180627 15:44]:
> 
> I'll do s/wclore/wlcore/ to the title.

OK thanks and sorry about that one.

Tony
Kalle Valo June 28, 2018, 9:19 a.m. UTC | #3
Tony Lindgren <tony@atomide.com> writes:

> * Kalle Valo <kvalo@codeaurora.org> [180627 15:44]:
>> 
>> I'll do s/wclore/wlcore/ to the title.
>
> OK thanks and sorry about that one.

No problem. I would not have even noticed the typo but I did 'list -s
new wlcore' (which prints all patches in new state with wlcore on the
subject) on my patchwork script and started to wonder where did the
patch 5 go :)
diff mbox

Patch

diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -977,6 +977,7 @@  static void wl1271_recovery_work(struct work_struct *work)
 	}
 
 	wlcore_op_stop_locked(wl);
+	pm_runtime_put_sync(wl->dev);
 
 	ieee80211_restart_hw(wl->hw);
 
@@ -986,8 +987,6 @@  static void wl1271_recovery_work(struct work_struct *work)
 	 */
 	wlcore_wake_queues(wl, WLCORE_QUEUE_STOP_REASON_FW_RESTART);
 
-	pm_runtime_put(wl->dev);
-
 out_unlock:
 	wl->watchdog_recovery = false;
 	clear_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS, &wl->flags);