From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 1BF5D37B015 for ; Sat, 2 May 2026 21:55:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777758925; cv=none; b=Pz7JbNfuWGKJjxHf9uKHN/BC6vwRsRnlaGki+7HF4meqJrBnqqPamOZNVRKw5Y5ZhBQLJvB0PHlPTVHbbsF1ExAJZZ1qWXYZGcrQhak8h0W2QBmf6DFVjqx/1loKsOakg1vwTOXRQ9XupKGQuWcB+J7mKKD/xz98r/oGqaV88D8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777758925; c=relaxed/simple; bh=yrsqX7PWvFqc7WXIAaXKeO3CvketME8kxLMBs4Qgdsw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AjHd2KPuDpDNKGi41366wl3McBr3Btzj4PWQy7jBM3vflaPyBREomwqKmlXWPVsPShEGmBl16WulPp0ln6Ug8GLZ8Pbx6MKjPbWqEOUA7LrDAcoVJW3ZpO7AWZpy7aHD5jfJXvY8jEHsSnnWKb5nnHOEX+JGSUt54t4DSXAnb1g= 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=NOVGlMyC; arc=none smtp.client-ip=209.85.128.47 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="NOVGlMyC" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-48909558b3aso30469425e9.0 for ; Sat, 02 May 2026 14:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777758922; x=1778363722; 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=pw2jZRLYzOlZ7sxfl/+h5eD7AhFBQmZQktoNUjcMaC8=; b=NOVGlMyCFyx+Ljn45IbOkjBYJjJHbJJjIma58szJsFWHJ6IEQc8YSHre5SirTWj7R6 lviv9/zj4p3MwtGoMbCFyTHnnmAnLpetaF+zx/r5dOVMLv9V4Ofco9pZrR+wZUid0G0C e1LqHPJcDOQJDE85cjkfrI0ek596WRhRHu+Ms6RphqwvcrQaNhQSCjGu3g4hN/d/nsFw 9sGs5XUEJON1HZp21+NMMxz/cSaxNmMGshmzQ6znrXiHCKXg36ewI/OZO3EDRDJoaAJB GwiqL0XjZ0iGIx+tg4ycOBGU2ud/0v7nT3XDf3tNVpvFWct/Y7CcPlG3Je8jwX93CfOO idhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777758922; x=1778363722; 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=pw2jZRLYzOlZ7sxfl/+h5eD7AhFBQmZQktoNUjcMaC8=; b=DVkMFYy1aNsWMDVjk14Vb47S+NBO3AjGuy25vgl1ODua1K8QO/KQcdJ8WUtNaxZzvZ NIcrt7GhcP/3VWzjTjZNHSZkGB3f1+CDVxXBucFeKCe+HcwE4Q72m6mEVCgTYsegtDeH d9jw0m/JlWgj8gaZsbDfFiET2RpwZ36mSdHdO2rLEEreInCjhxWKH5RxMmDet/SkKaAf JJ9RuZFLzUtwn0Xkf3MEZQF1UPEzuLRe18RCmUiBq73Wa70yXStHeMvBoZZNUpPJCMAT pxpe8ItMT1FKG6W68ibdIJ3vLo1rIdP/fOm++GF+yNbO2uowwmVI8Uby6PaA9YpPzgzD jGSw== X-Gm-Message-State: AOJu0YzvpgL2HtZI0v43k5gynXZasa8JKb93CA7nUl98IMm2Dnpbqmzw FpPmVwhsyL5reElDRHWKG1itvao1mdyspRXkTE8ICuCaTwNBmnB44eVR X-Gm-Gg: AeBDieu1V/tyL+SyUY2oNx1O926ei0lcZ05xB9qFIjywn0uNsH8QYX13wJXZ5T92gyg QVI2uTemMlBlHzrOwM0Qa9D+hOLhG72cvruxhzdk4VSCgn2G5WVZ5uJYRSRbCr2pbT6F1Ud7mFr 8ZwoVrbY6VuHL2nmiSpjKuaog4ErFGtblpycL2uEPsEs6f2OQiDJEop/wykT2PtSEW3PMq6uolQ wGtArTWegVY74Gmxa6uSUWssrrb1QQYLT2zJgRo8rw8PGdsLbow0+B0B7x2OB+Hu+/Ol3L+fPQJ XQ7rBxsJhbJFRvr3AvbrrxUkWwAzDYmK0TV8io+Xq490rKzCkZyOO106MRC5SliFXjiLgSM5uJa fMwmFayV57k3ngrSWyWk5WqnKMwXH+sk7hsEsU+ucb2BC0kw3itMxD++ih+elam0XBoexvA4cKH lRyizluPA8HrvLBLZC+bASTK87QsF5/NueqyvW9cSfeY0lPw== X-Received: by 2002:a05:600c:c101:b0:488:8c89:cfaa with SMTP id 5b1f17b1804b1-48a9852f492mr46167455e9.3.1777758922338; Sat, 02 May 2026 14:55:22 -0700 (PDT) Received: from foxbook (bgt227.neoplus.adsl.tpnet.pl. [83.28.83.227]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48a82301ad1sm344248525e9.9.2026.05.02.14.55.21 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 02 May 2026 14:55:22 -0700 (PDT) Date: Sat, 2 May 2026 23:55:17 +0200 From: Michal Pecio To: Desnes Nunes Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, gregkh@linuxfoundation.org, mathias.nyman@intel.com, stable@vger.kernel.org Subject: Re: [PATCH RFT RFC] usb: xhci: Kill hosts with HCE or HSE on command timeout Message-ID: <20260502235517.089ba5bf.michal.pecio@gmail.com> In-Reply-To: References: <20260430014817.2006885-1-desnesn@redhat.com> <20260430104850.352bd946.michal.pecio@gmail.com> <20260430235453.2288c973.michal.pecio@gmail.com> <20260502114644.76e6b5a3.michal.pecio@gmail.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 Sat, 2 May 2026 08:38:34 -0300, Desnes Nunes wrote: > > diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c > > index e5823650850a..3041deb67b57 100644 > > --- a/drivers/usb/host/xhci-ring.c > > +++ b/drivers/usb/host/xhci-ring.c > > @@ -1761,13 +1761,15 @@ void xhci_handle_command_timeout(struct work_struct *work) > > /* mark this command to be cancelled */ > > xhci->current_cmd->status = COMP_COMMAND_ABORTED; > > > > - /* Make sure command ring is running before aborting it */ > > + /* check for crashed or disconnected chip */ > > hw_ring_state = xhci_read_64(xhci, &xhci->op_regs->cmd_ring); > > - if (hw_ring_state == ~(u64)0) { > > + if (hw_ring_state == ~(u64)0 || usbsts & (STS_FATAL | STS_HCE)) { > > + xhci_info(xhci, "kill the damn thing\n"); > > xhci_hc_died(xhci); > > goto time_out_completed; > > } > > > > + /* Make sure command ring is running before aborting it */ > > if ((xhci->cmd_ring_state & CMD_RING_STATE_RUNNING) && > > (hw_ring_state & CMD_RING_RUNNING)) { > > /* Prevent new doorbell, and start command abort */ > > FYI, sorry to be the bearer of bad news, but this also panics the > system as soon as I run `echo c > /proc/sysrq-trigger`. Is this not what's supposed to happen? Sorry, that complaint is so odd that I thought I'm seeing another case of debugging being outsourced to an AI chatbot, which forgot that panic is triggered intentionally here. Now I'm just confused. > Kdump doesn't run and no vmcore is produced: Is the kdump kernel not launched, or does it crash during boot? The latter would make sense if there is some problem with the code. But I don't understand how patching xhci-hcd could possibly have any effect on the former. Does this new code execute at all? Does "kill the damn thing" ever appear in dmesg? Regards, Michal