linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] USB:ehci:fix an interrupt calltrace error
@ 2020-11-26  3:34 Longfang Liu
  2020-11-26 16:08 ` Alan Stern
  0 siblings, 1 reply; 6+ messages in thread
From: Longfang Liu @ 2020-11-26  3:34 UTC (permalink / raw)
  To: gregkh; +Cc: linux-usb, linux-kernel

The system goes to suspend when using USB audio player. This causes
the USB device continuous send interrupt signal to system, When the
number of interrupts exceeds 100000, the system will forcibly close
the interrupts and output a calltrace error.

When the system goes to suspend, the last interrupt is reported to
the driver. At this time, the system has set the state to suspend.
This causes the last interrupt to not be processed by the system and
not clear the interrupt state flag. This uncleared interrupt flag
constantly triggers new interrupt event. This causing the driver to
receive more than 100,000 interrupts, which causes the system to
forcibly close the interrupt report and report the calltrace error.

so, when the driver goes to sleep and changes the system state to
suspend, the interrupt flag needs to be cleared.

Signed-off-by: Longfang Liu <liulongfang@huawei.com>
---
 drivers/usb/host/ehci-hub.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index ce0eaf7..5b13825 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -348,6 +348,11 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
 
 	/* Any IAA cycle that started before the suspend is now invalid */
 	end_iaa_cycle(ehci);
+
+	/* clear interrupt status */
+	if (ehci->has_synopsys_hc_bug)
+		ehci_writel(ehci, INTR_MASK | STS_FLR, &ehci->regs->status);
+
 	ehci_handle_start_intr_unlinks(ehci);
 	ehci_handle_intr_unlinks(ehci);
 	end_free_itds(ehci);
-- 
2.8.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-11  9:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-26  3:34 [PATCH] USB:ehci:fix an interrupt calltrace error Longfang Liu
2020-11-26 16:08 ` Alan Stern
2020-11-27  2:29   ` liulongfang
2020-11-27 15:47     ` Alan Stern
2020-11-28  3:22       ` liulongfang
2021-01-11  9:38         ` liulongfang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).