From: ebiederm@xmission.com (Eric W. Biederman)
To: Andi Kleen <ak@suse.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
linux-kernel@vger.kernel.org,
virtualization <virtualization@lists.linux-foundation.org>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 09/12] i386/x86_64: EHCI usb debug port early printk support.
Date: Mon, 30 Apr 2007 14:54:18 -0600 [thread overview]
Message-ID: <m1fy6h37np.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <20070430175607.GD25929@bingen.suse.de> (Andi Kleen's message of "Mon, 30 Apr 2007 19:56:08 +0200")
Andi Kleen <ak@suse.de> writes:
> Thanks for writing that code. It should be an interesting alternative
> on boxes where firescope doesn't work.
>
> I hope I can eventually merge early firewire support code too.
>
> On Mon, Apr 30, 2007 at 10:32:02AM -0600, Eric W. Biederman wrote:
>>
>> With legacy free systems serial ports have stopped being an option
>> to get early boot traces and other debug information out of a machine.
>
> This needs a CONFIG_* at least. And some documentation on how to set it
> up on both sides.
Besides CONFIG_EARLY_PRINTK I assume. It is enough code so there is a
case for it.
>> This debug device can be used to replace serial ports for
>> kgdb, kdb, and console support. And gregkh has a simple usb
>> serial driver for it so user space applications that control
>> serial ports should work unmodified.
>
> But not merged yet, right? I was hoping it could be done from
> user space anyways.
Sorry old comment, that piece has been merged for a while.
It is the usb_debug module. It creates a tty device that you
can just cat to get the usb debug output.
>> For users the hard part looks like it will be finding cables and
>> finding which is usb debug port 1 and realizing that there is
>> flow control so the kernel boot will not happen if someone is not
>> reading the serial console data.
>
> That's nasty. Any way to work around that?
Maybe. It has been long enough since I wrote the code
I need to go back and look.
>> index 92213d2..dc097aa 100644
>> --- a/arch/x86_64/kernel/early_printk.c
>> +++ b/arch/x86_64/kernel/early_printk.c
>> @@ -3,9 +3,19 @@
>> #include <linux/init.h>
>> #include <linux/string.h>
>> #include <linux/screen_info.h>
>> +#include <linux/usb/ch9.h>
>> +#include <linux/pci_regs.h>
>> +#include <linux/pci_ids.h>
>> +#include <linux/errno.h>
>
> Can you put it in a separate file please?
> Perhaps with a little abstraction in drivers/usb ?
>
>> +static void dbgp_breath(void)
>> +{
>> + /* Sleep to give the debug port a chance to breathe */
>
> But you don't?
Good point. At least this early I'm not certain there is any
way I can productively do that. This is before we have calibrated
the tsc's and the like so timeouts are difficult, and as I
recall our default guess isn't.
This lack of a good timeout looks to be the reason ehci_wait_for_port
doesn't timeout in a timely fashion because I don't timeout until
I have wrapped a 32bit number.
>> +static __u32 __init find_dbgp(int ehci_num, unsigned *rbus, unsigned *rslot,
> unsigned *rfunc)
>
> This should be probably merged into the early quirks loop
>
>> early_console = &simnow_console;
>> keep_early = 1;
>> + } else if (!strncmp(buf, "dbgp", 4)) {
>
> usb would seem to be more intuitive
Could be. I was thinking usb debug port. dbgp is at least unique,
and unfortunately it doesn't look like any old usb cable will
do, so a straight usb I expect would be very misleading.
The truth is I don't have a big need for this. I put it together as
a proof of concept to see how hard it would be, etc. I can clean
it up a little but I'm really hoping I can get this into one of
the development trees and people who have more use for it then I
do can play with it and improve things.
One persons experience on two machines probably isn't quite enough
of a sample to Document how to use this. At least beyond what I
did in my changelog.
Eric
next prev parent reply other threads:[~2007-04-30 20:54 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <m1d51l6f1y.fsf@ebiederm.dsl.xmission.com>
2007-04-30 15:48 ` [PATCH 01/12] x86_64: Allow fixmaps to be used with the initial page table Eric W. Biederman
[not found] ` <m18xc96eyq.fsf@ebiederm.dsl.xmission.com>
2007-04-30 15:49 ` [PATCH 02/12] i386 head.S: Remove unnecessary use of %ebx as the boot cpu flag Eric W. Biederman
[not found] ` <m14pmx6ewk.fsf_-_@ebiederm.dsl.xmission.com>
2007-04-30 15:51 ` [PATCH 03/12] i386 head.S: Always run the full set of paging state Eric W. Biederman
[not found] ` <m1zm4p509a.fsf_-_@ebiederm.dsl.xmission.com>
2007-04-30 15:57 ` [PATCH 04/12] i386 voyager: Use modern techniques to setup and teardown low identiy mappings Eric W. Biederman
2007-04-30 16:03 ` [PATCH 05/12] i386: During page table initialization always set the leaf page table entries Eric W. Biederman
[not found] ` <m1r6q14zow.fsf_-_@ebiederm.dsl.xmission.com>
2007-04-30 16:09 ` [PATCH 06/12] i386: Minimum cpu detection cleanups Eric W. Biederman
2007-04-30 16:10 ` [PATCH 07/12] i386: Add missing !X86_PAE dependincy to the 2G/2G split Eric W. Biederman
2007-04-30 16:15 ` [PATCH 08/12] i386: Convert the boot time page tables to the kernels native format Eric W. Biederman
2007-04-30 16:26 ` Andi Kleen
2007-04-30 16:32 ` [PATCH 09/12] i386/x86_64: EHCI usb debug port early printk support Eric W. Biederman
2007-04-30 16:32 ` [PATCH 10/12] i386: Introduce head32.c Eric W. Biederman
2007-04-30 16:33 ` [PATCH 11/12] i386: Move setup_idt from head.S to head32.c Eric W. Biederman
2007-04-30 16:35 ` [PATCH 12/12] i386: remove cpuid checking in head.S Eric W. Biederman
2007-04-30 17:56 ` [PATCH 09/12] i386/x86_64: EHCI usb debug port early printk support Andi Kleen
[not found] ` <20070430175607.GD25929@bingen.suse.de>
2007-04-30 20:54 ` Eric W. Biederman [this message]
[not found] ` <200704301826.57920.ak@suse.de>
2007-04-30 16:42 ` [PATCH 08/12] i386: Convert the boot time page tables to the kernels native format Eric W. Biederman
2007-04-30 16:16 ` [PATCH 07/12] i386: Add missing !X86_PAE dependincy to the 2G/2G split H. Peter Anvin
2007-04-30 16:39 ` Eric W. Biederman
2007-04-30 16:13 ` [PATCH 06/12] i386: Minimum cpu detection cleanups H. Peter Anvin
2007-04-30 16:34 ` [PATCH 05/12] i386: During page table initialization always set the leaf page table entries Jeremy Fitzhardinge
2007-04-30 17:06 ` [PATCH 04/12] i386 voyager: Use modern techniques to setup and teardown low identiy mappings James Bottomley
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=m1fy6h37np.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=ak@suse.de \
--cc=akpm@linux-foundation.org \
--cc=gregkh@suse.de \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).