From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796381902; b=0WYjFHUpPY0l6jyGh948A/7qVI6BXhAW0U2Mw5FdJ04p38gUiZkMPyPbfKrhFAwXz2E/ d/b4qdNBAhgU6XG2mVHNOGVQxEPraMZdZThTyXpUNPye/KX4pJ8+vue2iOya1pSZpqgjg EbHyq6w1I5C7kV14vjmPgiQS8+Q84KUnOvUtSAIoq/vskztIW2qT/GN5NMW1CXCPSodAr sMe3m9FAY8UOMU00p6lH/M5/v5DIPZv3JnTbm2Cfin7GNdXJu/020XGgDYOQCvzvgXLn1 N5EByx22/XQvAVAIlx9oouF4QlIvU1kwj+mub5RnUtJI3Za3KQXRqOjVHjKXHe4BNaw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796381902; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=z4b1cVOZq7KwxiDENh/MJLx+zof6Q3j+mQX6WSgUk2Y=; b=TPKSIAQiTFC7kL4jJO94AkSWocvRArEeFBFt9Uy9yGEJvPeHZZnw6xnxpHYWrxpZAZD9 2/XOx6s1xJT05ZpOquxi1cvZUu0o2fa4pNmzTh5C734O0dqaMX4y+i8XE/URIqS9Np2HA 9Wn92P4RgEu7WwlF9CYgDU2fjsqATBfkwXBsZmUZtXwG9qFvNvmu4sBzULjvdA8dp0Nq9 9GvUr5636mGsagwiLvWi6FsV+pB2Qcs4d2ssZQadxd6kFKwh+SNyYObyDbH995zasukyy POFCf6Uc4GqcM6P6HoM43BxRmsSLIQxyV5gmJIbvAm/ASq8zOnCJ9ryOCTxtvuoVqeA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="M/r163zQ"; arc=none smtp.remote-ip=209.85.128.44 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9D1BC606A337 for ; Fri, 4 Dec 2026 10:58:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9D1BC606A337 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=M/r163zQ Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4a3517554f7so6485195e9.2 for ; Fri, 04 Dec 2026 02:58:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796381900; x=1796986700; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=z4b1cVOZq7KwxiDENh/MJLx+zof6Q3j+mQX6WSgUk2Y=; b=M/r163zQaa6LM4rkcxK9o7d4Of0aJt3RjedqBdMeCxNnUsGbYbUeqknd7RTL9jCv9u JvwpOL5JikBSbx3K7xS9Lf6ilmCdZ/4YlhZkW4NYvv9xok2bV4m/Rcl22tnC+XxI2VN0 ZXzclvY0XonDF1MZcYYrD3j10tDwigLIbx4BNwjDHDwDKLvaB6DaYzaPMhV719/72wCW K1D7SWptQJMhfY20DCjfVsz4yhcDij8c4xS1bC5W0iFrXKPmAWct8e9z+cl6G16vppPL neSrONyi+oHjI0ZhwuSzagSFcVKbqCx9dWnV1zUF+Tt6iY5RyRQYn6cooo4xuNvGyghA sdBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796381900; x=1796986700; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=z4b1cVOZq7KwxiDENh/MJLx+zof6Q3j+mQX6WSgUk2Y=; b=qzIGGczlKu9pBgolIRL9pT14ZH5kgVJ2Dr+SsXa+T0+QEegBWDinoqKs7MCcgblJC2 f/aBZcM/hYsLfQShYNfSDgeq4sJPaRk/lWITkTG2co7NTrPke0o+406VLU4YSIrqw0Nx zhIvpeV51qlxhVZfP9DMeNaY8vH7sx+whmHergVYsFouMND47eQ7ZhbPW1mBcj7Qqorl /u41W791uYp+8Stld4RF5KzQyMik6pTQWQujH+hq4+YWlz48X9LLaFc0EDDtcaR5lXRJ wX+oJNnduw8NXb+aErsukp8BGhKZTV8kHjULqvbL7U2Bs0a3hm22RuLGlyYEBmvIISqz bTwQ== X-Forwarded-Encrypted: i=1; AL+hErF41wjGOvM+doj6FLqKYR+Lzuwj97s5GQNk7i+y7HWOBVOKVKPsjZ/tM1sjJ3lG51LEkvuLuKQgn1I=@vger.kernel.org X-Gm-Message-State: APuU4Z8lKDPssdlBLdsNSUxFUfpvSjoN2rnUFxLrLgX/a5PGCy05ANZ8 Fa8Ug9UHGm/uML9kVuDooAMjq5B7nDIy8LTyfKPxUzW20Oy7ZZLOtMaU+A1mkA== X-Gm-Gg: AZFdTZc86gBvKA+ajzjdrTKmM+AQ5XIalsjUo0yFvg4P3j24Ungv7dakSD2zAPJsNFc H19mw9IAEuqZ6i9BNQgxF6kOmJYxe4tiAH7evJk/PlUGt0fI8wqQ2ylMi663MoMkx11BWYsnjWY hZrFLrhDqSyRlLqegj0WX32WpLzykoRZTZReAp0iyDWeqxQR5pPFXasogjxsUEgTGrgVV5RwqUq QYgNrq5sNzTaPUxMO2XAg7KJrTmd3j+9iLlnXZdivWKeF7BDyM2E3aKpdkBvpNxaARuwyY/tcXw BmgSlK3tC7pmIk4uls4m7NLRu7tK4yskZ5d6KPqVQqXfSPVMIJE4j0NS0EgBcUY30NHuZz+87X3 3wpf5Lwkx6yb5vIP/qQ4oW3A80y/cmY98TaACzCkIWeFPf9sAiQhnTSBxY9DF1OhLMvaaqBIYht jRjegeTvLJM5kGv76PVTKekFSIKvwUuY8kAhWDbvEQClWDX3KVQyLFELluMRn++KySCxXAvYJa+ qqrKRCUHeiTG6PbjgFR5N78UJHWSAQu7fzJVmwQmAhdCYbBNk1ZRrtgswjZIz3t+M6kAyhNfIkZ Hnni2VasRKZzDbMfVkabTilaPZmo+PR+xobA X-Received: by 2002:a05:600c:3d9a:b0:4a2:5267:3cd4 with SMTP id 5b1f17b1804b1-4bbeb6eede6mr29810495e9.3.1796381899990; Fri, 04 Dec 2026 02:58:19 -0800 (PST) Received: from foxbook (bfj60.neoplus.adsl.tpnet.pl. [83.28.47.60]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbe21895edsm139298015e9.15.2026.12.04.02.58.19 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 04 Dec 2026 02:58:19 -0800 (PST) Date: Fri, 4 Dec 2026 11:58:23 +0100 From: Michal Pecio To: Henry Tseng Cc: Mathias Nyman , Mathias Nyman , Greg Kroah-Hartman , linux-usb@vger.kernel.org Subject: Re: [PATCH 0/2] xhci: handshake timeout overrun and configure endpoint hang on device disconnect Message-ID: <20261204115823.04daaa91.michal.pecio@gmail.com> In-Reply-To: <20261127101730.70717-1-henrytseng@qnap.com> References: <20260930101752.15794-1-henrytseng@qnap.com> <20261127101730.70717-1-henrytseng@qnap.com> X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 27 Nov 2026 18:17:21 +0800, Henry Tseng wrote: > On Wed, 30 Sep 2026 18:17:50 +0800, Henry Tseng wrote: > > This series addresses two problems found while debugging an AMD Raven > > USB 3.1 xHCI (1022:15e0) that gets declared dead when a USB storage > > enclosure is unplugged. During teardown a command fails to complete, > > aborting the command ring also fails, and the whole host is declared > > dead, taking unrelated devices on other root ports down with it: > > > > xhci_hcd 0000:0c:00.3: Command timeout, USBSTS: 0x00000010 PCD > > xhci_hcd 0000:0c:00.3: Abort command ring > > xhci_hcd 0000:0c:00.3: Abort failed to stop command ring: -110 > > xhci_hcd 0000:0c:00.3: xHCI host controller not responding, assume dead > > > > Hi Mathias, > > Gentle ping on this series. A short summary, since the thread got long: > > On an AMD Raven xHCI (1022:15e0), unplugging a QNAP TL-D800C enclosure > leaves the Configure Endpoint command that drops a hub's endpoints > during teardown incomplete. The command ring abort then fails and the > host is declared dead, taking down devices on other root ports too. > It only happens when the command is issued after the root port > disconnect, deconfiguring the same hubs while still connected works. > > Since Disable Slot follows right after and disables all endpoints of > the slot anyway (xHCI 4.8.3), the idea is to skip this Configure > Endpoint for disconnected devices. Michal saw no side effects on his > hosts when it is omitted before Disable Slot. > > v1 decided this from the roothub port state, but as Michal pointed > out, that can miss the case where the link comes back before > xhci_check_bandwidth() runs. For v2 I'd like to check > udev->state == USB_STATE_NOTATTACHED instead. usb_disconnect() sets > it on the device and its children before the command is issued, and > it doesn't change back. This should work, AFAICT usb_disconnect() is the only path in USB core which destroys configured devices, and it works as you described. USB_STATE_NOTATTACHED has the advantage of being immune to brief disconnections and not dependent on new v7.3 functionality, so easier to backport if necessary. Disadvantage: slower to respond, if somebody deconfigures manually while also pulling the plug. I suspect this is less likely to occur in practice than transient loss of link. > Would that work for you, and if so, would you prefer the check in > xhci_check_bandwidth() or in usb_hcd_alloc_bandwidth() in USB core? Probably in xhci-hcd: this ability to omit bandwidth reconfiguration in certain cases is xHCI-specific, even if xhci-hcd is the only HCD using these function now (and possibly forever, but who knows). I think core maintainers wouldn't want to deal with this hack. Regards, Michal