Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Debugging ahcisata?

On Tue, Aug 18, 2009 at 07:32:38PM -0700, Paul Goyette wrote:
> ahcisata0 port 2: sata_reset_interface sstatus = 0x00000123
> ahcisata0 port 2: device present, speed: 3.0Gb/s
> ahcisata0: BSY took 0 ms
> ahcisata0: port 2: sig=0x101 CMD=0x10040017

so the device is properly conected now 

> wd2 at atabus9 drive 0ahci_exec_command port 2 CI 0x0
> ahci_cmd_start CI 0x0
> ahcisata0 port 2 tbl 0xffff800055fc1000
> ahcisata0 port 2 header 0xffff800055ba3800

we issued the command

> ahcisata0 ahci_intr 0x4

got an interrupt back, for port 2

> ahci_intr_port ahcisata0 port 2 is 0x20 CI 0x0

This is a "descriptor processed" interrupt

> ahci_intr_port port 2 is 0x0 act 0x1 CI 0x0

bit 0 of CI is 0, descriptor has been processed

> ahci_cmd_complete channel 2 CMD 0x10040017 CI 0x0

All expected bits are set in CMD

> ahci_cmd_done channel 2

I guess that if the upper level code thinks we didn't read anything,
it's because ahci_cmd_done didn't set AT_XFDONE. This would be because
the controller didn't write back the transfer count in cmdh_prdbc.
Can you see if adding a delay() at the beggining of ahci_intr_port()
changes anyything (i.e changes regiters values above, and makes the drive

Manuel Bouyer <>
     NetBSD: 26 ans d'experience feront toujours la difference

Home | Main Index | Thread Index | Old Index