Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 42b32b1

Browse files
Artur Petrosyangregkh
authored andcommitted
usb: dwc2: Fix session request interrupt handler
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]>
1 parent 75f43ac commit 42b32b1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/usb/dwc2/core_intr.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ static void dwc2_handle_conn_id_status_change_intr(struct dwc2_hsotg *hsotg)
307307
static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg)
308308
{
309309
int ret;
310+
u32 hprt0;
310311

311312
/* Clear interrupt */
312313
dwc2_writel(hsotg, GINTSTS_SESSREQINT, GINTSTS);
@@ -328,6 +329,13 @@ static void dwc2_handle_session_req_intr(struct dwc2_hsotg *hsotg)
328329
* established
329330
*/
330331
dwc2_hsotg_disconnect(hsotg);
332+
} else {
333+
/* Turn on the port power bit. */
334+
hprt0 = dwc2_read_hprt0(hsotg);
335+
hprt0 |= HPRT0_PWR;
336+
dwc2_writel(hsotg, hprt0, HPRT0);
337+
/* Connect hcd after port power is set. */
338+
dwc2_hcd_connect(hsotg);
331339
}
332340
}
333341

0 commit comments

Comments
 (0)