wifi: wlcore: fix unbalanced pm_runtime calls
PATCH 1/1 wifi: wlcore: fix unbalanced pm_runtime calls
If firmware boot failes, runtime pm is put too often:
[12092.708099] wlcore: ERROR firmware boot failed despite 3 retries [12092.708099] wl18xx_driver wl18xx.1.auto: Runtime PM usage count underflow!
Fix that by redirecting all error gotos before runtime_get so that runtime is not put.
Signed-off-by Andreas Kemnade <[email protected]>
--- drivers/net/wireless/ti/wlcore/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ti/wlcore/main.c +4 -4
@@ -2612,13 +2612,13 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,if (test_bit (WL1271_FLAG_RECOVERY_IN_PROGRESS , &wl->flags) ||test_bit (WLVIF_FLAG_INITIALIZED , &wlvif->flags)) { ret = -EBUSY ; - goto out; + goto out_unlock; } ret =wl12xx_init_vif_data (wl, vif);if (ret <0 ) - goto out; + goto out_unlock; wlvif->wl = wl; role_type =wl12xx_get_role_type (wl, wlvif);
@@ -2629,7 +2629,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, ret =wlcore_allocate_hw_queue_base (wl, wlvif);if (ret <0 ) - goto out; + goto out_unlock;/* * TODO: after the nvs issue will be solved, move this block
@@ -2644,7 +2644,7 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw, ret =wl12xx_init_fw (wl);if (ret <0 ) - goto out; + goto out_unlock; }/*
Signature · 1 line
2.39.2
Quoted 6 lines · Andreas Kemnade
If firmware boot failes, runtime pm is put too often:
[12092.708099] wlcore: ERROR firmware boot failed despite 3 retries [12092.708099] wl18xx_driver wl18xx.1.auto: Runtime PM usage count underflow!Fix that by redirecting all error gotos before
runtime_getso that runtime is not put.Signed-off-by Andreas Kemnade <[email protected]>
Do we know what commit broke this? A Fixes tag would be good to have.
Why not change this also to use out_unlock:
role_type = wl12xx_get_role_type(wl, wlvif);
if (role_type == WL12XX_INVALID_ROLE_TYPE) {
ret = -EINVAL;
goto out;
}Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches