Subject: Re: PATA disk drive not being configured in 2.0.2
To: None <netbsd-help@netbsd.org>
From: Dieter <netbsd@sopwith.solgatos.com>
List: netbsd-help
Date: 06/02/2005 16:13:41
> Could you try using the cmdide driver instead of pciide ?

Added:
	cmdide* at pci? dev ? function ? flags 0x0000

Result:

cmdide0 at pci0 dev 11 function 0
cmdide0: CMD Technology PCI0646 (rev. 0x01)
cmdide0: bus-master DMA support present
cmdide0: primary channel wired to compatibility mode
cmdide0: primary channel interrupting at isa irq 14
atabus2 at cmdide0 channel 0
cmdide0: secondary channel wired to compatibility mode
cmdide0: secondary channel interrupting at isa irq 15
atabus3 at cmdide0 channel 1
isa0 at sio0

[ ... ]

satalink0: port 1: device present, speed: 1.5Gb/s
wd0 at atabus1 drive 0scsibus0: waiting 2 seconds for devices to settle...
: <ST3250823AS>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 232 GB, 484521 cyl, 16 head, 63 sec, 512 bytes/sect x 488397168 sectors

unexpected machine check:

    mces    = 0x1
    vector  = 0x670
    param   = 0xfffffc0000006068
    pc      = 0xfffffc00004f4b74
    ra      = 0xfffffc00004e0688
    code    = 0x98
    curlwp = 0xfffffc0000ade870
        pid = 10.1, comm = atabus3

panic: machine check
syncing disks... done
rebooting...

Note that wd0 is a SATA disk on its own SATA controller, not the PATA one
connected to the CMD.

I can talk to the disk by sticking it into a USB-to-PATA external box,
until it hits an unreadable sector which then seems to require
a power cycle.  There are some corrupted sectors as well as unreadable ones.

Haven't been able to get fsck to complete, due to the unreadable sector
problem.  Haven't tried letting it run overnight, maybe it would eventually
time out or exhaust some retry counter?

Are there any diagnostics for the CMD PATA controller?
I'm beginning to wonder if some smoke came out when I wasn't looking.