Skip to content
Browse files

Sleep of death workaround related to adb

  • Loading branch information...
1 parent 45b6e95 commit 7ba1b0b9ad33335e5c3fda198471be731b241746 @dalingrin committed May 12, 2011
Showing with 12 additions and 0 deletions.
  1. +12 −0 drivers/usb/musb/musb_gadget.c
View
12 drivers/usb/musb/musb_gadget.c
@@ -1159,6 +1159,7 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
struct musb *musb;
int status = 0;
unsigned long lockflags;
+ struct usb_request *r, *tmp;
if (!ep || !req)
return -EINVAL;
@@ -1216,6 +1217,17 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req,
goto cleanup;
}
+ /* If we have the request already, kill the offender */
+ list_for_each_entry_safe(r, tmp, &musb_ep->req_list, list) {
+ if (to_musb_request(r) != request)
+ continue;
+ WARN_ON(1);
+ send_sig(SIGKILL, current, 0);
+ status = -ESHUTDOWN;
+ goto cleanup;
+ }
+
+
/* add request to the list */
list_add_tail(&(request->request.list), &(musb_ep->req_list));

0 comments on commit 7ba1b0b

Please sign in to comment.
Something went wrong with that request. Please try again.