forked from len0rd/rockbox
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
This commit is contained in:
parent
4b5f0909d1
commit
bcf0b6cfb7
1 changed files with 6 additions and 0 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue