lkml.org 
[lkml]   [2019]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] usb: dwc2: hcd: call dwc2_is_controller_alive under spinlock
Date
This patch is referred to Robert's patch
commit cf54772b913b ("usb: dwc2: call dwc2_is_controller_alive() under spinlock")

During running sdb with otg mode, the usb is hung sometime.

The one of SDB hang issues should be fixed with this patch.
After hang, it doesn't never trigger the usb interrupt.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
drivers/usb/dwc2/hcd_intr.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c
index 88b5dcf..8d3b155 100644
--- a/drivers/usb/dwc2/hcd_intr.c
+++ b/drivers/usb/dwc2/hcd_intr.c
@@ -2222,13 +2222,13 @@ irqreturn_t dwc2_handle_hcd_intr(struct dwc2_hsotg *hsotg)
u32 gintsts, dbg_gintsts;
irqreturn_t retval = IRQ_NONE;

+ spin_lock(&hsotg->lock);
+
if (!dwc2_is_controller_alive(hsotg)) {
dev_warn(hsotg->dev, "Controller is dead\n");
- return retval;
+ goto out;
}

- spin_lock(&hsotg->lock);
-
/* Check if HOST Mode */
if (dwc2_is_host_mode(hsotg)) {
gintsts = dwc2_read_core_intr(hsotg);
@@ -2276,6 +2276,7 @@ irqreturn_t dwc2_handle_hcd_intr(struct dwc2_hsotg *hsotg)
}
}

+out:
spin_unlock(&hsotg->lock);

return retval;
--
2.7.4
\
 
 \ /
  Last update: 2019-02-14 11:04    [W:8.439 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site