Commit 70b1e9ea8c724997f9b9f0b2aed46799eddc686c
Committed by
Ajay Kumar Gupta
1 parent
c9c405dd9e
Exists in
master
usb: musb: Fix for handling overcurrent condition in host mode
The overcurrent situation can occur in 2 scenarios a) when usb device connected directly to musb root-port and device draw the more current, further the VBUS_ERROR is generated and root-hub port change status need to be notified to hub driver to handle over-current situation. b) when usb device connected thrugh HUB, the hub status change will be notified by hub through interrupt transfer and handled approperiately by HUB driver. This patch fixes (a), where root hub status change was not notified to hub driver. Signed-off-by: Ravi B <ravibabu@ti.com>
Showing 1 changed file with 8 additions and 0 deletions Side-by-side Diff
drivers/usb/musb/musb_core.c
... | ... | @@ -571,6 +571,7 @@ |
571 | 571 | } |
572 | 572 | |
573 | 573 | if (int_usb & MUSB_INTR_VBUSERROR) { |
574 | + struct usb_hcd *hcd = musb_to_hcd(musb); | |
574 | 575 | int ignore = 0; |
575 | 576 | |
576 | 577 | /* During connection as an A-Device, we may see a short |
... | ... | @@ -610,6 +611,13 @@ |
610 | 611 | musb->port1_status |= |
611 | 612 | USB_PORT_STAT_OVERCURRENT |
612 | 613 | | (USB_PORT_STAT_C_OVERCURRENT << 16); |
614 | + | |
615 | + if (hcd->status_urb) | |
616 | + usb_hcd_poll_rh_status(hcd); | |
617 | + else | |
618 | + usb_hcd_resume_root_hub(hcd); | |
619 | + | |
620 | + MUSB_HST_MODE(musb); | |
613 | 621 | } |
614 | 622 | break; |
615 | 623 | default: |