Skip to content
Snippets Groups Projects
Commit 84d36b30 authored by Remy Bohmer's avatar Remy Bohmer
Browse files

USB: usb_control_msg wait for driver ISR to set status.


This patch changes usb_control_msg back to the state prior to commit
48867208.

The USB driver ISR routine may update the status.

Signed-off-by: default avatarDaniel Hellstrom <daniel@gaisler.com>
parent 6e20e64f
No related branches found
No related tags found
No related merge requests found
...@@ -197,16 +197,21 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe, ...@@ -197,16 +197,21 @@ int usb_control_msg(struct usb_device *dev, unsigned int pipe,
if (timeout == 0) if (timeout == 0)
return (int)size; return (int)size;
if (dev->status != 0) {
/* /*
* Let's wait a while for the timeout to elapse. * Wait for status to update until timeout expires, USB driver
* It has no real use, but it keeps the interface happy. * interrupt handler may set the status when the USB operation has
* been completed.
*/ */
wait_ms(timeout); while (timeout--) {
return -1; if (!((volatile unsigned long)dev->status & USB_ST_NOT_PROC))
break;
wait_ms(1);
} }
if (dev->status)
return -1;
return dev->act_len; return dev->act_len;
} }
/*------------------------------------------------------------------- /*-------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment