Subject: Re: interleaved disk probing output
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 10/10/2003 10:16:06
At 10:04 AM 10/10/2003, Manuel Bouyer wrote:
>On Fri, Oct 10, 2003 at 06:21:08PM +0200, Frank van der Linden wrote:
> > Since both the ATA and SCSI device proving now is done from threads
> > after enabling interrupt, the output gets messed up sometimes.
> >
> > I.e:
> >
> > wd0 at atabus0 drive 0sd1 at scsibus0 target 5 lun 0: <SEAGATE, 
> ST336607LC, 0006
> > > disk fixed
> > : <ST340015A>
> >
> > That needs to be fixed.. should there be a config output lock for these
> > situations?
>
>There are ad-hoc locks in scsipi and ata to handle this, but they don't play
>well from one bus to another (I think the same problem can also occur with USB
>for example).
>I was thinking about adding an ordering facility in the config framework.
>When these busses are probed, they would either be declared as needing
>ordering, or register themselves to the ordering facility, and then
>could call a function that would make them tsleep() wait for their turn before
>calling config_* for childs.

Wouldn't it make more sense to change the aprint stuff to deal with this?
Add a parameter that will store the buffered output until a newline is
reached and then emits it as one large chunk?

aprint_create(&ctx);
aprint_buffered(ctx, ...);
aprint_destroy(ctx);

There is *NO* reason to slow down system startup for pretty printing.

-- 
Matt Thomas                     email: matt@3am-software.com
3am Software Foundry              www: http://3am-software.com/bio/matt/
Cupertino, CA              disclaimer: I avow all knowledge of this message.