diff mbox series

wlcore: fix runtime pm imbalance in wl1271_op_suspend

Message ID 20200520125724.12832-1-dinghao.liu@zju.edu.cn (mailing list archive)
State Accepted
Commit 3e69ed2b52fd0eeb1e812e20a667316d913e6a97
Delegated to: Kalle Valo
Headers show
Series wlcore: fix runtime pm imbalance in wl1271_op_suspend | expand

Commit Message

Dinghao Liu May 20, 2020, 12:57 p.m. UTC
When wlcore_hw_interrupt_notify() returns an error code,
a pairing runtime PM usage counter decrement is needed to
keep the counter balanced.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
 drivers/net/wireless/ti/wlcore/main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Tony Lindgren May 20, 2020, 6:48 p.m. UTC | #1
* Dinghao Liu <dinghao.liu@zju.edu.cn> [200520 12:58]:
> When wlcore_hw_interrupt_notify() returns an error code,
> a pairing runtime PM usage counter decrement is needed to
> keep the counter balanced.

We should probably keep the warning though, nothing will
get shown for wl1271_configure_suspend_ap() errors.

Otherwise looks good to me.

Regards,

Tony
Dinghao Liu May 21, 2020, 4:51 a.m. UTC | #2
There is a check against ret after out_sleep tag. If wl1271_configure_suspend_ap()
returns an error code, ret will be caught by this check and a warning will be issued.


&quot;Tony Lindgren&quot; &lt;tony@atomide.com&gt;写道:
> * Dinghao Liu <dinghao.liu@zju.edu.cn> [200520 12:58]:
> > When wlcore_hw_interrupt_notify() returns an error code,
> > a pairing runtime PM usage counter decrement is needed to
> > keep the counter balanced.
> 
> We should probably keep the warning though, nothing will
> get shown for wl1271_configure_suspend_ap() errors.
> 
> Otherwise looks good to me.
> 
> Regards,
> 
> Tony
Tony Lindgren May 21, 2020, 3:59 p.m. UTC | #3
* dinghao.liu@zju.edu.cn <dinghao.liu@zju.edu.cn> [200521 04:55]:
> There is a check against ret after out_sleep tag. If wl1271_configure_suspend_ap()
> returns an error code, ret will be caught by this check and a warning will be issued.

OK thanks for checking. In that case this one too:

Acked-by: Tony Lindgren <tony@atomide.com>
Kalle Valo May 29, 2020, 5:34 p.m. UTC | #4
Dinghao Liu <dinghao.liu@zju.edu.cn> wrote:

> When wlcore_hw_interrupt_notify() returns an error code,
> a pairing runtime PM usage counter decrement is needed to
> keep the counter balanced.
> 
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> Acked-by: Tony Lindgren <tony@atomide.com>

Patch applied to wireless-drivers-next.git, thanks.

3e69ed2b52fd wlcore: fix runtime pm imbalance in wl1271_op_suspend
diff mbox series

Patch

diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index f140f7d7f553..8faee8cec1bc 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -1746,9 +1746,7 @@  static int __maybe_unused wl1271_op_suspend(struct ieee80211_hw *hw,
 
 		ret = wl1271_configure_suspend(wl, wlvif, wow);
 		if (ret < 0) {
-			mutex_unlock(&wl->mutex);
-			wl1271_warning("couldn't prepare device to suspend");
-			return ret;
+			goto out_sleep;
 		}
 	}