Skip to content

Commit 7ad71de

Browse files
Xu Yanggregkh
Xu Yang
authored andcommittedOct 17, 2024
usb: chipidea: udc: enable suspend interrupt after usb reset
[ Upstream commit e4fdcc1 ] Currently, suspend interrupt is enabled before pullup enable operation. This will cause a suspend interrupt assert right after pullup DP. This suspend interrupt is meaningless, so this will ignore such interrupt by enable it after usb reset completed. Signed-off-by: Xu Yang <[email protected]> Acked-by: Peter Chen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d18dc8e commit 7ad71de

File tree

1 file changed

+7
-1
lines changed
  • drivers/usb/chipidea

1 file changed

+7
-1
lines changed
 

‎drivers/usb/chipidea/udc.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ static int hw_device_state(struct ci_hdrc *ci, u32 dma)
8484
hw_write(ci, OP_ENDPTLISTADDR, ~0, dma);
8585
/* interrupt, error, port change, reset, sleep/suspend */
8686
hw_write(ci, OP_USBINTR, ~0,
87-
USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI);
87+
USBi_UI|USBi_UEI|USBi_PCI|USBi_URI);
8888
} else {
8989
hw_write(ci, OP_USBINTR, ~0, 0);
9090
}
@@ -868,6 +868,7 @@ __releases(ci->lock)
868868
__acquires(ci->lock)
869869
{
870870
int retval;
871+
u32 intr;
871872

872873
spin_unlock(&ci->lock);
873874
if (ci->gadget.speed != USB_SPEED_UNKNOWN)
@@ -881,6 +882,11 @@ __acquires(ci->lock)
881882
if (retval)
882883
goto done;
883884

885+
/* clear SLI */
886+
hw_write(ci, OP_USBSTS, USBi_SLI, USBi_SLI);
887+
intr = hw_read(ci, OP_USBINTR, ~0);
888+
hw_write(ci, OP_USBINTR, ~0, intr | USBi_SLI);
889+
884890
ci->status = usb_ep_alloc_request(&ci->ep0in->ep, GFP_ATOMIC);
885891
if (ci->status == NULL)
886892
retval = -ENOMEM;

0 commit comments

Comments
 (0)
Please sign in to comment.