From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0930C3ACA5B for ; Fri, 27 Feb 2026 11:05:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772190340; cv=none; b=mBqH1T56I5jwAB7EMznpiXtK4LAa3ivBHmObtyWBCnp2RwmgoXjRL6aAy3RI9x/ApdYbbyuawUoh257HayHstcimJKrfDMbIvvBN9QddAJkmwWk6/Gvarsjq2qtKFCUyWdnc9dZka9hO/D+bWv/+aDljTdgTsC1DWBOQXmshcac= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772190340; c=relaxed/simple; bh=K7/dqLGhzaE4SqXmDnBlTcJ4PFnNjTIs0xCN2zVIBVE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=u/mbS3fby1/qtMlWQwevcfN0J03SgPkYGLdRKti8nKvc44+tmRtWgUdKJLDpPfDUwWoOVZfvpV4O3TJKl71Wu1uTXpoC3w0lB98JshowD8kvT/ZKpdDM9pOYA2d8F5K+XQes83NuwVJybwmxQS43vyfZOnz1A/6bgNMPXVlfM/g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GfTK60Fx; arc=none smtp.client-ip=209.85.208.42 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.b="GfTK60Fx" Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-65c5a7785b4so3074724a12.1 for ; Fri, 27 Feb 2026 03:05:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772190337; x=1772795137; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=K7/dqLGhzaE4SqXmDnBlTcJ4PFnNjTIs0xCN2zVIBVE=; b=GfTK60FxzU6UR293EF8r+RBBfdPPRDLGIDgjPEsE9uao6vnT08NhlKSCyXzd+ac1UB FUaMfeTO0P6Q5DRbmEPqZ0ecwLOzlLke+9pH6ldmxak2ft9wF8W8LknVTTgNDLvR+eJJ bsOYeyJHE3A2ZZY2Cnm6lzua0f+qlxOjCLISz2SnHlUhW1LdZyK8EpuqoEfOTyeXONXm aFrOfORAjVzh0pZEgGH/8fmomyTvC8cfygJ7qtcTOo3xnTcOkpP/WzgxH8nx4csgfv32 ODA8STdC8dXpPwcRvT05jWl7QGE88Dv8O8KmY7jyH3T0YTfjtwHm7l26lQovjdEgrIhs CQaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772190337; x=1772795137; h=content-transfer-encoding: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; bh=K7/dqLGhzaE4SqXmDnBlTcJ4PFnNjTIs0xCN2zVIBVE=; b=ULm2l/fgneMPWdxNlQhj34i5DpyVBbafrCx8KB58RUpuwj8tHbMG2FM4/UyQKKSLuX pPf4UWuQjQdTHNobtZi6nlB1kgK/zcmgpwDGs8dCRsc8TuMB0GKIS7tzd6HL9k3bHfLL ixU5YKhNMRkW0V4iB6PAUiwXBDvQ2xWnIzPHsTuB/JkXb8HAqPYkNgPU7AMfEZrLFAJV R3p4/c/Qce/vE4VZy4dVIVS7Q1cAnnnhdmHDHor7Qd8Ik/2Cin2rdS/iicTCtbdIh0yp wKE+Lj2rbD8eN7RHuW7tbA8TH5Z9K+2qS5F9X4m3W6B2dL2QHgqSMmQXWCaWBbaZRHxp 3AVg== X-Forwarded-Encrypted: i=1; AJvYcCV049x8VFoKGC8BMLYQM1TZa5M1NrxNzTi4OJWwDd25Kzqqei0esvImwk+dHbjZlGQqGrjZTH89C6+sjQY=@vger.kernel.org X-Gm-Message-State: AOJu0Yxk7nVuZAzO5class0IiK/Qj4tjpD6AGBceNowvsnVuoR5MiAhd hwOjJM5Ky58+37SDFUNcYDFzFd5+8z1BzY8POX8FNQLuoZiLVuFnptfv X-Gm-Gg: ATEYQzyK4ZMI9k18wm5S0RiAi0HYBM0LkJHaJn8Yx06gvcyhtF+7hj6eADMQaU7+nTD SplNOZC0UuqK8kUPva6NRhUFGWhuyuN5U/zmP1FeMxsrB2lIcY/KpAj/MwubjhNJEV+ZLSp8KiW VK2BdR0CSlGRJG+DB/YkfLErUqINauwNWiOATmMnX+ZNiKZM/mWX3S5LnaIhYkGNrq7ef+GaJDY lex6LZxbRrCJsxdUSV+oiSeUx2IGr9OnCfm1YqaCkhv5sXTZZxEa3WrY2Df9p+sVikk56e9rCO3 bbyTxGhTLdDvx7tn86+R3O55wIeLMgvleysxWgLQvRfPyQTnyTW9ndZyMRumeBIk4BfjYsWbFkz vt4fxuj2iSFbghDtR5k1NGUhOQ6vR9WjTbfOm9Kb+qfe7mW+E/OuwCuiWEA2GkLZEtjbIuL5NOq YJpm3LmuotmTY0NjazvOOqHV+rYRbSl86VhqaBmwkQy2I= X-Received: by 2002:a17:906:9fc8:b0:b88:4c99:bc0e with SMTP id a640c23a62f3a-b93763d2329mr153686166b.26.1772190336989; Fri, 27 Feb 2026 03:05:36 -0800 (PST) Received: from foxbook (bfj19.neoplus.adsl.tpnet.pl. [83.28.47.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-65fac06dc16sm1199582a12.23.2026.02.27.03.05.34 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 27 Feb 2026 03:05:36 -0800 (PST) Date: Fri, 27 Feb 2026 12:05:30 +0100 From: Michal Pecio To: Mathias Nyman Cc: Thinh Nguyen , Dayu Jiang , Greg Kroah-Hartman , Mathias Nyman , Longfang Liu , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , yudongbin , guhuinan , chenyu45 , mahongwei3 , Niklas Neronin Subject: Re: [PATCH] usb: xhci: add xhci_halt() for HCE Handling Message-ID: <20260227120530.13395d2f.michal.pecio@gmail.com> In-Reply-To: <9113319a-b82c-42c7-ba1a-19113a5edb80@linux.intel.com> References: <20260127110422.306711-1-jiangdayu@xiaomi.com> <2026012708-liability-sincere-5ed4@gregkh> <2026012857-deprive-putdown-0ee8@gregkh> <871991ab-6c8f-47d4-a5b4-b65751750e71@linux.intel.com> <20260226181715.ofgjiq3iq7d7dx6y@synopsys.com> <9113319a-b82c-42c7-ba1a-19113a5edb80@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 27 Feb 2026 11:43:45 +0200, Mathias Nyman wrote: > On 2/26/26 20:17, Thinh Nguyen wrote: > > The controller is halted if there's an error like HCE. It's odd to > > try to "halt" it again. Not sure how this will impact for other > > controllers. > The host is messed up at this point, and we are not recovering it. > I don't think there is any harm in a manual halt at this stage. Specifically, calling xhci_halt() clears the USBCMD.Run flag and all USBCMD interrupt enable flags. Seems relatively harmless. Clearing USBCMD.Run would be the first step of resetting the HC anyway, so the HW should expect it to happen afetr reporting HCE. In case of HSE the HW should clear the Run bit by itself (4.10.2.6), but no such requirement seems to exist for HCE (4.24.1). The call also sets XHCI_STATE_HALTED and CMD_RING_STATE_STOPPED flags, which helps with recovering stuck URBs. When class drivers time out and unlink them, the URBs are given back instantly without drama. I just tested the HSE case where xhci_halt() is already being called and it worked for me. If I remove xhci_halt() then the driver tries to issue Stop Endpoint commands, times out and calls hc_died(). Messy. I suspect that the same happened with HCE before this patch. Regards, Michal