Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Feb 2007 13:44:04 +0100
From:      Adriaan de Groot <groot@kde.org>
To:        freebsd-hardware@freebsd.org, freebsd-drivers@freebsd.org
Subject:   SiI3124 / ATA hw.end_transaction
Message-ID:  <200702191344.04383.groot@kde.org>

next in thread | raw e-mail | index | archive | help
At the beginning of February I posted [1] that I had a SiI3124 (SATA-II, RAID, 
PCI-X) card (works in PCI slot, too) for testing and that worst-case I would 
write the driver myself. Since there was no response, I wrote the driver 
myself.

Mostly, anyway. I've written it to be part of the ata driver (long term this 
does not seem like a good idea, what with PMs pushing the number of devices 
per SATA channel > 1; having one CAM bus would be doable, I think, since 4 
ports * hypothetical 15-port-multiplier is as far as this chipset can go) and 
so far it handles interrupts and ATA IDENTIFY returns the correct 
information. So I end up with (paraphrase, the machine I have the hardware in 
isn't connected today):

atapci1: SiI 3124
ata6: <channel 0 on atapci1>
..
ata9: <channel 3 on atapci1>
ad12: TOSHIBA ... on ata6-master

Anyway, I'm having real trouble figuring out how the hw.begin_transaction, 
hw.end_transaction and hw.status methods interact in struct ata_lowlevel. 
Commands are issued (like ATA INDENTIFY) and go through begin_transaction. I 
post the command to the device. On next interrupt for the channel (meaning 
the command is completed) .. something. This is where I don't understand what 
is happening or what is supposed to happen. status returns 0 or 1; in 
ata-chipset.c these are typically documented as "have seen any device 
action", but I don't know entirely what this is supposed to check. Given the 
context I may be able to just return 1, but ata_pci_status() returns 0 if the 
channel is busy (by the taskfile registers).

And then there's the end_transaction stuff; this should, presumably, set 
request->result and request->error and request->status. Here, I'm in the dark 
as to what values mean what. I've tried just retrieving them from the 
taskfile (on the assumption that the 3124 updates the FIS after command 
completion) but all I get for my trouble are request timeouts for SETMODE, 
ENABLE_WCACHE, ... and the occasional READ_LBA. Booting this way takes a long 
time, but eventually the ATA system gives up on the disk and boot continues 
normally -- woe betide if I try dd if=/dev/ad12 though :)

So my question is particularly: what are status and end_transaction expected 
to do? Is there documentation anywhere? dev/ata/* seems very light on 
how-it-works and design docs -- although the code is clean and usually 
explains what it is doing, so I've been able to get this far.


[1] 
http://lists.freebsd.org/pipermail/freebsd-hardware/2007-February/004184.html


-- 
Adriaan de Groot
  KDE Quality Team   http://www.englishbreakfastnetwork.org/
  SQO-OSS Researcher http://www.sqo-oss.eu/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200702191344.04383.groot>