public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC 1/1] usb: host: xhci-plat: add enable XHCI-AVOID-BEI quirk by dts
@ 2024-06-01 12:06 joswang
  2024-06-03 12:22 ` Mathias Nyman
  0 siblings, 1 reply; 10+ messages in thread
From: joswang @ 2024-06-01 12:06 UTC (permalink / raw)
  To: mathias.nyman, gregkh; +Cc: linux-usb, linux-kernel, joswang

From: joswang <joswang@lenovo.com>

For Synopsys DWC31 2.00a and earlier versions, every isochronous
interval the BEI(Block Event Interrupt) flag is set for all except
the last Isoch TRB in a URB, host controller consumes the event
TRBs in the event ring, once the event ring is full, it will not
generate an interrupt and will stop all data transmission and command
execution.

To avoid the problem of event ring full, the XHCI-AVOID-BEI quirk is
introduced. Currently, the XHCI-AVOID-BEI quirk has been applied to all
Intel xHCI controllers, see commit '227a4fd801c8 ("USB: xhci: apply
XHCI-AVOID-BEI quirk to all Intel xHCI controllers")'.

For Linux system, each event ring consists of one or more event ring
segments and each segment is 4 KB that contains 256 TRBs. It seems that
the TRBs on the event ring are sufficient and the event ring will not be
full. In real application, if it does happen, event ring is full, host
controller no interrupt causes the driver to timeout.

However, applying XHCI-AVOID-BEI quirk will also bring power consumption
issues. We can consider the application scenarios of the product to decide
whether to enable it. Therefore, we add the enable XHCI-AVOID-BEI quirk
through dts configuration to make it more flexible.

Signed-off-by: joswang <joswang@lenovo.com>
---
 drivers/usb/host/xhci-plat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 3d071b875308..e1071827d4b3 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -253,6 +253,9 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 		if (device_property_read_bool(tmpdev, "quirk-broken-port-ped"))
 			xhci->quirks |= XHCI_BROKEN_PORT_PED;
 
+		if (device_property_read_bool(tmpdev, "quirk-avoid-bei"))
+			xhci->quirks |= XHCI_AVOID_BEI;
+
 		if (device_property_read_bool(tmpdev, "xhci-sg-trb-cache-size-quirk"))
 			xhci->quirks |= XHCI_SG_TRB_CACHE_SIZE_QUIRK;
 
-- 
2.17.1


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

end of thread, other threads:[~2024-07-01 11:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-01 12:06 [RFC 1/1] usb: host: xhci-plat: add enable XHCI-AVOID-BEI quirk by dts joswang
2024-06-03 12:22 ` Mathias Nyman
2024-06-05  5:37   ` joswang
2024-06-05 10:33     ` Mathias Nyman
2024-06-06 14:08       ` joswang
2024-06-11 10:03         ` Mathias Nyman
2024-06-11 14:45           ` joswang
2024-06-11 14:58             ` Mathias Nyman
2024-06-12 14:23               ` joswang
2024-07-01 11:44                 ` joswang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox