summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-06-01 19:29:01 +0000
committerTobias Diedrich <ranma+coreboot@tdiedrich.de>2010-06-01 19:29:01 +0000
commit253cfbcd47adfe3d7ccbd6f1646b1486397682df (patch)
tree3caac18832bc2b1f296afdd6b0b02c92facf4e4a
parent47cd8786ba46a0d0d1c0f931363ca36181e8547e (diff)
downloadrockbox-253cfbcd47adfe3d7ccbd6f1646b1486397682df.zip
rockbox-253cfbcd47adfe3d7ccbd6f1646b1486397682df.tar.gz
rockbox-253cfbcd47adfe3d7ccbd6f1646b1486397682df.tar.bz2
rockbox-253cfbcd47adfe3d7ccbd6f1646b1486397682df.tar.xz
Prevent a race condition when writing VIC_INT_EN_CLEAR. Should be very difficult to hit in this case though...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26451 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/as3525/usb-drv-as3525.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/usb-drv-as3525.c b/firmware/target/arm/as3525/usb-drv-as3525.c
index ca1d8cb..f50713e 100644
--- a/firmware/target/arm/as3525/usb-drv-as3525.c
+++ b/firmware/target/arm/as3525/usb-drv-as3525.c
@@ -544,6 +544,14 @@ void usb_drv_init(void)
void usb_drv_exit(void)
{
USB_DEV_CTRL |= (1<<10); /* soft disconnect */
+ /*
+ * mask all interrupts _before_ writing to VIC_INT_EN_CLEAR,
+ * or else the core might latch the interrupt while
+ * the write ot VIC_INT_EN_CLEAR is in the pipeline and
+ * so cause a fake spurious interrupt.
+ */
+ USB_DEV_EP_INTR_MASK = 0xffffffff;
+ USB_DEV_INTR_MASK = 0xffffffff;
VIC_INT_EN_CLEAR = INTERRUPT_USB;
CGU_USB &= ~(1<<5);
CGU_PERI &= ~CGU_USB_CLOCK_ENABLE;