Linux USB
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Milan Oravec <migo.oravec@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>, linux-usb@vger.kernel.org
Subject: Re: Fwd: USB DBC hang during earlyprintk initialization
Date: Wed, 17 Dec 2025 11:20:01 +0200	[thread overview]
Message-ID: <05f48b2f-6f84-49b6-ab5b-44b5c488cc7e@linux.intel.com> (raw)
In-Reply-To: <CAAcb1K-dcYC5cViGQdJZpr5FvgaOYVzisyQYQWCB1WTZaJP_bw@mail.gmail.com>

Hi

On 12/5/25 20:49, Milan Oravec wrote:
> Hello Mathias, I've replaced cat with minicom in the script above and
> let minicom capture the file. First minicom displayed no messages,
> then I realised I need to press and hold enter to be able see messages
> sent from debug target.

You shouldn't need to do that, something is set up oddly.

> 
> Computer hangs and needs a long press of the power button to recover.
> Boot cmd used:
> linux /vmlinuz root=UUID=584262b6-b020-4e4f-95a3-1db754e28b6c
> earlyprintk=keep,xdbc2 debug ignore_loglevel sysrq_always_enabled
> force_early_printk sched_verbose usbcore.autosuspend=-1
> no_console_suspend resume=UUID=54ed98b5-56c0-4ab9-95ea-da1a9322ce49
> 
> I've attached a captured log from deminicom.
> 
> What should I try next?

early_xdbc_write() is called every time a new entry is written to console.
It only uses one transfer buffer, (one TRB).
early_xdbc_write() will block for up to 2 seconds in a udelay loop waiting
for the previous transfer to complete.

blocking for 2 seconds on every console message doesn't sound reasonable.
Maybe for the first message to make sure other side is set up and reading the data.

I'm also not sure the "keep" flag works.
Once the actual xhci driver binds to the device it will reset the controller , losing
DBC capability and console.

You could try without the keep flag, and setting timeout to 100ms instead of 2 seconds

diff --git a/drivers/usb/early/xhci-dbc.c b/drivers/usb/early/xhci-dbc.c
index 41118bba9197..515a172ba25b 100644
--- a/drivers/usb/early/xhci-dbc.c
+++ b/drivers/usb/early/xhci-dbc.c
@@ -855,7 +855,7 @@ static int xdbc_bulk_write(const char *bytes, int size)
  	xdbc_handle_events();
  
  	/* Check completion of the previous request: */
-	if ((xdbc.flags & XDBC_FLAGS_OUT_PROCESS) && (timeout < 2000000)) {
+	if ((xdbc.flags & XDBC_FLAGS_OUT_PROCESS) && (timeout < 100000)) {
  		raw_spin_unlock_irqrestore(&xdbc.lock, flags);
  		udelay(100);
  		timeout += 100;

Thanks
Mathias


  reply	other threads:[~2025-12-17  9:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAAcb1K_MJKWz+BYJmx0FDgrBOzzXm71-M7sgHDUOmBRppXWNzA@mail.gmail.com>
2025-10-15  7:43 ` Fwd: USB DBC hang during earlyprintk initialization Milan Oravec
2025-10-15  9:13   ` Greg KH
2025-10-15 19:11     ` Milan Oravec
2025-10-16 13:42       ` Mathias Nyman
2025-10-16 14:31         ` Milan Oravec
2025-10-16 20:49           ` Mathias Nyman
2025-10-20  6:43             ` Milan Oravec
2025-10-24 15:36               ` Mathias Nyman
2025-10-24 15:41                 ` [RFT PATCH] usb: early: xhci-dbc: Try smaller early_ioremap size if original size fails Mathias Nyman
2025-10-26  2:32                   ` kernel test robot
2025-10-24 18:48                 ` Fwd: USB DBC hang during earlyprintk initialization Milan Oravec
2025-10-27  9:34                   ` Mathias Nyman
2025-10-28 10:13                     ` Mathias Nyman
2025-10-28 13:29                       ` Milan Oravec
2025-10-28 17:19                         ` Mathias Nyman
2025-10-28 18:10                           ` Milan Oravec
2025-10-31 13:15                             ` Milan Oravec
2025-12-04 20:46                               ` Mathias Nyman
2025-12-05  7:18                                 ` Milan Oravec
2025-12-05 18:49                                   ` Milan Oravec
2025-12-17  9:20                                     ` Mathias Nyman [this message]
2025-12-18 20:03                                       ` Milan Oravec
2026-01-19  8:18                                         ` Milan Oravec
2026-01-19 11:01                                           ` Milan Oravec
2026-04-01 15:58                                             ` Milan Oravec

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=05f48b2f-6f84-49b6-ab5b-44b5c488cc7e@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=migo.oravec@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox