summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-04-20 14:46:43 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-04-20 14:46:43 +0000
commitbcf0b6cfb7c0eb7954ee1344abb28efad4afb4cd (patch)
treef9ddb75c0110c891940ea4f5862571bda9d40f30 /firmware
parent4b5f0909d1854c314ade444316448bda60a60d7e (diff)
downloadrockbox-bcf0b6cfb7c0eb7954ee1344abb28efad4afb4cd.tar.gz
rockbox-bcf0b6cfb7c0eb7954ee1344abb28efad4afb4cd.tar.bz2
rockbox-bcf0b6cfb7c0eb7954ee1344abb28efad4afb4cd.zip
disable irqs during the critical part of prime_transfer(). This improves the behaviour on PP502x when connected through a hub, bit it doesn't totally solve the problems
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17190 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/usb-drv-arc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/firmware/target/arm/usb-drv-arc.c b/firmware/target/arm/usb-drv-arc.c
index 3093120c83..a2f8819962 100644
--- a/firmware/target/arm/usb-drv-arc.c
+++ b/firmware/target/arm/usb-drv-arc.c
@@ -645,6 +645,7 @@ static int prime_transfer(int endpoint, void* ptr, int len, bool send, bool wait
static long last_tick;
struct transfer_descriptor* new_td;
+ int oldlevel = disable_irq_save();
/*
if (send && endpoint > EP_CONTROL) {
logf("usb: sent %d bytes", len);
@@ -696,6 +697,8 @@ static int prime_transfer(int endpoint, void* ptr, int len, bool send, bool wait
goto pt_error;
}
+ restore_irq(oldlevel);
+
if (wait) {
/* wait for transfer to finish */
wakeup_wait(&transfer_completion_signal[pipe], TIMEOUT_BLOCK);
@@ -708,6 +711,9 @@ static int prime_transfer(int endpoint, void* ptr, int len, bool send, bool wait
}
pt_error:
+ if(rc<0)
+ restore_irq(oldlevel);
+
/* Error status must make sure an abandoned wakeup signal isn't left */
if (rc < 0 && wait) {
/* Cancel wait */