All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	Dave Hansen <dave.hansen@intel.com>,
	Lu Baolu <baolu.lu@linux.intel.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org,
	Chunfeng Yun <chunfeng.yun@mediatek.com>
Subject: Re: earlyprintk=xdbc seems broken
Date: Mon, 20 Dec 2021 16:51:40 +0100	[thread overview]
Message-ID: <YcCmjP8GCD+2qQH0@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <3281618b-64df-711e-4360-c74e6165d7ed@linux.intel.com>

On Mon, Dec 20, 2021 at 04:34:13PM +0200, Mathias Nyman wrote:
> On 17.12.2021 15.55, Peter Zijlstra wrote:
> > On Fri, Dec 17, 2021 at 01:01:43PM +0200, Mathias Nyman wrote:
> >> I can reproduce this.
> >> Looks like problems started when driver converted to readl_poll_timeout_atomic() in:
> >>
> >> 796eed4b2342 usb: early: convert to readl_poll_timeout_atomic()
> > 
> > I can confirm, reverting that solves the boot hang, things aren't quite
> > working for me though.
> > 
> >> Seems to hang when read_poll_timeout_atomic() calls ktime_* functions.
> >> Maybe  it's too early for ktime.
> > 
> > It certainly is, using ktime for delay loops sounds daft to me anyhow.
> > 
> >> After reverting that patch it works again for me.
> > 
> > [    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.16.0-rc3+ root=UUID=a652986c-fbc6-4341-85c3-b4ad4402f130 ro debug ignore_loglevel sysrq_always_enabled usbcore.autosuspend=-1 earlyprintk=xdbc force_early_printk sched_verbose ftrace=nop mitigations=off nokaslr
> > ...
> > [    0.000000] xhci_dbc:early_xdbc_parse_parameter: dbgp_num: 0
> > ...
> > [    3.161367] xhci_dbc:early_xdbc_setup_hardware: failed to setup the connection to host
> 
> Ok, this is some other issue. I got the boot messages over USB
> (running minicom at the other end, listening to ttyUSB0)

I have a regular A->A USB3 cable, not the special one with a wire
missing. Given the dbc thing works, I feel this ought to work too.

> > The machine does boot.. but I *am* getting tons of:
> > 
> > [  485.546898] usb usb4-port4: Cannot enable. Maybe the USB cable is bad?
> > [  485.546963] usb usb4-port4: config error
> 
> This is expected when xhci driver takes over after the early dbc driver,
> xhci driver resets xHC controller, and all ports turn to normal host ports again.
> 
> Because of the special cable you now have two hosts connected to each other,
> both trying to enumerate a device.
> 
> This whole transition from earlyprintk xdbc to normal xhci driver is 
> not very userfriendly.

Uhhmm... but but that shouldn't be. What if I want to keep using xdbc as
console after that point? specifically, I'll probably end up having:

 earlyprintk=xdbc,keep

once all this starts working. The whole point of early consoles is that
they're more reliable than regular consoles, not that they're 'early'.

> > However, when I do:
> > 
> > $ echo enable > /sys/bus/pci/devices/0000:00:14.0/dbc
> > 
> 
> Yes, this works as it turns on the DbC feature on in xHC hardware,
> which turns the first USB port into a usb device.

But if this works, why isn't earlyprintk working for me?

  reply	other threads:[~2021-12-20 15:51 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02 15:22 earlyprintk=xdbc seems broken Peter Zijlstra
2021-12-03  0:52 ` Lu Baolu
2021-12-03 14:31   ` Mathias Nyman
2021-12-03 15:22     ` Dave Hansen
2021-12-03 15:29       ` Greg KH
2021-12-17 11:01         ` Mathias Nyman
2021-12-17 13:55           ` Peter Zijlstra
2021-12-17 15:19             ` Greg KH
2021-12-20 14:40               ` Peter Zijlstra
2021-12-20 15:06                 ` Greg KH
2021-12-20 17:01                   ` Peter Zijlstra
2021-12-20 14:34             ` Mathias Nyman
2021-12-20 15:51               ` Peter Zijlstra [this message]
2021-12-21  9:40             ` Peter Zijlstra
2021-12-21  9:41               ` Peter Zijlstra
2022-01-14  8:47               ` Peter Zijlstra
2022-01-14 19:31                 ` Mathias Nyman
2022-01-15 16:06                   ` Peter Zijlstra
2022-01-24 14:55                     ` Mathias Nyman
2022-01-24 16:39                       ` Peter Zijlstra
2022-01-24 16:46                         ` Peter Zijlstra
2022-01-25  8:51                           ` Mathias Nyman
2022-01-25 10:47                             ` Peter Zijlstra
2022-01-25 10:54                               ` Peter Zijlstra
2022-01-25 12:45                       ` Peter Zijlstra
2022-01-25 13:09                         ` Sven Schnelle
2022-01-25 13:54                           ` Peter Zijlstra
2022-01-25 14:01                             ` Sven Schnelle
2022-01-25 17:13                               ` Mathias Nyman
2022-01-25 16:24                           ` Dave Hansen
2022-02-17  3:44                             ` Randy Dunlap
2022-01-25 19:39                         ` Rajaram R

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=YcCmjP8GCD+2qQH0@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=baolu.lu@linux.intel.com \
    --cc=chunfeng.yun@mediatek.com \
    --cc=dave.hansen@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=x86@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.