Subject: Re: CF/IDE performance problem...
To: Matthew Orgass <darkstar@city-net.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 11/21/2005 22:38:28
On Mon, Nov 21, 2005 at 01:25:30AM -0500, Matthew Orgass wrote:
> > It not, then that's probably the cause of the problem: it doesn't report
> > its capabilities, and the driver assumes it's too old to do anything else
> > but PIO mode 0. You should be able to workaround this by forcing the
> > modes in the kernel config using flags (see wd(4) for details on the
> > flags).
> 
>   When I try to add PIO flags, I get "piomode error (4)", even with flags
> 0x0008 (I've updated my source to 2.1 now).  The microdrive works with
> that kernel, as does another CF card that reports support for PIO mode 4.
> Another card that does not report capabilities also fails the same as the
> rosewill.
> 
>  The second half of the rosewill drive paramters structure is zero.  The
> first half is: (b = bytes, w = word, not swapped)
> 
> b000/w000: 8a 84  e1 03   00 00  10 00
> b008/w004: 00 00  00 02   3f 00  0f 00
> b016/w008: f0 45  00 00   30 58  30 32
> b024/w012: 20 37  30 32   35 30  30 31
> b032/w016: 31 31  38 31   35 31  34 35
> b040/w020: 02 00  02 00   04 00  65 52
> b048/w024: 20 76  2e 33   30 30  69 48
> b056/w028: 61 74  68 63   20 69  58 58
> b064/w032: 32 4d  33 2e   30 2e  20 20
> b072/w036: 20 20  20 20   20 20  20 20
> b080/w040: 20 20  20 20   20 20  20 20
> b088/w044: 20 20  20 20   20 20  01 00
> b096/w048: 00 00  00 02   00 00  00 01
> b104/w052: 00 00  01 00   e1 03  10 00
> b112/w056: 3f 00  f0 45   0f 00  01 01
> b120/w060: f0 45  0f 00   00 00  00 00
> 
>   0x848a in word 0 or bit 2 of word 83 apparently identifies the CFA
> feature set (according to a draft ATA/ATAPI spec).  I guess this could at
> least be used to print a warning message if capabilites are not reported.

Old drives won't report anything here either, so it's not an error.

> The draft also mentions that PIO mode 1 and 2 can be identified in word
> 51, and this drive seems to indicate PIO mode 2 there.  However, I tried a
> SET FEATURES with pio mode 2, which failed, and with 0 (default mode),
> which also failed.

So it's doesn't support SET FEATURES at all. It's really not standard.

> 
>   In windows ME I wall clocked a large file (190MB) copy to the drive at
> about 1.8MB/s with the IDE adaptor, vs. NetBSD dd (bs=60k) .818MB on the
> IDE adaptor and .559MB on the PCMCIA adaptor (the PCMCIA controller
> doesn't work in ME, so I don't know if that would go any faster).  I tried
> altering the PIO mode without setting DRIVE_MODE (with the IDE adaptor)
> and this worked, getting a transfer rate of about 1MB/s (I unmounted,
> remounted, and compared and the file was good).

It would be possible to define a flag to do this in the driver. But
it should not be the default behavior, as it's really not safe to do so with
all devices.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--