linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wlcore: fix runtime pm imbalance in wlcore_irq_locked
@ 2020-05-22  4:49 Dinghao Liu
  2020-05-22 17:57 ` Tony Lindgren
  2020-05-29 17:38 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Dinghao Liu @ 2020-05-22  4:49 UTC (permalink / raw)
  To: dinghao.liu, kjlu
  Cc: Kalle Valo, David S. Miller, Jakub Kicinski, Johannes Berg,
	Thomas Gleixner, Arnd Bergmann, Guy Mishol, Emmanuel Grumbach,
	Maital Hahn, Jason A. Donenfeld, Tony Lindgren, linux-wireless,
	netdev, linux-kernel

When wlcore_fw_status() returns an error code, a pairing
runtime PM usage counter decrement is needed to keep the
counter balanced. It's the same for all error paths after
wlcore_fw_status().

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

diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index f140f7d7f553..fd3608223f64 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -548,7 +548,7 @@ static int wlcore_irq_locked(struct wl1271 *wl)
 
 		ret = wlcore_fw_status(wl, wl->fw_status);
 		if (ret < 0)
-			goto out;
+			goto err_ret;
 
 		wlcore_hw_tx_immediate_compl(wl);
 
@@ -565,7 +565,7 @@ static int wlcore_irq_locked(struct wl1271 *wl)
 			ret = -EIO;
 
 			/* restarting the chip. ignore any other interrupt. */
-			goto out;
+			goto err_ret;
 		}
 
 		if (unlikely(intr & WL1271_ACX_SW_INTR_WATCHDOG)) {
@@ -575,7 +575,7 @@ static int wlcore_irq_locked(struct wl1271 *wl)
 			ret = -EIO;
 
 			/* restarting the chip. ignore any other interrupt. */
-			goto out;
+			goto err_ret;
 		}
 
 		if (likely(intr & WL1271_ACX_INTR_DATA)) {
@@ -583,7 +583,7 @@ static int wlcore_irq_locked(struct wl1271 *wl)
 
 			ret = wlcore_rx(wl, wl->fw_status);
 			if (ret < 0)
-				goto out;
+				goto err_ret;
 
 			/* Check if any tx blocks were freed */
 			spin_lock_irqsave(&wl->wl_lock, flags);
@@ -596,7 +596,7 @@ static int wlcore_irq_locked(struct wl1271 *wl)
 				 */
 				ret = wlcore_tx_work_locked(wl);
 				if (ret < 0)
-					goto out;
+					goto err_ret;
 			} else {
 				spin_unlock_irqrestore(&wl->wl_lock, flags);
 			}
@@ -604,7 +604,7 @@ static int wlcore_irq_locked(struct wl1271 *wl)
 			/* check for tx results */
 			ret = wlcore_hw_tx_delayed_compl(wl);
 			if (ret < 0)
-				goto out;
+				goto err_ret;
 
 			/* Make sure the deferred queues don't get too long */
 			defer_count = skb_queue_len(&wl->deferred_tx_queue) +
@@ -617,14 +617,14 @@ static int wlcore_irq_locked(struct wl1271 *wl)
 			wl1271_debug(DEBUG_IRQ, "WL1271_ACX_INTR_EVENT_A");
 			ret = wl1271_event_handle(wl, 0);
 			if (ret < 0)
-				goto out;
+				goto err_ret;
 		}
 
 		if (intr & WL1271_ACX_INTR_EVENT_B) {
 			wl1271_debug(DEBUG_IRQ, "WL1271_ACX_INTR_EVENT_B");
 			ret = wl1271_event_handle(wl, 1);
 			if (ret < 0)
-				goto out;
+				goto err_ret;
 		}
 
 		if (intr & WL1271_ACX_INTR_INIT_COMPLETE)
@@ -635,6 +635,7 @@ static int wlcore_irq_locked(struct wl1271 *wl)
 			wl1271_debug(DEBUG_IRQ, "WL1271_ACX_INTR_HW_AVAILABLE");
 	}
 
+err_ret:
 	pm_runtime_mark_last_busy(wl->dev);
 	pm_runtime_put_autosuspend(wl->dev);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] wlcore: fix runtime pm imbalance in wlcore_irq_locked
  2020-05-22  4:49 [PATCH] wlcore: fix runtime pm imbalance in wlcore_irq_locked Dinghao Liu
@ 2020-05-22 17:57 ` Tony Lindgren
  2020-05-29 17:38 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2020-05-22 17:57 UTC (permalink / raw)
  To: Dinghao Liu
  Cc: kjlu, Kalle Valo, David S. Miller, Jakub Kicinski, Johannes Berg,
	Thomas Gleixner, Arnd Bergmann, Guy Mishol, Emmanuel Grumbach,
	Maital Hahn, Jason A. Donenfeld, linux-wireless, netdev,
	linux-kernel

* Dinghao Liu <dinghao.liu@zju.edu.cn> [200522 04:50]:
> When wlcore_fw_status() returns an error code, a pairing
> runtime PM usage counter decrement is needed to keep the
> counter balanced. It's the same for all error paths after
> wlcore_fw_status().

Acked-by: Tony Lindgren <tony@atomide.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] wlcore: fix runtime pm imbalance in wlcore_irq_locked
  2020-05-22  4:49 [PATCH] wlcore: fix runtime pm imbalance in wlcore_irq_locked Dinghao Liu
  2020-05-22 17:57 ` Tony Lindgren
@ 2020-05-29 17:38 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2020-05-29 17:38 UTC (permalink / raw)
  To: Dinghao Liu
  Cc: dinghao.liu, kjlu, David S. Miller, Jakub Kicinski,
	Johannes Berg, Thomas Gleixner, Arnd Bergmann, Guy Mishol,
	Emmanuel Grumbach, Maital Hahn, Jason A. Donenfeld,
	Tony Lindgren, linux-wireless, netdev, linux-kernel

Dinghao Liu <dinghao.liu@zju.edu.cn> wrote:

> When wlcore_fw_status() returns an error code, a pairing
> runtime PM usage counter decrement is needed to keep the
> counter balanced. It's the same for all error paths after
> wlcore_fw_status().
> 
> 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.

da74b6933b3b wlcore: fix runtime pm imbalance in wlcore_irq_locked

-- 
https://patchwork.kernel.org/patch/11564675/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-29 17:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-22  4:49 [PATCH] wlcore: fix runtime pm imbalance in wlcore_irq_locked Dinghao Liu
2020-05-22 17:57 ` Tony Lindgren
2020-05-29 17:38 ` Kalle Valo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).