Skip to content

Commit

Permalink
usb: chipidea: udc: enable suspend interrupt after usb reset
Browse files Browse the repository at this point in the history
[ 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 <xu.yang_2@nxp.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Link: https://lore.kernel.org/r/20240823073832.1702135-1-xu.yang_2@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Xu Yang authored and gregkh committed Oct 17, 2024
1 parent b677b94 commit 4c83143
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/usb/chipidea/udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static int hw_device_state(struct ci_hdrc *ci, u32 dma)
hw_write(ci, OP_ENDPTLISTADDR, ~0, dma);
/* interrupt, error, port change, reset, sleep/suspend */
hw_write(ci, OP_USBINTR, ~0,
USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI);
USBi_UI|USBi_UEI|USBi_PCI|USBi_URI);
} else {
hw_write(ci, OP_USBINTR, ~0, 0);
}
Expand Down Expand Up @@ -862,6 +862,7 @@ __releases(ci->lock)
__acquires(ci->lock)
{
int retval;
u32 intr;

spin_unlock(&ci->lock);
if (ci->gadget.speed != USB_SPEED_UNKNOWN)
Expand All @@ -875,6 +876,11 @@ __acquires(ci->lock)
if (retval)
goto done;

/* clear SLI */
hw_write(ci, OP_USBSTS, USBi_SLI, USBi_SLI);
intr = hw_read(ci, OP_USBINTR, ~0);
hw_write(ci, OP_USBINTR, ~0, intr | USBi_SLI);

ci->status = usb_ep_alloc_request(&ci->ep0in->ep, GFP_ATOMIC);
if (ci->status == NULL)
retval = -ENOMEM;
Expand Down

0 comments on commit 4c83143

Please sign in to comment.