Re: VIA, 32bit PIO and 2.5.x kernel

Vojtech Pavlik (vojtech@suse.cz)
Fri, 12 Apr 2002 10:20:21 +0200


On Fri, Apr 12, 2002 at 02:10:29AM +0200, Petr Vandrovec wrote:

> last friday I found strange problem with 2.5.8-pre1 kernel
> corrupting my data. Today I tracked it down to enabled (by
> default) 32bit I/O. Problem occurs only in 2.5.x kernels
> (2.5.8-pre1, 2.5.8-pre3) and does not occur in 2.4.x
> (2.4.19-pre6, 2.4.18-pre4). My tests were done in
> non-multicount mode:
>
> /dev/hdc:
> multcount = 0 (off)
> I/O support = 1 (32-bit)
> unmaskirq = 1 (on)
> using_dma = 0 (off)
> keepsettings = 0 (off)
> nowerr = 0 (off)
> readonly = 0 (off)
> geometry = 4865/255/63, sectors = 78165360, start = 0
> busstate = 1 (on)
>
> After looking through code up and down I found that first
> sector is written in 32bit mode, while others in 16bit mode,
> and VIA IDE interface does not cope with this correctly. Can
> anybody explain me, what's wrong with patch at the end of this
> message? As there is dozen of places where io_32bit is cleared,
> I believe that there must be some reason for doing that... And
> do not ask me why it worked in 2.4.x, as it cleared io_32bit
> in task_out_intr too.

It's a very unwise thing to disable 32-bit mode on VIA and AMD chipsets,
AMD even has it in their errata (VIA has no documented errata, of
course). Thanks for the good find. Martin, can we do anything about
this?

> diff -urN linux-2.5.8-pre3.dist/drivers/ide/ide-taskfile.c linux-2.5.8-pre3/drivers/ide/ide-taskfile.c
> --- linux-2.5.8-pre3.dist/drivers/ide/ide-taskfile.c Sun Apr 7 03:43:03 2002
> +++ linux-2.5.8-pre3/drivers/ide/ide-taskfile.c Fri Apr 12 01:50:04 2002
> @@ -602,7 +602,7 @@
> rq = HWGROUP(drive)->rq;
> pBuf = ide_map_rq(rq, &flags);
> DTF("write: %p, rq->current_nr_sectors: %d\n", pBuf, (int) rq->current_nr_sectors);
> - drive->io_32bit = 0;
> +// drive->io_32bit = 0;
> taskfile_output_data(drive, pBuf, SECTOR_WORDS);
> ide_unmap_rq(rq, pBuf, &flags);
> drive->io_32bit = io_32bit;

-- 
Vojtech Pavlik
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/