Skip to contentSkip to conversation

USB:ehci:fix an interrupt calltrace error

PATCH Superseded Longfang Liu 2 participants 3 messages Jan 11, 2021 – Jan 12, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 USB:ehci:fix an interrupt calltrace error

The system that use Synopsys USB host controllers goes to suspend when using USB audio player. This causes the USB host controller 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 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.

---

Changes in v2:
- updated cleared registers

 drivers/usb/host/ehci-hub.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/host/ehci-hub.c +4 -0
index ce0eaf7..a99c1ac 100644
@@ -346,8 +346,12 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
 
 	unlink_empty_async_suspended(ehci);
 
+	/* Some Synopsys controllers mistakenly leave IAA turned on */
+	ehci_writel(ehci, STS_IAA, &ehci->regs->status);
+
 	/* Any IAA cycle that started before the suspend is now invalid */
 	end_iaa_cycle(ehci);
+
 	ehci_handle_start_intr_unlinks(ehci);
 	ehci_handle_intr_unlinks(ehci);
 	end_free_itds(ehci);
Signature · 1 line
2.8.1
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 14 lines · Longfang Liu

The system that use Synopsys USB host controllers goes to suspend when using USB audio player. This causes the USB host controller 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 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.

Quoted 4 lines

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

Quoted 28 lines

---

Changes in v2:
- updated cleared registers

 drivers/usb/host/ehci-hub.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/host/ehci-hub.c +4 -0
index ce0eaf7..a99c1ac 100644
@@ -346,8 +346,12 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
 
 	unlink_empty_async_suspended(ehci);
 
+	/* Some Synopsys controllers mistakenly leave IAA turned on */
+	ehci_writel(ehci, STS_IAA, &ehci->regs->status);
+
 	/* Any IAA cycle that started before the suspend is now invalid */
 	end_iaa_cycle(ehci);
+
 	ehci_handle_start_intr_unlinks(ehci);
 	ehci_handle_intr_unlinks(ehci);
 	end_free_itds(ehci);
Signature · 1 line
2.8.1
#2 lore raw

On 2021/1/12 1:07, Alan Stern Wrote:

Quoted 15 lines · Longfang Liu
Quoted 14 lines

The system that use Synopsys USB host controllers goes to suspend when using USB audio player. This causes the USB host controller 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 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.

Quoted 7 lines
Quoted 4 lines

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

OK, I will add it on the next patch

Thanks,
Longfang

Quoted 30 lines
Quoted 28 lines

---

Changes in v2:
- updated cleared registers

 drivers/usb/host/ehci-hub.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/usb/host/ehci-hub.c +4 -0
index ce0eaf7..a99c1ac 100644
@@ -346,8 +346,12 @@ static int ehci_bus_suspend (struct usb_hcd *hcd)
 
 	unlink_empty_async_suspended(ehci);
 
+	/* Some Synopsys controllers mistakenly leave IAA turned on */
+	ehci_writel(ehci, STS_IAA, &ehci->regs->status);
+
 	/* Any IAA cycle that started before the suspend is now invalid */
 	end_iaa_cycle(ehci);
+
 	ehci_handle_start_intr_unlinks(ehci);
 	ehci_handle_intr_unlinks(ehci);
 	end_free_itds(ehci);
Signature · 1 line
2.8.1

.