lkml.org 
[lkml]   [2008]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] x86: usb debug port early console
    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


    \
     
     \ /
      Last update: 2008-07-24 05:05    [W:0.024 / U:30.884 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site