public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Yinghai Lu <yhlu.kernel@gmail.com>,
	mingo@elte.hu, tglx@linutronix.de, hpa@zytor.com,
	andi@firstfloor.org, arjan@infradead.org, ebiederm@xmission.com,
	greg@kroah.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: usb debug port early console
Date: Wed, 23 Jul 2008 19:56:07 -0700	[thread overview]
Message-ID: <m17ibcf0s8.fsf@frodo.ebiederm.org> (raw)
In-Reply-To: <20080723131218.f03ed672.akpm@linux-foundation.org> (Andrew Morton's message of "Wed, 23 Jul 2008 13:12:18 -0700")

Andrew Morton <akpm@linux-foundation.org> writes:

> On Wed, 23 Jul 2008 12:52:20 -0700
> Yinghai Lu <yhlu.kernel@gmail.com> wrote:
>
>> 
>> 
>> based on work from Eric, and add some timeout so don't dead loop when debug
> device
>> is not installed
>> 
>>
>> ...
>>
>> +static void dbgp_mdelay(int ms)
>> +{
>> +	int i;
>> +	while (ms--) {
>> +		for (i = 0; i < 1000; i++)
>> +			outb(0x1, 0x80);
>> +	}
>> +}
>
> hm.  port 80 has a guaranteed one microsecond? 

It usually longer, but it is in the 1 microsecond ballpark, accurate
enough to be a usable delay before we have anything else.

> Why not udelay()/mdelay()/etc?

This code runs ages before udelay and mdelay work.  Certainly before
calibrate delay is called, so the normal kernel delay routines don't
come anywhere close and an out to port 0x80 comes.

>> +static void dbgp_breath(void)
>> +{
>> +	/* Sleep to give the debug port a chance to breathe */
>> +}
>
> I expect the compiler will optimise away any calls to this.

It is documentation that is if it might be a good idea to not hit the
hardware there.

Eric

  parent reply	other threads:[~2008-07-24  3:02 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-23 19:52 [PATCH] x86: usb debug port early console Yinghai Lu
2008-07-23 20:12 ` Andrew Morton
2008-07-23 20:18   ` Yinghai Lu
2008-07-23 20:36     ` Andrew Morton
2008-07-24  2:56   ` Eric W. Biederman [this message]
2008-07-24  3:13     ` H. Peter Anvin
2008-07-23 21:00 ` [PATCH] x86: usb debug port early console v2 Yinghai Lu
2008-07-23 22:45   ` Greg KH
2008-07-23 22:54     ` Yinghai Lu
2008-07-23 23:21       ` Greg KH
2008-07-23 23:46         ` Yinghai Lu
2008-07-24  0:06           ` Greg KH
2008-07-24  0:39   ` [PATCH] x86: usb debug port early console v3 Yinghai Lu
2008-07-24 11:14     ` Ingo Molnar
2008-07-25  0:27     ` [PATCH] usb: move ehci reg def Yinghai Lu
2008-07-25  0:57       ` David Brownell
2008-07-25  2:14         ` Yinghai Lu
2008-07-26 14:18           ` Ingo Molnar
2008-07-28 15:40             ` Greg KH
2008-07-28 16:11               ` Ingo Molnar
2008-07-28 16:47                 ` Greg KH
2008-07-28 18:47                   ` David Brownell
2008-07-25  0:29     ` [PATCH] x86: usb debug port early console v4 Yinghai Lu
2008-07-26 13:48       ` Ingo Molnar
2008-07-26 15:38         ` Ingo Molnar

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=m17ibcf0s8.fsf@frodo.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=arjan@infradead.org \
    --cc=greg@kroah.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=yhlu.kernel@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