aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHarro Haan <hrhaan@gmail.com>2010-03-01 11:38:37 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-03-29 12:36:04 -0400
commitc6c352371c1ce486a62f4eb92e545b05cfcef76b (patch)
tree23720c8ff4d431c809d670759bf10f43f78f60ff /drivers
parentfd522a8dec11a08b5fdd23982193808e268be19e (diff)
ARM: 5965/1: Fix soft lockup in at91 udc driver
Fix a potential soft lockup in the AT91 UDC driver by ensuring that the UDC clock is enabled inside the interrupt handler. If the UDC clock is not enabled then the UDC registers cannot be written to and the interrupt cannot be cleared or masked. Note that this patch (and other parts of the existing AT91 UDC driver) is potentially racy for preempt-rt kernels, but is okay for mainline. For more info see: http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100203/09cdb3b4/attachment.el http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100203/8443a1e4/attachment.el Signed-off-by: Ryan Mallon <ryan@bluewatersys.com> Acked-by: Harro Haan <hrhaan@gmail.com> Tested-by: Remy Bohmer <linux@bohmer.net> Acked-by: Andrew Victor <avictor.za@gmail.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/at91_udc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 12ac9cd32a07..df1bae9b048e 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1370,6 +1370,12 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc)
1370{ 1370{
1371 struct at91_udc *udc = _udc; 1371 struct at91_udc *udc = _udc;
1372 u32 rescans = 5; 1372 u32 rescans = 5;
1373 int disable_clock = 0;
1374
1375 if (!udc->clocked) {
1376 clk_on(udc);
1377 disable_clock = 1;
1378 }
1373 1379
1374 while (rescans--) { 1380 while (rescans--) {
1375 u32 status; 1381 u32 status;
@@ -1458,6 +1464,9 @@ static irqreturn_t at91_udc_irq (int irq, void *_udc)
1458 } 1464 }
1459 } 1465 }
1460 1466
1467 if (disable_clock)
1468 clk_off(udc);
1469
1461 return IRQ_HANDLED; 1470 return IRQ_HANDLED;
1462} 1471}
1463 1472