mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
usb-s3c6400x: prevent lockup if usb extracted during data sending
Change-Id: I5e87a9c47defa90e15800666e8ab4608ef5de299
This commit is contained in:
parent
bb48fa02d2
commit
4c6871cffa
1 changed files with 3 additions and 3 deletions
|
|
@ -432,7 +432,7 @@ void usb_drv_exit(void)
|
||||||
ORSTCON = 7; /* Put the PHY into reset (needed to get current down) */
|
ORSTCON = 7; /* Put the PHY into reset (needed to get current down) */
|
||||||
udelay(10);
|
udelay(10);
|
||||||
PCGCCTL = 1; /* Shut down PHY clock */
|
PCGCCTL = 1; /* Shut down PHY clock */
|
||||||
|
|
||||||
#if CONFIG_CPU==S5L8701
|
#if CONFIG_CPU==S5L8701
|
||||||
PWRCON |= 0x4000;
|
PWRCON |= 0x4000;
|
||||||
PWRCONEXT |= 0x800;
|
PWRCONEXT |= 0x800;
|
||||||
|
|
@ -619,7 +619,7 @@ int usb_drv_send(int ep, void *ptr, int len)
|
||||||
struct ep_type *endpoint = &endpoints[ep][1];
|
struct ep_type *endpoint = &endpoints[ep][1];
|
||||||
endpoint->done = false;
|
endpoint->done = false;
|
||||||
ep_transfer(ep, ptr, len, false);
|
ep_transfer(ep, ptr, len, false);
|
||||||
while (endpoint->busy && !endpoint->done)
|
while (endpoint->busy && !endpoint->done && usb_detect() != USB_EXTRACTED)
|
||||||
semaphore_wait(&endpoint->complete, TIMEOUT_BLOCK);
|
semaphore_wait(&endpoint->complete, HZ);
|
||||||
return endpoint->status;
|
return endpoint->status;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue