Subject: Re: fixes for wdc_obio.c
To: Manuel Bouyer <bouyer@antioche.lip6.fr>
From: Nathan J. Williams <nathanw@MIT.EDU>
List: port-macppc
Date: 07/28/2001 16:26:11
Manuel Bouyer <bouyer@antioche.lip6.fr> writes:

> Here is an update to the code:
> - I forgot to *1000 in some case for timings calc in the ata-4 case.
>   Result was always 0.
> - options ATA4 is gone, based on code sent to me by Tsubai Masanari

I tried this version on my ibook; it didn't work very well:

wdc0 at obio0 offset 0x1f000 irq 19: DMA transfer
atapibus0 at wdc0 channel 0: 2 targets
cd0 at atapibus0 drive 1: <MATSHITADVD-ROM SR-8176, , MA24> type 5
cdrom removable
cd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33)
wd0 at wdc0 channel 0 drive 0: <IBM-DJSA-220>
wd0: drive supports 16-sector PIO transfers, LBA addressing
wd0: 19077 MB, 16383 cyl, 16 head, 63 sec, 512 bytes/sect x 39070080 sectors
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 4 (Ultra/66)
wd0(wdc0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)
cd0(wdc0:0:1): using PIO mode 4, DMA mode 2, Ultra-DMA mode 2 (Ultra/33) (using DMA data transfers)

...
root on wd0a dumps on wd0b
wdc0:0:0: lost interrupt
        type: ata tc_bcount: 512 tc_skip: 0
wdc0:0:0: intr with DRQ (st=0x58)
wd0: transfer error, downgrading to Ultra-DMA mode 1
wd0(wdc0:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 1 (using DMA data transfers)
cd0(wdc0:0:1): using PIO mode 4, DMA mode 2, Ultra-DMA mode 1 (using DMA data transfers)
wd0c: device timeout reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
wdc0:0:0: lost interrupt
        type: ata tc_bcount: 512 tc_skip: 0
wdc0:0:0: intr with DRQ (st=0x58)
wd0: transfer error, downgrading to DMA mode 2
wd0(wdc0:0:0): using PIO mode 4, DMA mode 2 (using DMA data transfers)
cd0(wdc0:0:1): using PIO mode 4, DMA mode 2, Ultra-DMA mode 1 (using DMA data transfers)
wd0c: device timeout reading fsbn 0 (wd0 bn 0; cn 0 tn 0 sn 0), retrying
wd0: soft error (corrected)
...
wdc0:0:1: lost interrupt
        type: atapi tc_bcount: 32 tc_skip: 0
wdc0:0:1: device timeout, c_bcount=32, c_skip=0
cd0: transfer error, downgrading to DMA mode 2
wd0(wdc0:0:0): using PIO mode 4, DMA mode 2 (using DMA data transfers)
cd0(wdc0:0:1): using PIO mode 4, DMA mode 2 (using DMA data transfers)
cd0(wdc0:0:1): invalid return code from adapter: 3
wdc0:0:0: lost interrupt
        type: ata tc_bcount: 8192 tc_skip: 0
wdc0:0:0: dmamode timed out
wd0g: device timeout writing fsbn 16288 of 16288-16303 (wd0 bn 20653480; cn 20489 tn 9 sn 1), retrying
wd0: transfer error, downgrading to PIO mode 4
wd0(wdc0:0:0): using PIO mode 4
cd0(wdc0:0:1): using PIO mode 4, DMA mode 2 (using DMA data transfers)
wd0g: id not found writing fsbn 16288 of 16288-16303 (wd0 bn 20653480; cn 20489 tn 9 sn 1), retrying
wdc0:0:0: not ready, st=0xa0, err=0x00
wd0g: device timeout writing fsbn 16288 of 16288-16303 (wd0 bn 20653480; cn 20489 tn 9 sn 1), retrying
wdc0:0:0: lost interrupt
        type: ata tc_bcount: 8192 tc_skip: 0
wdc0:0:0: setmulti timed out
wd0g: device timeout writing fsbn 16288 of 16288-16303 (wd0 bn 20653480; cn 20489 tn 9 sn 1), retrying
wdc0:0:0: lost interrupt
        type: ata tc_bcount: 8192 tc_skip: 0
wdc0:0:0: recal timed out
wd0g: device timeout writing fsbn 16288 of 16288-16303 (wd0 bn 20653480; cn 20489 tn 9 sn 1), retrying
wdc0:0:0: lost interrupt
        type: ata tc_bcount: 8192 tc_skip: 0
wdc0:0:0: recal timed out
wd0g: device timeout03 (wd0 bn 20653480; cn 20489 tn 9 sn 1)


... and then the machine hung.

        - Nathan