Skip to content

Commit

Permalink
usb: dwc2: Fix session request interrupt handler
Browse files Browse the repository at this point in the history
According to programming guide in host mode, port
power must be turned on in session request
interrupt handlers.

Fixes: 21795c8 ("usb: dwc2: exit hibernation on session request")
Cc: <[email protected]>
Acked-by: Minas Harutyunyan <[email protected]>
Signed-off-by: Artur Petrosyan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Artur Petrosyan authored and gregkh committed Apr 9, 2021
1 parent 75f43ac commit 42b32b1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/usb/dwc2/core_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ static void dwc2_handle_conn_id_status_change_intr(struct dwc2_hsotg *hsotg)
static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg)
{
int ret;
u32 hprt0;

/* Clear interrupt */
dwc2_writel(hsotg, GINTSTS_SESSREQINT, GINTSTS);
Expand All @@ -328,6 +329,13 @@ static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg)
* established
*/
dwc2_hsotg_disconnect(hsotg);
} else {
/* Turn on the port power bit. */
hprt0 = dwc2_read_hprt0(hsotg);
hprt0 |= HPRT0_PWR;
dwc2_writel(hsotg, hprt0, HPRT0);
/* Connect hcd after port power is set. */
dwc2_hcd_connect(hsotg);
}
}

Expand Down

0 comments on commit 42b32b1

Please sign in to comment.