Linux kernel -stable discussions
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] xhci: keep port link_inactive and connected flags in sync" failed to apply to 7.3-stable tree
@ 2026-11-25 11:42 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2026-11-25 11:42 UTC (permalink / raw)
  To: mathias.nyman, gregkh, stable; +Cc: stable


The patch below does not apply to the 7.3-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-7.3.y
git checkout FETCH_HEAD
git cherry-pick -x bb261776d1a29768b8fd84eb4f42d99dafa29c93
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026112546-prize-perceive-c817@gregkh' --subject-prefix 'PATCH 7.3.y' 'HEAD^..'

Possible dependencies:



thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From bb261776d1a29768b8fd84eb4f42d99dafa29c93 Mon Sep 17 00:00:00 2001
From: Mathias Nyman <mathias.nyman@linux.intel.com>
Date: Thu, 5 Nov 2026 19:51:02 +0200
Subject: [PATCH] xhci: keep port link_inactive and connected flags in sync
 when polled

Update port 'link_inactive' and 'connected' flags even if xHC isn't
generating port change events.

xHC only generates port change events on port changes after old port
change bits are cleared. Hub driver is often kept up to date
by polling the port status.

Sashiko reported a possible case where all port changes after a port
reset take place before hub driver clears the reset change bit.
This way the port can end up connected and fully running with link
in u0 without a port event clearing the 'link_inactive' or setting
the 'connected' flags.

A protocol STALL in this state would set EP_DROP_PENDING, and
prevent all future URBs for the endpoint.

Fix this by also updating the flags during get_port_status(), when
hub driver is polling the port state.

Fixes: 6895dbdc19d9 ("xhci: give back TDs and clean up ep0 after disconnect")
Link: https://lore.kernel.org/linux-usb/sashiko-outbox-190046@kernel.org/
Cc: stable <stable@kernel.org>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://patch.msgid.link/20261105175106.241182-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 470bafe1802b..55430b673f1e 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -1166,6 +1166,12 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd, struct xhci_bus_state *bus_
 	if (portsc & PORT_RESET)
 		status |= USB_PORT_STAT_RESET;
 
+	/* track connect and link error status when hub is polling */
+	if (!(portsc & PORT_RESET)) {
+		port->link_inactive = (portsc & PORT_PLS_MASK) == XDEV_INACTIVE;
+		port->connected = !!(portsc & PORT_CONNECT);
+	}
+
 	/* USB2 and USB3 specific bits, including Port Link State */
 	if (hcd->speed >= HCD_USB3)
 		xhci_get_usb3_port_status(port, &status, portsc);


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-25 12:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 11:42 FAILED: patch "[PATCH] xhci: keep port link_inactive and connected flags in sync" failed to apply to 7.3-stable tree gregkh

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