mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
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
This commit is contained in:
parent
47cd8786ba
commit
253cfbcd47
1 changed files with 8 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue