Subject: Re: interleaved disk probing output
To: Matt Thomas <matt@3am-software.com>
From: Alex Barclay <alex@planet-barclay.com>
List: tech-kern
Date: 10/10/2003 10:30:45
Matt Thomas wrote:

> 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?

You could store the output from each driver and then as you advance 
through the tree output the data in order. This would not slow down the 
boot as it would only be the output that held.

An example assuming wd came before sd which came before com

t   action                  output
0   probed com0
1   probed wd0            wd0 at .........
2   probed sd0            sd0 at ...........
                          com0 at .........

It would be kind of complex but I'd hate to see the boot messages change 
into the steaming pile that you get with Linux. It would also make 
diagnosing just what the device tree came out to be far more difficult.

Maybe more effort than value though.

Alex.