[LinuxBIOS] filo ide speedup patch?

Peter Stuge stuge-linuxbios at cdy.org
Mon Mar 19 02:10:25 CET 2007


On Sun, Mar 18, 2007 at 06:25:30PM +0100, Stefan Reinauer wrote:
> * Peter Stuge <stuge-linuxbios at cdy.org> [070317 04:43]:
> > > I'm looking at FILO right now.
> > 
> > I've hacked FILO to read up to 256 blocks per ATA command now, but am
> > repeatedly getting some bad data here and there already in the first
> > 10kb at kern_addr.
>  
> Can all devices read 256 blocks at once?

It's the exact same command as reading a single sector.


> Does the problem happen with 16 blocks, too?

Because of the fs, not all sectors are consecutive.

In my case it's first 7 sectors then 90. I compare 10kb, the first 10
fs (20 device) sectors and there are differences already in the first
sector, even though the read code path is the same except for the
sector_count parameter in pio_data_in(). :\


> > The two hexdumps don't change after reset.
> 
> You mean, the error is always at the same position? 

Right. I only tried a few resets, will try more.


> > There's a note in ide.c:pio_data_in() :
> >         /* FIXME handle commands with multiple blocks */
> > 
> > ..but looking at the ATA PDF the code looks OK as it is, plus I'm
> > getting bad data already in the first sector. Dunno.
>  
> Do you ever get a timeout? Is the ndelay too short for multiple
> blocks?

No timeouts or errors seen.


> try udelay(1) instead. The openbios ide driver reads IDEREG_ASTATUS
> 4 times before delaying. Also, it waits 1000 times for the drive to
> become ready, while the FILO driver only seems to try 1 time?

I'm using CF so it should be ready immediately.


> maybe it makes sense to port the openbios ide driver (ie clean out
> the device tree hooks)? 
> 
> It knows how to do multiple blocks and it knows hot to do ATAPI
> correctly. And cleaning this up might make it easily usable for
> GRUB2 as well..? 

Sounds good. Is the code structure a lot different?


> > --- single_sector_read_kernel	2007-03-17 03:41:21.000000000 +0100
> > +++ multi_sector_read_kernel	2007-03-17 03:40:01.000000000 +0100
> > @@ -3,27 +3,27 @@
> >  00100020   32 00 00 00 02 00 00 00 45 4c 46 42 6f 6f 74 00  2.......ELFBoot.
> >  00100030   30 2e 35 20 28 73 74 75 67 65 40 63 61 72 65 70  0.5 (stuge at carep
> >  00100040   61 64 34 29 20 53 61 74 20 4d 61 72 20 31 37 20  ad4) Sat Mar 17 
> > -00100050   30 33 3a 34 30 3a 30 38 20 43 45 54 20 32 30 30  03:40:08 CET 200
> > +00100050   30 33 3a 33 38 3a 34 38 20 43 45 54 20 32 30 30  03:38:48 CET 200
> 
> It's hard to day what is wrong and what is not, as it seems to load
> two different versions of filo. Can you try loading the same
> version of filo?

No, one version does what svn trunk does; read one sector at a time,
the other tries to read multiple sectors.

I've restructured the code a bit and added some new multi-sector
functions since single sector reads were assumed everywhere.

I realize it's difficult to suggest anything at this point.


//Peter




More information about the coreboot mailing list