From acf66f7dd2f3c2bfc7eaedd2d95e018a0a9002df Mon Sep 17 00:00:00 2001 From: pamaury Date: Mon, 24 Jan 2011 15:34:14 +0000 Subject: [PATCH] as3525v2-usb: mask usb interrupt when setting up a transfer git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29130 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/usb-drv-as3525v2.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/firmware/target/arm/as3525/usb-drv-as3525v2.c b/firmware/target/arm/as3525/usb-drv-as3525v2.c index dc9e0b394..165c0e472 100644 --- a/firmware/target/arm/as3525/usb-drv-as3525v2.c +++ b/firmware/target/arm/as3525/usb-drv-as3525v2.c @@ -748,6 +748,9 @@ static int usb_drv_transfer(int ep, void *ptr, int len, bool dir_in, bool blocki logf("usb-drv: xfer EP%d, len=%d, dir_in=%d, blocking=%d", ep, len, dir_in, blocking); + /* mask the usb interrupt to avoid any race */ + VIC_INT_EN_CLEAR = INTERRUPT_USB; + volatile unsigned long *epctl = dir_in ? &DIEPCTL(ep) : &DOEPCTL(ep); volatile unsigned long *eptsiz = dir_in ? &DIEPTSIZ(ep) : &DOEPTSIZ(ep); volatile unsigned long *epdma = dir_in ? &DIEPDMA(ep) : &DOEPDMA(ep); @@ -789,6 +792,9 @@ static int usb_drv_transfer(int ep, void *ptr, int len, bool dir_in, bool blocki DEPCTL |= DEPCTL_epena | DEPCTL_cnak; + /* unmask the usb interrupt */ + VIC_INT_ENABLE = INTERRUPT_USB; + if(blocking) { wakeup_wait(&endpoint->complete, TIMEOUT_BLOCK); -- 2.11.4.GIT