diff options
author | Mihail Zenkov <mihail.zenkov@gmail.com> | 2016-02-20 03:02:24 +0000 |
---|---|---|
committer | Gerrit Rockbox <gerrit@rockbox.org> | 2016-03-18 14:02:17 +0100 |
commit | 4c6871cffaf5917165fc05d6bf77bd4cff34cfd5 (patch) | |
tree | d235ca58fb7ab63896483a4563d9e8a8b317ce42 /firmware | |
parent | bb48fa02d2057753dc5695d7e21c6d63cac8b75c (diff) | |
download | rockbox-4c6871cffaf5917165fc05d6bf77bd4cff34cfd5.tar.gz rockbox-4c6871cffaf5917165fc05d6bf77bd4cff34cfd5.zip |
usb-s3c6400x: prevent lockup if usb extracted during data sending
Change-Id: I5e87a9c47defa90e15800666e8ab4608ef5de299
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/usb-s3c6400x.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/firmware/target/arm/usb-s3c6400x.c b/firmware/target/arm/usb-s3c6400x.c index 27164aef69..d51a71165c 100644 --- a/firmware/target/arm/usb-s3c6400x.c +++ b/firmware/target/arm/usb-s3c6400x.c | |||
@@ -432,7 +432,7 @@ void usb_drv_exit(void) | |||
432 | ORSTCON = 7; /* Put the PHY into reset (needed to get current down) */ | 432 | ORSTCON = 7; /* Put the PHY into reset (needed to get current down) */ |
433 | udelay(10); | 433 | udelay(10); |
434 | PCGCCTL = 1; /* Shut down PHY clock */ | 434 | PCGCCTL = 1; /* Shut down PHY clock */ |
435 | 435 | ||
436 | #if CONFIG_CPU==S5L8701 | 436 | #if CONFIG_CPU==S5L8701 |
437 | PWRCON |= 0x4000; | 437 | PWRCON |= 0x4000; |
438 | PWRCONEXT |= 0x800; | 438 | PWRCONEXT |= 0x800; |
@@ -619,7 +619,7 @@ int usb_drv_send(int ep, void *ptr, int len) | |||
619 | struct ep_type *endpoint = &endpoints[ep][1]; | 619 | struct ep_type *endpoint = &endpoints[ep][1]; |
620 | endpoint->done = false; | 620 | endpoint->done = false; |
621 | ep_transfer(ep, ptr, len, false); | 621 | ep_transfer(ep, ptr, len, false); |
622 | while (endpoint->busy && !endpoint->done) | 622 | while (endpoint->busy && !endpoint->done && usb_detect() != USB_EXTRACTED) |
623 | semaphore_wait(&endpoint->complete, TIMEOUT_BLOCK); | 623 | semaphore_wait(&endpoint->complete, HZ); |
624 | return endpoint->status; | 624 | return endpoint->status; |
625 | } | 625 | } |