All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Pecio <michal.pecio@gmail.com>
To: Desnes Nunes <desnesn@redhat.com>
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
Date: Sat, 23 May 2026 10:28:15 +0200	[thread overview]
Message-ID: <20260523102815.5c05c70a.michal.pecio@gmail.com> (raw)
In-Reply-To: <CACaw+exPdwXVsJc5Xr=vN1WJt8XR46=X0-8PP=+5dWY5zUrKeQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1624 bytes --]

On Sat, 23 May 2026 00:47:28 -0300, Desnes Nunes wrote:
> Hello Michal,
> 
> On Fri, May 22, 2026 at 9:29 PM Michal Pecio <michal.pecio@gmail.com> wrote:
> > Sorry, I forgot about the most important thing: crash kernel log,
> > or at least the IOMMU fault message showing the bad address.  
>
> I was indeed intrigued and almost sent it without you asking for it :-)
> 
> The crashkernel's fault address is shown latter on down below, but now
> I have attached the full kexec dmesg too.
> 
> PS: Note that the debugfs file 'memory' from before contains the
> addresses of the main kernel, not crashkernel's addresses:
>     - From main dmesg:
> [    6.728105] xhci_hcd 0000:80:14.0: Device context base array
> address = 0x000000010a958000 (DMA), 00000000f542e3ba (virt)
> [    6.737602] xhci_hcd 0000:80:14.0: ERST deq = 64'h10a95a000

Neither debugfs dump corresponds to this dmesg, addresses don't match.
And it doesn't look like the guard pages patch is working here. 

But maybe it doesn't matter. Your "memory" files show a clear pattern
of consecutive page-sized allocations (example from after.zip):

102fb6000 DCBAA
102fb7000 CR
102fb8000 ER segmnet 0
102fb9000 ER segment 1
102fba000 ERST 

We can make a guess that the faulting address is the ERST, which
definitely should be accessible to the host controller.

This simple patch logs ERST allocation and freeing; as far as I see
nothing else touches that mapping.

If the ERST is somehow freed before starting the HC, that's a bug.
Otherwise, it seems you were right that you have some IOMMU problem.

Regards,
Michal

[-- Attachment #2: xhci-erst-alloc.patch --]
[-- Type: text/x-patch, Size: 755 bytes --]

diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index e76e321e119f..3f1e25bcb7ee 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1815,6 +1815,7 @@ static int xhci_alloc_erst(struct xhci_hcd *xhci,
 					   size, &erst->erst_dma_addr, flags);
 	if (!erst->entries)
 		return -ENOMEM;
+	xhci_info(xhci, "alloc ERST at %pad\n", &erst->erst_dma_addr);
 
 	erst->num_entries = evt_ring->num_segs;
 
@@ -1867,6 +1868,7 @@ xhci_free_interrupter(struct xhci_hcd *xhci, struct xhci_interrupter *ir)
 				  ir->erst.entries,
 				  ir->erst.erst_dma_addr);
 	ir->erst.entries = NULL;
+	xhci_info(xhci, "free ERST at %pad\n", &ir->erst.erst_dma_addr);
 
 	/* free interrupter event ring */
 	if (ir->event_ring)

  reply	other threads:[~2026-05-23  8:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30  1:48 [PATCH] usb: xhci: bound wait command completion to avoid kdump deadlock Desnes Nunes
2026-04-30  8:48 ` Michal Pecio
2026-04-30 17:27   ` Desnes Nunes
2026-04-30 21:54     ` Michal Pecio
2026-05-01 14:09       ` Desnes Nunes
2026-05-02  9:46         ` [PATCH RFT RFC] usb: xhci: Kill hosts with HCE or HSE on command timeout Michal Pecio
2026-05-02 11:38           ` Desnes Nunes
2026-05-02 21:55             ` Michal Pecio
2026-05-03  3:36               ` Desnes Nunes
2026-05-03  5:17                 ` Michal Pecio
2026-05-03 16:20                   ` Desnes Nunes
2026-05-03 19:31                     ` Michal Pecio
2026-05-04  7:31                       ` Michal Pecio
2026-05-18  6:33                         ` Michal Pecio
2026-05-20  4:59                           ` Desnes Nunes
2026-05-22  9:03                             ` Michal Pecio
2026-05-22 20:45                               ` Desnes Nunes
2026-05-23  0:29                                 ` Michal Pecio
2026-05-23  3:47                                   ` Desnes Nunes
2026-05-23  8:28                                     ` Michal Pecio [this message]
2026-05-27  3:47                                       ` Desnes Nunes
2026-05-27  8:32                                         ` Michal Pecio
2026-06-10 15:32                                           ` Desnes Nunes
2026-06-18  0:57                                             ` Desnes Nunes
2026-06-18  4:46                                               ` Intel IOMMU bug: xHCI faults during crash kernel boot Michal Pecio

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260523102815.5c05c70a.michal.pecio@gmail.com \
    --to=michal.pecio@gmail.com \
    --cc=desnesn@redhat.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.