Skip to content

Commit 253214e

Browse files
author
Dinh Nguyen
committed
usb: dwc2: call dwc2_is_controller_alive() under spinlock
This patch fixes the following problem: data transmission in direction IN break unless the GSNPSID register access is done with spinlock held. This issue occurs at least in Exynos4412 SoC, probably in many SoC's from Exynos familly. The problem is described here: https://lkml.org/lkml/2014/12/22/185 And there is linux mailing list discussion: https://lkml.org/lkml/2015/1/14/17 Signed-off-by: Robert Baldyga <r.baldyga@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com> [dinh: ported to 3.10-ltsi] Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
1 parent cd06bd5 commit 253214e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/usb/dwc2/core_intr.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,13 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev)
469469
int retry_count = 8;
470470
irqreturn_t retval = IRQ_HANDLED;
471471

472+
spin_lock(&hsotg->lock);
473+
472474
if (dwc2_check_core_status(hsotg) < 0) {
473475
dev_warn(hsotg->dev, "Controller is disconnected\n");
474476
goto out;
475477
}
476478

477-
spin_lock(&hsotg->lock);
478479
irq_retry:
479480
gintsts = dwc2_read_common_intr(hsotg);
480481
if (gintsts & ~GINTSTS_PRTINT)
@@ -611,8 +612,8 @@ irqreturn_t dwc2_handle_common_intr(int irq, void *dev)
611612
if (gintsts & IRQ_RETRY_MASK && --retry_count > 0)
612613
goto irq_retry;
613614

614-
spin_unlock(&hsotg->lock);
615615
out:
616+
spin_unlock(&hsotg->lock);
616617
return IRQ_RETVAL(retval);
617618
}
618619
EXPORT_SYMBOL_GPL(dwc2_handle_common_intr);

0 commit comments

Comments
 (0)