summaryrefslogtreecommitdiff
path: root/sys/dev/ata
AgeCommit message (Collapse)Author
2007-03-27OK, I understand why jsg wanted the disk_unbusy() in wdretry(), and heTheo de Raadt
was right. There is another path that ends up avoiding the disk_unbusy call I inserted.... tested by robert too
2007-03-25wdc retries (including after suspends) caused a disk to remain busy whenTheo de Raadt
it should not; ok dlg problem spotted using zaurus soft-drive-led diff which is pending i think i convinced jsg now that this fix is better than putting it in wdrestart
2007-03-25kill extra space in output with diskerr(); ok jsgTheo de Raadt
2007-03-24Complete the right scsi_xfer when processing a disk sync request.Christopher Pascoe
2007-03-23Track the ATA xfer's state more closely - may help us identify why someChristopher Pascoe
are seeing a panic at halt time.
2007-03-23Really clear the device register on the flush cache command. Last commitChristopher Pascoe
adjusted the packet and identify commands.
2007-03-23Clear the device register on the flush cache command, in case somethingChristopher Pascoe
that shouldn't care about don't care bits does care.
2007-03-23Catch timed out disk commands.Christopher Pascoe
2007-03-22Let atascsi issue NCQ commands if the controller supports it.Christopher Pascoe
This includes a nasty hack to reduce openings and throw away command slots if the device supports a lower queue depth than the host controller does. Yes, we're thinking about a better solution.
2007-03-21A polled xfer has completed and been put by the time ata_cmd returns, soChristopher Pascoe
don't use xa->flags afterwards.
2007-03-21Add support for issuing NCQ commands via AHCI.Christopher Pascoe
Because you cannot have NCQ commands active at the same time as standard (non-queued) commands, we must introduce a queueing scheme into the driver. This scheme ensures that a standard command is only issued to the drive when all currently active NCQ commands have finished, and that NCQ command issue is delayed when we have a pending standard command. Additionally, the queueing scheme adds a constraint to ensure that there are never more than two standard commands issued on a port at once. This should ensure that commands become active in the order they were submitted (regardless of their command slot number) both initially and when the port is reactivated after error recovery. These points mean that issuing a standard command effectively serialises the port, which may help us implement meaningful I/O barriers in the future.
2007-03-21atascsi sends h2d fis's, not d2h.David Gwynne
2007-03-21replace the array of u_int8_ts for the fis/registers with a struct to makeDavid Gwynne
it a bit easier to read. there are variations on this, but they can be defined later.
2007-03-20Be sure to reset ata_xfer flags for all PACKET transfers, otherwise weChristopher Pascoe
could pick up a previous ATA_F_POLL from a previous non-data command.
2007-03-20add missing FLUSH_CACHE commands.David Gwynne
2007-03-20Basic FLUSH CACHE support.Christopher Pascoe
Note that the ATA spec says we're should retry after error until we see no more errors. This is not (yet) implemented.
2007-03-20Tag ATAPI transfers that have no data phase correctly, otherwise the commandChristopher Pascoe
isn't sent to the device.
2007-03-20Oops, remove some unused variables and unmangle a command name.Christopher Pascoe
2007-03-20Cap the device size we present to 2TB, just in case someone attachesChristopher Pascoe
something really big. The SCSI layer isn't yet ready for it.
2007-03-20Move common completion handling into ata_exec itself. Removes a double freeChristopher Pascoe
in the inquiry error paths, as the HBA will have already completed the ata_xfer with an error. Reminder and ok dlg@
2007-03-20Add support for ATA PACKET commands. This should make ATAPI cdrom drives,Christopher Pascoe
etc, just work.
2007-03-20move ata command definitions from atascsi.c to atascsi.hDavid Gwynne
2007-03-20reorder slightly. ata bits before atascsiDavid Gwynne
2007-03-20Add timeout handling for ATA commands.Christopher Pascoe
2007-03-20nothing from wdc, wd, or any of the existing ata stuff pls. this gets ridDavid Gwynne
of the wdcreg.h include in atascsi. "feel free to remove" pascoe@
2007-03-20Request "descriptor processed" interrupts only for PIO requests (inquiry,Christopher Pascoe
etc), and request that the D2H FIS at the completion of all (DMA) commands generate an interrupt. This makes each data transfer generate one interrupt instead of two and should guarantee that the interrupt that is generated actually arrives after the command has completed.
2007-03-20Calculate the residual and copy it back to the scsi_xfer, so that RW actuallyChristopher Pascoe
works. From dlg@
2007-03-20Add support for issuing sector read/write commands.Christopher Pascoe
2007-03-20Instead of having a copy of every register that we will issue in the ata_cmd,Christopher Pascoe
simply include a pointer to the command FIS that we will issue to the device. Include another space where we can copy back an error register set from a failed command. This means that we can now build and issue arbitrary commands from atascsi, and retrieve errors back.
2007-03-20Change API for struct ata_xfer allocation to move it into the device thatChristopher Pascoe
atascsi will be driving, and add it to the AHCI CCB. This effectively gives us all the resources we need for a transfer in one hit, meaning that we don't need to worry about whether we will have a pool shortage or not enough CCBs. The SCSI mid layer should take care to never exceed the number of CCBs we have available, based on our sc_link.openings.
2007-03-13we need a resid tooDavid Gwynne
2007-03-13add timeouts on ata_xfersDavid Gwynne
2007-03-12ata counts sectors from 1, scsi counts from 0. adjust the value in theDavid Gwynne
read capacity completion to compensate.
2007-03-12parse the ata_identify to get a more correct value for the capacity of theDavid Gwynne
disk.
2007-03-12finish teh ata_identify struct.David Gwynne
2007-03-07Set ITSDONE otherwise the SCSI layer will sleep forever waiting for ourChristopher Pascoe
queued commands to be done.
2007-03-06big changes to the completion path in ahci.cDavid Gwynne
- add a ccb_done member to the ahci_ccb, which points to a function that is used to complete the current xfer - ccbs no longer rely on an ata_xfer being provided for submission to work - ahci is stupid and has no way to telling you the difference between an empty command slot, and a completed command. we keep track of active commands with ap_active in ahci_port, so we dont try and complete commands we havent actually submitted - ahci_start simple submits a command to the hardware now - provide the start of an interrupt handler for each port (which is not yet called by the controllers interrupt handler) - provide an ahci_poll which is built on top of ahci_start and ahci_port_intr - remove the fake ata_xfers from the softreset path - on completion of an ahci command, sync the relevant dma memory - provide a completion path for ata_xfers which syncs the xfers buffer and calls the xfers completion handler in atascsi.c: - start defining the contents of the response to an ATA IDENTIFY command specific to SATA - implement the faking of scsi inquiries, so now you'll actually see a disk attach to ahci. - start implementing a fake scsi read capacity. it presents a fake geometry though, so dont get too excited when ahci magically makes your disk have a terabyte in size. lots of discussion, help, tweaks, and an ok from pascoe@
2007-02-28when allocating an xfer, preinit several values according to the port itsDavid Gwynne
destined for. add ata_exec, which will push the xfer on the right path.
2007-02-28stash a pointer to the atascsi instance in ata_port structs. the completionDavid Gwynne
routine will take a pointer to ata_xfer, not a void *. add some states and flags for the xfers, and some values for the hba to return when processing them.
2007-02-28we allocate an array of pointers, so we should bzero an array of pointers,David Gwynne
not an array of ints.
2007-02-19precomp -> features as per ATA specJonathan Gray
ok dlg@
2007-02-19i think ata_xfers should look more like this. stash the number of the portDavid Gwynne
in the ata_port struct so a hba can find its own info for that port.
2007-02-19actually init and destroy the shared ata stuff when an atascsi instanceDavid Gwynne
is created or destroyed.
2007-02-19code to set up a global pool for allocating ata_xfers out of, and forDavid Gwynne
accessing that pool.
2007-02-19oops, i should have tried to compile the REQUEST_SENSE handling beforeDavid Gwynne
committing it.
2007-02-19REQUEST_SENSE will say there is no sense data.David Gwynne
2007-02-19implement the start of the framework for scsi emulation of ata disksDavid Gwynne
2007-02-19as is short for atascsi, not abDavid Gwynne
2007-02-19pull in atascsi, a scsi to ata translation layer, so i can work on it inDavid Gwynne
tree. ive lost two large changes today thanks to my own stupidity which could have been avoided if they were in the tree. discussed with deraadt@ ok jsg@ grange@ an older version was ok marco@
2007-02-15Don't print the error strings returned by readdisklabel(). If youKenneth R Westerback
need the debug info uncomment the printf's you need. Crude but effective way to suppress 'no disklabel' errors that pop up at the most innconvenient times to frighten users. More elegant method, DPRINTF-like constructs or something, later. "Yay!" marco@ ok deraadt@