From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0689D341677; Tue, 26 Aug 2025 13:17:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756214261; cv=none; b=YHmESRadwFBVBQKon2JT5jLOpRDWKsw0TdStkyUpQbwyRexfVSai+jCTZ8zwlxU645Tx4OP2FiCs8dwhs/hLlaJlTKVmDfZ9B2dieE0ZmdyWurNC6Fm4xulTb0tMh9YZ9ipk7zPYGNXAE1vrhfQRJwjuryhx3BlJ+l/O8EMkE+I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756214261; c=relaxed/simple; bh=csFa+iiR+SWXdlRtpIUD5V13LjiYFcp3LpUOI4hjv4k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GktSaYIqJ1BHvlfXDeJGspUZrWUZkV47A6ZIAbtl9jaWvB9+oRmFWQOqBRiBnmE9XjerWI8QxsdrDC7gn74FeioUdju93IBks7W4LB0zcaGpfZyQ5Wl8sEr3/Nvvan5SXR00aNSrcc28/HKlMx0zwYLZWZNDMaWzflb3fETOW9A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xXaELfXh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xXaELfXh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 476B4C4CEF1; Tue, 26 Aug 2025 13:17:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756214260; bh=csFa+iiR+SWXdlRtpIUD5V13LjiYFcp3LpUOI4hjv4k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xXaELfXhFQMsMbuxRZMZjhY2OPf4Nm9HE4PuCH3/7xbTpqujnWIg1GnaZ8BgtARI8 /UZq/NihrwUcf4q13BPHfcIhHyxhaYTLb6gXrOsohEhz6izh5S8+1Wx6BH3oYEo2BK hHyRM0YJ8wEYfnTXdh4s6rqoGm2myXt+B0MPsNgk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mario Limonciello , Mathias Nyman , Sasha Levin Subject: [PATCH 6.1 071/482] usb: xhci: Avoid showing errors during surprise removal Date: Tue, 26 Aug 2025 13:05:24 +0200 Message-ID: <20250826110932.589947766@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110930.769259449@linuxfoundation.org> References: <20250826110930.769259449@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mario Limonciello [ Upstream commit 4b9c60e440525b729ac5f071e00bcee12e0a7e84 ] When a USB4 dock is unplugged from a system it won't respond to ring events. The PCI core handles the surprise removal event and notifies all PCI drivers. The XHCI PCI driver sets a flag that the device is being removed as well. When that flag is set don't show messages in the cleanup path for marking the controller dead. Signed-off-by: Mario Limonciello Signed-off-by: Mathias Nyman Acked-by: Mathias Nyman Link: https://lore.kernel.org/r/20250717073107.488599-2-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/xhci-ring.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index c4880b22f359..c8e1ead0c09e 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -1289,12 +1289,15 @@ static void xhci_kill_endpoint_urbs(struct xhci_hcd *xhci, */ void xhci_hc_died(struct xhci_hcd *xhci) { + bool notify; int i, j; if (xhci->xhc_state & XHCI_STATE_DYING) return; - xhci_err(xhci, "xHCI host controller not responding, assume dead\n"); + notify = !(xhci->xhc_state & XHCI_STATE_REMOVING); + if (notify) + xhci_err(xhci, "xHCI host controller not responding, assume dead\n"); xhci->xhc_state |= XHCI_STATE_DYING; xhci_cleanup_command_queue(xhci); @@ -1308,7 +1311,7 @@ void xhci_hc_died(struct xhci_hcd *xhci) } /* inform usb core hc died if PCI remove isn't already handling it */ - if (!(xhci->xhc_state & XHCI_STATE_REMOVING)) + if (notify) usb_hc_died(xhci_to_hcd(xhci)); } -- 2.39.5