From b29963feb618187963d99b98540446c8a2e35537 Mon Sep 17 00:00:00 2001
From: Jonathan Bell <jonathan@raspberrypi.com>
Date: Fri, 27 Mar 2026 14:32:52 +0000
Subject: [PATCH] usb: dwc2: only masquerade split-IN interrupt transfers

Some hub hardware does not differentiate pipe direction in the
non-periodic split handler, so transfers to the same endpoint index will
collide. A simple fix is to limit the non-periodic masquerade only to IN
transfers, which are also the most affected by interrupt latency.

A recurrence of https://github.com/raspberrypi/linux/issues/2024

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
---
 drivers/usb/dwc2/hcd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -685,7 +685,8 @@ static void dwc2_hc_init(struct dwc2_hso
 	 * Devices are none the wiser - the handshake tokens are the same.
 	 * The fakery is undone in dwc2_hc_n_intr().
 	 */
-	if (chan->do_split && chan->ep_type == USB_ENDPOINT_XFER_INT)
+	if (chan->ep_is_in && chan->do_split &&
+	    chan->ep_type == USB_ENDPOINT_XFER_INT)
 		chan->ep_type = USB_ENDPOINT_XFER_CONTROL;
 
 	hcchar |= chan->ep_type << HCCHAR_EPTYPE_SHIFT & HCCHAR_EPTYPE_MASK;
