aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ata.h
Commit message (Collapse)AuthorAge
* libata: handle broken cable reportingAlan Cox2007-11-05
| | | | | | | | | | | | | One or two ancient drives predated the cable spec and didn't sent the valid bits for the field. I had hoped to leave this out of libata as a piece of historical annoyance but a recent CD drive shows the same bug so we have to import support for it. Same concept as Bartlomiej's changes old IDE except that as we have centralised blacklists we can avoid keeping another private table of stuff Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata and bogus LBA48 drivesGeert Uytterhoeven2007-11-04
| | | | | | | | | | | | A colleague noticed recent versions of Ubuntu no longer detect his 80 GB ST380020ACE drive. This drive is special in that it advertises LBA48 support, but has the lba_capacity_2 field set to zero (cfr. http://lkml.org/lkml/2004/3/30/163). Upon closer look, libata indeed doesn't seem to handle this case yet. Below is an (untested) fix. Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata: increase 128 KB / cmd limit for ATAPI tape drivesTony Battersby2007-11-03
| | | | | | | | | | | | | | | | | | | | | | | Commands sent to ATAPI tape drives via the SCSI generic (sg) driver are limited in the amount of data that they can transfer by the max_sectors value. The max_sectors value is currently calculated according to the command set for disk drives, which doesn't apply to tape drives. The default max_sectors value of 256 limits ATAPI tape drive commands to 128 KB. This patch against 2.6.24-rc1 increases the max_sectors value for tape drives to 65535, which permits tape drive commands to transfer just under 32 MB. Tested with a SuperMicro PDSME motherboard, AHCI, and a Sony SDX-570V SATA tape drive. Note that some of the chipset drivers also set their own max_sectors value, which may override the value set in libata-core. I don't have any of these chipsets to test, so I didn't go messing with them. Also, ATAPI devices other than tape drives may benefit from similar changes, but I have only tape drives and disk drives to test. Signed-off-by: Tony Battersby <tonyb@cybernetics.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [libata] Link power management infrastructureKristen Carlson Accardi2007-10-29
| | | | | | | | | | | | | | | | | | | | | | Device Initiated Power Management, which is defined in SATA 2.5 can be enabled for disks which support it. This patch enables DIPM when the user sets the link power management policy to "min_power". Additionally, libata drivers can define a function (enable_pm) that will perform hardware specific actions to enable whatever power management policy the user set up for Host Initiated Power management (HIPM). This power management policy will be activated after all disks have been enumerated and intialized. Drivers should also define disable_pm, which will turn off link power management, but not change link power management policy. Documentation/scsi/link_power_management_policy.txt has additional information. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* libata: track SLEEP state and issue SRST to wake it upTejun Heo2007-10-29
| | | | | | | | | | | | | | | ATA devices in SLEEP mode don't respond to any commands. SRST is necessary to wake it up. Till now, when a command is issued to a device in SLEEP mode, the command times out, which makes EH reset the device and retry the command after that, causing a long delay. This patch makes libata track SLEEP state and issue SRST automatically if a command is about to be issued to a device in SLEEP. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Bruce Allen <ballen@gravity.phys.uwm.edu> Cc: Andrew Paprocki <andrew@ishiboo.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [libata] checkpatch-inspired cleanupsJeff Garzik2007-10-23
| | | | | | | | | | | | Tackle the relatively sane complaints of checkpatch --file. The vast majority is indentation and whitespace changes, the rest are * #include fixes * printk KERN_xxx prefix addition * BSS/initializer cleanups Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
* libata: add human-readable error value decodingRobert Hancock2007-10-12
| | | | | | | | | | | | | | | | This adds human-readable decoding of the ATA status and error registers (similar to what drivers/ide does) as well as the SATA Serror register to libata error handling output. This prevents the need to pore through standards documents to figure out the meaning of the bits in these registers when looking at error reports. Some bits that drivers/ide decoded are not decoded here, since the bits are either command-dependent or obsolete, and properly parsing them would add too much complexity. Signed-off-by: Robert Hancock <hancockr@shaw.ca> [edited slightly to make output a bit more symmetric] Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata: misc updates for ANTejun Heo2007-10-12
| | | | | | | | | | | | | | | Update AN support in preparation of PMP support. * s/ata_id_has_AN/ata_id_has_atapi_AN/ * add AN enabled reporting during configuration * add err_mask to AN configuration failure reporting * update LOCKING comment for ata_scsi_media_change_notify() * check whether ATA dev is attached to SCSI dev ata_scsi_media_change_notify() * set ATA_FLAG_AN in ahci and sata_sil24 Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Kriten Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata: Strict checking for identify reportingAlan Cox2007-10-12
| | | | | | | | | | | | | | The ATA specifications require checks on certain flags before assuming the validity of other data. Go through the methods and correct those needing extra checks. Also note limits on ata_id_major_version with respect to ATA-1 and ATA-2. Correct the 32bit PIO check. Wants to sit in -mm for a bit in case of a screwup on my part that I didn't hit on the test drives and also in case someone, somewhere has a drive that gets it wrong. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [libata] check for SATA async notify supportKristen Carlson Accardi2007-10-12
| | | | | | | | Check to see if an ATAPI device supports Asynchronous Notification. If so, enable it, if the host controller supports AN. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata: Correct IORDY handlingAlan Cox2007-10-12
| | | | | | | | | | | | | | | | Debugging a report of a problem with an ancient solid state disk showed up some problems in the IORDY handling 1. We check the wrong bit to see if the device has IORDY 2. Even then some ancient creaking piles of crap don't support SETXFER at all. The cases it fixes are obscure and the risk of side effects is slight but possible. This also moves us slightly closer to supporting original MFM/RLL disks with libata. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* ata: add ATA_MWDMA* and ATA_SWDMA* definesBartlomiej Zolnierkiewicz2007-08-31
| | | | | | Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* ide: add PIO masksBartlomiej Zolnierkiewicz2007-07-19
| | | | | | | | | | | | | * Add ATA_PIO[0-6] defines to <linux/ata.h>. * Add ->pio_mask field to ide_pci_device_t and ide_hwif_t. * Add PIO masks to host drivers. <linux/ata.h> change ACK-ed by Jeff Garzik <jeff@garzik.org>. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* libata-link: add PMP related ATA constantsTejun Heo2007-07-10
| | | | | | | | Add Port Multiplier related ATA constants and macros. Some of these will be used by ata_link implementation. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [ATA] Add named constant for ATAPI command DEVICE RESETJeff Garzik2007-07-09
| | | | Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata passthru: update cached device paramtersAlbert Lee2007-06-09
| | | | | | | | | INIT_DEV_PARAMS and SET_MULTI_MODE change the device parameters cached by libata. Re-read IDENTIFY DEVICE info and update the cached device paramters when seeing these commands. Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata passthru: support PIO multi commandsAlbert Lee2007-06-09
| | | | | | | support the pass through of PIO multi commands. Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata: Handle drives that require a spin-up command before first accessMark Lord2007-04-28
| | | | | | | | | | | | | | | | | | | | | | | | | (S)ATA drives can be configured for "power-up in standby", a mode whereby a specific "spin up now!" command is required before the first media access. Currently, a drive with this feature enabled can not be used at all with libata, and once in this mode, the drive becomes a doorstop. The older drivers/ide subsystem at least enumerates the drive, so that it can be woken up after the fact from a userspace HDIO_* command, but not libata. This patch adds support to libata for the "power-up in standby" mode where a "spin up now!" command (SET_FEATURES) is needed. With this, libata will recognize such drives, spin them up, and then re-IDENTIFY them if necessary to get a full/complete set of drive features data. Drives in this state are determined by looking for special values in id[2], as documented in the current ATA specs. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata: HPA supportAlan Cox2007-04-28
| | | | | | | | | | | | | | | Signed-off-by: Alan Cox <alan@redhat.com> Add support for ignoring the BIOS HPA result (off by default) and setting the disk to the full available size unless already frozen. Tested with various platforms/disks and confirmed to work with the Macintosh (which broke earlier) and ata_piix (breakage due to the LBA48 readback that Tejun fixed). For normal users this brings us, I believe, to feature parity with old IDE (and of course more featured in some areas too). Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata: add support for READ/WRITE LONGMark Lord2007-04-28
| | | | | | | | | | | | | | | | | | The READ/WRITE LONG commands are theoretically obsolete, but the majority of drives in existance still implement them. The WRITE_LONG and WRITE_LONG_ONCE commands are of particular interest for fault injection testing -- eg. creating "media errors" at specific locations on a disk. The fussy bit is that these commands require a non-standard sector size, usually 520 bytes instead of 512. This patch adds support to libata for READ/WRITE LONG commands issued via SG_IO/ATA_16. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata: Limit max sector to 128 for TORiSAN DVD drives (take 3)Albert Lee2007-04-04
| | | | | | | | | | patch 3/4: The TORiSAN drive locks up when max sector == 256. Limit max sector to 128 for the TORiSAN DRD-N216 drives. (http://bugzilla.kernel.org/show_bug.cgi?id=6710) Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata: test major version in ata_id_is_sata()Tejun Heo2007-02-23
| | | | | | | Test major version in ata_id_is_sata() not separately. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata: fix drive side 80c cable check, take 3Tejun Heo2007-02-15
| | | | | | | | | | | The 80c wire bit is bit 13, not 14. Bit 14 is always 1 if word93 is implemented. This increases the chance of incorrect wire detection especially because host side cable detection is often unreliable and we sometimes soley depend on drive side cable detection. Fix the test and add word93 validity check. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* ata: Add defines for the iordy bitsAlan2007-02-09
| | | | | | | IORDY and IORDY enable/disable flags. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* libata: straighten out ATA_ID_* constantsTejun Heo2007-02-09
| | | | | | | | | | | | | | * Kill _OFS suffixes in ATA_ID_{SERNO|FW_REV|PROD}_OFS for consistency with other ATA_ID_* constants. * Kill ATA_SERNO_LEN * Add and use ATA_ID_SERNO_LEN, ATA_ID_FW_REV_LEN and ATA_ID_PROD_LEN. This change also makes ata_device_blacklisted() use proper length for fwrev. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [PATCH] libata: add 40pin "short" cable support, honour drive side speed ↵Alan Cox2006-12-01
| | | | | | | | | | | detection [deweerdt@free.fr: build fix] Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Frederik Deweerdt <deweerdt@free.fr> Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [libata] Trim trailing whitespace.Jeff Garzik2006-08-31
|
* [PATCH] libata: Add CompactFlash supportAlan Cox2006-08-14
| | | | | | | | The CFA world has some additional rules and drive modes we need to support for newer expansion cards and on embedded boxes Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [ATA] Increase lba48 max-sectors from 200 to 256.Jeff Garzik2006-08-10
| | | | | | | | | Also, moved ATA_MAX_SECTORS and ATA_MAX_SECTORS_LBA48 from linux/libata.h to linux/ata.h, now that they truly reflect the standard (well... mostly; note TODO comment). This changes the performance profile (and potential bug profile) for a bunch of drivers, so be wary.
* [PATCH] Snoop SET FEATURES - WRITE CACHE ENABLE/DISABLE command(v5)zhao, forrest2006-06-12
| | | | | | | | | This patch makes libata snoop 'SET FEATURES - WRITE CACHE ENABLE/DISABLE' command, executing requisite revalidation processes to update cached data. Signed-off-by: Forrest Zhao <forrest.zhao@intel.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [PATCH] libata-ncq: add NCQ related ATA/libata constants and macrosTejun Heo2006-05-15
| | | | | | Add NCQ related ATA/libata constants and macros. Signed-off-by: Tejun Heo <htejun@gmail.com>
* Merge branch 'irq-pio'Tejun Heo2006-05-15
|\ | | | | | | | | | | | | Conflicts: drivers/scsi/libata-core.c include/linux/libata.h
| * Merge branch 'upstream'Jeff Garzik2006-03-24
| |\ | | | | | | | | | | | | | | | Conflicts: drivers/scsi/sata_vsc.c
| * | [PATCH] libata-dev: recognize WRITE_MULTI_FUA_EXT for r/w multipleAlbert Lee2006-03-03
| | | | | | | | | | | | | | | | | | | | | Recognize ATA_CMD_WRITE_MULTI_FUA_EXT as r/w multiple commands. Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | Merge branch 'upstream'Jeff Garzik2006-02-13
| |\ \
| * \ \ Merge branch 'tmp'Jeff Garzik2006-01-27
| |\ \ \
| * \ \ \ Merge branch 'upstream'Jeff Garzik2006-01-17
| |\ \ \ \
| * | | | | [PATCH] libata irq-pio: add read/write multiple supportAlbert Lee2005-11-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add is_multi_taskfile() to ata.h - initialize ata_device->multi_count with device identify data - use ata_pio_sectors() to support r/w multiple commands Signed-off-by: Albert Lee <albertcc@tw.ibm.com> ======== Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
| * | | | | Merge branch 'master'Jeff Garzik2005-10-28
| |\ \ \ \ \
| * \ \ \ \ \ Merge branch 'upstream'Jeff Garzik2005-10-18
| |\ \ \ \ \ \
| * \ \ \ \ \ \ Merge libata upstream (which includes C/H/S support) include irq-pio branch.Jeff Garzik2005-10-03
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge branch 'upstream'
| * | | | | | | | [PATCH] libata: interrupt driven pio for libata-coreAlbert Lee2005-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - add PIO_ST_FIRST for the state before sending ATAPI CDB or sending "ATA PIO data out" first data block. - add ATA_TFLAG_POLLING and ATA_DFLAG_CDB_INTR flags - remove the ATA_FLAG_NOINTR flag since the interrupt handler is now aware of the states - modify ata_pio_sector() and atapi_pio_bytes() to work in the interrupt context - modify the ata_host_intr() to handle PIO interrupts - modify ata_qc_issue_prot() to initialize states - atapi_packet_task() changed to handle "ATA PIO data out" first data block - support the pre-ATA4 ATAPI device which raise interrupt when ready to receive CDB Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
* | | | | | | | | [PATCH] libata-eh: add ATA and libata flags for new EHTejun Heo2006-05-15
| |_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add ATA and libata flags to be used by new EH. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | | | | | | | [PATCH] libata: Add the useful macros/constants needed for merging PATA stuffAlan Cox2006-03-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HPA presence/enabled HPA commands Also add ata_id_is_cfa() as that is needed to detect and handle CF cards which currently we reject. Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | | | | | | | [PATCH] libata-dev: Remove ATA_PROT_PIO_MULTAlbert Lee2006-03-21
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the ATA_PROT_PIO_MULT protocol. Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | | | | | | [PATCH] libata: separate out ata_id_major_version()Tejun Heo2006-02-12
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Separate out ATA major version calculation from ata_dev_identify() into ata_id_major_version(). It's preparation for splitting ata_dev_identify(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
* | | | | | Merge branch 'upstream'Jeff Garzik2006-01-17
|\ \ \ \ \ \ | | |_|_|_|/ | |/| | | |
| * | | | | Merge branch 'post-2.6.15' of git://brick.kernel.dk/data/git/linux-2.6-blockLinus Torvalds2006-01-06
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manual fixup for merge with Jens' "Suspend support for libata", commit ID 9b847548663ef1039dd49f0eb4463d001e596bc3. Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| | * | | | | [BLOCK] add FUA support to libataTejun Heo2006-01-06
| | | |_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jens Axboe <axboe@suse.de>
| * / | | | [PATCH] Suspend support for libataJens Axboe2006-01-06
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds suspend patch to libata, and ata_piix in particular. For most low level drivers, they should just need to add the 4 hooks to work. As I can only test ata_piix, I didn't enable it for more though. Suspend support is the single most important feature on a notebook, and most new notebooks have sata drives. It's quite embarrassing that we _still_ do not support this. Right now, it's perfectly possible to suspend the drive in mid-transfer. Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>