summaryrefslogtreecommitdiff
path: root/include/linux/libata.h
AgeCommit message (Collapse)Author
2005-06-02Automatic merge of /spare/repo/linux-2.6/.git branch HEAD
2005-06-02libata: update inline source docsEdward Falk
2005-05-26libata: Fix use-after-iounmapJeff Garzik
Jens Axboe pointed out that the iounmap() call in libata was occurring too early, and some drivers (ahci, probably others) were using ioremap'd memory after it had been unmapped. The patch should address that problem by way of improving the libata driver API: * move ->host_stop() call after all ->port_stop() calls have occurred. * create default helper function ata_host_stop(), and move iounmap() call there. * add ->host_stop_prewalk() hook, use it in sata_qstor.c (hi Mark). sata_qstor appears to require the host-stop-before-port-stop ordering that existed prior to applying the attached patch.
2005-05-15[PATCH] libata: flush COMRESET set and clearBrett Russ
Updated patch to fix erroneous flush of COMRESET set and missing flush of COMRESET clear. Created a new routine scr_write_flush() to try to prevent this in the future. Also, this patch is based on libata-2.6 instead of the previous libata-dev-2.6 based patch. Signed-off-by: Brett Russ <russb@emc.com> Index: libata-2.6/drivers/scsi/libata-core.c ===================================================================
2005-02-23[libata] Add missing hooks, to avoid oops in advanced SATA driversJeff Garzik
Advanced SATA drivers should not (and cannot) use the basic PCI IDE hooks for checking the Status and Error registers, as these registers are either in non-standard locations, or simply don't exist. In the error handling path, libata was unconditionally calling some PCI IDE hardware bitbanging functions, which would cause an oops in the AHCI driver and any other advanced libata driver.
2005-02-17[libata] add ->bmdma_{stop,status} hooksmat.loikkanen@synopsys.com
The timeout/error handling path was assuming that the hardware in question was PCI IDE BMDMA-like, which is incorrect in a few cases. Turn direct function calls into two new hooks.
2005-02-05[libata] fix probe object allocation bugsPete Zaitcev
The code previously alloced a 2-entry array, then freed each entry individually, for users of "combined mode". Convert code to use allocation function that only allocates one object at a time. Also, un-export ata_pci_init_legacy_mode(), as its only user is libata-core.
2004-12-27[libata] verify ATAPI DMA for a given request is OKAlbert Lee
After some testing, it seems that some PATA host adapter (ex. pdc20275) cannot work reliably with specific request buffer sizes under ATAPI DMA mode. Detailed test result: 4096, 2048, 1024, 512, 256: OK 384, 257, 255, 128, 96, 64, 32: failed (irq lost) It seems multiple of 256 bytes are the safe ATAPI DMA buffer sizes to use. Attached please find the patch to fix the pdc2027x ATAPI DMA problem. Changes: 1. Add a callback function "check_atapi_dma()" to ata_port_operations such that libata core can ask the driver: "Can this command be processed in ATAPI DMA mode safely? " when the the command is received. 2. ATAPI DMA is off by default if the callback function is not provided by the driver If the callback function is not provided by the driver, the ATAPI DMA should be as is. The ATAPI DMA is already controlled by dev->flags. BTW, the patch isolates the ATAPI DMA workaround to the pdc20275 driver itself, not impacting libata core . Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
2004-12-07[libata] only DMA map data for DMA commands (fix >=4GB bug)Jeff Garzik
libata made the assumption that (for PIO commands in this case) it could modify DMA memory at the kernel-virtual address, after mapping this. This is incorrect, and fails on e.g. platforms that copy DMA memory back and forth (swiotlb on Intel EM64T and IA64). Remove this assumption by ensuring that we only call the DMA mapping routines if we really are going to use DMA for data xfer. Also: remove a bogus WARN_ON() in ata_sg_init_one() which caused bug reports (but no problems).
2004-11-12[libata] remove dependence on PCIJeff Garzik
Most of this work was done by "Mat Loikkanen" <Mat.Loikkanen@synopsys.com>. * use struct device rather than struct pci_dev * use generic DMA routines (dma_xxx) and generic struct device routines (dev_xxx) * isolate PCI-specific helpers inside CONFIG_PCI
2004-10-27[libata] cosmetic libata.h changes to make merging with 2.4 easierJeff Garzik
2004-10-19Merge pobox.com:/spare/repo/linux-2.6Jeff Garzik
into pobox.com:/spare/repo/libata-dev/export-simulator
2004-10-15[libata] arbitrary size ATAPI PIO supportBartlomiej Zolnierkiewicz
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-14[PATCH] Export ata_scsi_simulate() for use by non-libata driversMark Lord
This patch modifies libata-scsi for easier sharing of the various ata_id_* functions and the ata_scsi_simulate() function with non-libata drivers. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
2004-10-11[PATCH] libata: PCI IDE legacy mode fixBartlomiej Zolnierkiewicz
In PCI IDE legacy mode ap->port_no is incorrectly set to zero for the second port. Fix it by adding ->hard_port_no to struct ata_probe_ent and struct ata_port (per Jeff's suggestion) and teaching ata_piix.c to use it instead of ->port_no. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-09-15[libata] add hook, and export functions needed for sata2 driversJeff Garzik
* add dev_select hook, and default/noop implementations * export ata_dev_classify * fix a couple bugs that cropped up when building with ATA_VERBOSE_DEBUG * export __sata_phy_reset, a variant that does not call ata_bus_reset
2004-09-13[libata] consolidate legacy/native mode init code into helpersJeff Garzik
Eliminates duplicate code in sata_nv, sata_sis, and sata_via.
2004-09-13[libata] remove distinction between MMIO/PIO helper functionsJeff Garzik
Prepare for use of new generic iomap API.
2004-09-10libata: initial PCI memory annotationsLinus Torvalds
2004-08-14[libata] add ioctl infrastructureJeff Garzik
Mainly adding the infrastructure for various ATA ioctls. Currently only supports two ATA-specific ioctls: HDIO_GET_32BIT and HDIO_SET_32BIT (hdparm -c)
2004-08-13[libata] support commands SYNCHRONIZE CACHE, VERIFY, VERIFY(16)Jeff Garzik
2004-07-10[libata] ATAPI work - cdb len, new taskfile protocol, cleanupsJeff Garzik
* new helper atapi_cdb_len() in linux/ata.h, use it after IDENTIFY PACKET DEVICE command completes * add new taskfile protocol ATA_PROT_ATAPI_NODATA * store scsi cdb in ata_queued_cmd. This removes another dependence on the scsi layer, and enables us to issue an internal REQUEST SENSE. * store cdb len in ata_port * new constant ATAPI_CDB_LEN for max cdb length * move ATA taskfile and SCSI cdb near the top of ata_queued_cmd, for better cacheline friendliness.
2004-07-10[libata] flags cleanupJeff Garzik
Remove unused/redundant flags ATA_DFLAG_{MASTER,WCACHE}
2004-07-07[libata] pio/dma flag bug fix, and cleanupJeff Garzik
In the transfer-mode cleanup recently, the code that set flag ATA_DFLAG_PIO disappeared. Resurrect it. Remove ATA_QCFLAG_DMA, it isn't needed. Always set polling in the ->qc_issue function, rather than force the user to do it when setting up an ata_queued_cmd. This gives maximum flexibility to the driver, letting the driver choose whether or not to poll.
2004-07-04[libata] transfer mode bug fixes and type cleanupJeff Garzik
Fix two bugs that causes the recently-added transfer mode code to break on 64-bit platforms. Make associated code more type-correct in the process.
2004-07-04[libata] transfer mode cleanupJeff Garzik
Add MWDMA support, and rework pio/mwdma/udma mode setup. In the lone test case for PATA support, ata_piix, MWDMA mode setting does not appear to work here. UDMA and PIO continue to work, so nobody will really notice. But beware. Probably a driver problem, not a bug in the core. Also, doesn't bother writing to dummy timing registers on ICH5/6 SATA anymore.
2004-07-03[libata] create, and use aga_sg_init[_one] helpersJeff Garzik
Move more SCSI-specific code out of libata core.
2004-07-03[libata] split ATA_QCFLAG_SG into ATA_QCFLAG_{SG,SINGLE}Jeff Garzik
In part of the effort to remove SCSI specifics from the libata internals, remove references to cmd->use_sg. cmd->use_sg becomes ATA_QCFLAG_SG, and !cmd->use_sg becomes ATA_QCFLAG_SINGLE. Convenience constant ATA_QCFLAG_DMAMAP is created when the programmer wishes to refer collectively to ATA_QCFLAG_{SG,SINGLE}.
2004-07-03[libata] create, and use, ->irq_clear hookJeff Garzik
This is more conservative in general, and so applies to multiple controllers. Specifically it attempts to address irq-related issues on the Intel ICH5/6 hardware. On Intel ICH5/6, the BMDMA 'interrupt' status bit will be set even on non-DMA commands, which software (and I) did not expect. This change clears pending interrupts once upon initialization, and then each time ata_irq_on() is called.
2004-07-02[libata] add ata_queued_cmd completion hookJeff Garzik
2004-07-02[libata] add ->qc_issue hookJeff Garzik
This hook is used when an ATA controller wishes to use hardware-specific methods of taskfile delivery, rather than the standard method of bitbanging the ATA shadow registers.
2004-06-22[libata sata_sil] Re-fix mod15write bugJeff Garzik
Certain early SATA drives have problems with write requests whose length satisfy the equation "sectors % 15 == 1", on the SiI 3112. Other drives, and other SiI controllers, are not affected. The fix for this problem is to avoid such requests, in one of three ways, for the affect drive+controller combos: 1) Limit all writes to 15 sectors 2) Use block layer features to avoid creating requests whose length satisfies the above equation. 3) When a request satisfies the above equation, split the request into two writes, neither of which satisfies the equation. I chose fix #1, the most simple to implement. After discussion with Silicon Image and others regarding the impact of this fix, I have decided to remain with fix #1, and will not be implementing a "better fix". This means that the affected SATA drives will see decreased performance, but set of affected drives is small and will never grow larger. Further, the complexity of implementing solution #2 or solution #3 is rather large. When implementing lba48 'large request' support, I unintentionally broke the fix for these affected drives. Kudos to Ricky Beam for noticing this. This change restores the fix, by adding a flag ATA_DFLAG_LOCK_SECTORS to indicate that the max_sectors value set by the low-level driver should never be changed.
2004-06-21[libata] fix build error, minor cleanupsJeff Garzik
2004-06-14[libata] ->qc_prep hookJeff Garzik
Rename ->fill_sg hook to ->qc_prep, and call it unconditionally (as opposed to ->fill_sg, which was called only when the flag ATA_QCFLAG_SG was set).
2004-06-14[libata] PCI IDE DMA code shufflingJeff Garzik
PCI IDE DMA standard (or "bmdma") helper routines ata_bmdma_stop, ata_bmdma_ack_irq, and ata_bmdma_status are added to linux/libata.h, and used in libata-core. There is a minor behavior change, such that, the Alt Status register is read before acknowledging the bmdma interrupt. This should be ok, and furthermore there will be more significant behavior changes in this area coming soon.
2004-06-14[libata] don't probe from workqueueJeff Garzik
Since we want the probe phase to call other workqueues, this is required to eliminate future deadlocks. Other methods would include starting a single-shot thread just for probing, but overall, using a separate thread for probing is pointless since we are already in process context when we probe. So, we simply call ata_bus_probe directly.
2004-05-16[libata] replace ATA_QCFLAG_ATAPI with inline helperJeff Garzik
Detection of an ATAPI taskfile is possible using a simple test on existing information, so there is no need to cache this value in a separate flag (ATA_QCFLAG_ATAPI). Instead, create and use a new helper function is_atapi_taskfile().
2004-05-16[libata] SCSI->ATA simulator hacking: INQUIRY commandJeff Garzik
The SCSI T10 committee is working on a document describing a standard method for translating ATA<->SCSI, since it being done quite often these days. Some of the recommendations are reasonable, and we implement two here: * Mirror that ATA 'removeable media' bit into INQUIRY output. * Change behavior of INQUIRY output field 'product revision' from the libata software version number to the first 4 bytes of the ATA device's firmware revision number. Rather than cache the firmware revision in struct ata_device, as was/is done with two other strings, I took the opportunity to eliminate the caching of the two other strings, 'vendor' and 'product'. These strings are now retrieved as needed from the IDENTIFY [PACKET] DEVICE info page, since we cache its entire contents. Retrieving a string from the identify-device page is done via the helper function ata_dev_id_string(), which is now exported. This patch winds up making struct ata_device 40 bytes smaller, and the libata core gets a bit smaller as well.
2004-05-16[libata] DMADIR supportJeff Garzik
DMADIR bit is necessary for some PATA->SATA bridges. These bridges require the OS driver to specify the data xfer direction, for PACKET (a.k.a. scsi) commands. A reliable DMADIR detection method hasn't yet been developed, and ATAPI is still a WIP, so DMADIR is enabled with an ifdef for now.
2004-05-15[libata] internal cleanupsJeff Garzik
Remove unused 'done_late' arg to ata_qc_complete(), which was never useful in 2.4, and never used at all in 2.6. This allows us to eliminate the same arg from ata_dma_complete(), and also make it more correct by passing the command rather than the ATA port structure as arg0.
2004-05-15Merge redhat.com:/spare/repo/sata-hacks/atapi-hacks-2.6Jeff Garzik
into redhat.com:/spare/repo/libata-2.6
2004-05-14[PATCH] Covert drivers to use msec_to_jiffiesAndrew Morton
Remove various private implementations of msecs_to_jiffies() and jiffies_to_msecs(). There are various uppercase versions which should be consolidated.
2004-05-13[libata] kill ATA_QCFLAG_POLL flagJeff Garzik
The standard ATA bit nIEN in the Device Control register serves as the indicator for whether we are polling or not. As it mirrors ATA_QCFLAG_POLL completely, eliminate that in favor of testing ATA_NIEN bit.
2004-05-13[libata] random minor bug fixesJeff Garzik
* Only call ata_sg_setup{_one} if ATA_QCFLAG_SG is set. Preparation for future use, as currently ATA_QCFLAG_SG is always set when ata_qc_issue is called. This change in theory is incorrect for Promise TX/SX4 drivers, since those drivers set up the Promise-specific packet in their ->fill_sg hook, which is now called conditionally. A FIXME that doesn't affect anything, for now. * ATA_PROT_ATAPI and ATA_PROT_ATAPI_DMA command issue need to be differentiated. * Create and use ata_qc_set_polling() to consistently set/clear the flags associated with using polling instead of interrupts.
2004-05-13[libata] add new ->bmdma_setup hookJeff Garzik
In order to support some new taskfile protocols, particularly ATAPI, the setup-and-start-DMA hook needs to be split into its component pieces, 'setup' and 'start'. For PCI IDE-style controllers, most of the code is moved into the 'setup' portion, with the 'start' portion only flipping a single bit in hardware.
2004-04-26[libata] remove unused struct ata_engineJeff Garzik
2004-04-25[libata] replace per-command semaphore with optional completionJeff Garzik
The semaphore was initialized and up'd for each command, but nobody was listening. Replace this with a completion, which may or may not be present.
2004-04-25[libata] move probe execution from katad thread to workqueue threadJeff Garzik
This allows us to kill the katad thread itself, and several thread-related variables in struct ata_port.
2004-04-25[libata] move PIO data xfer from katad thread to workqueue threadJeff Garzik
2004-04-25[libata] move ATAPI startup from katad thread to workqueue threadJeff Garzik
libata creates one thread per ata_port structure. This is inadequate for our needs, and also cumbersome to maintain, now that workqueues and Rusty's thread work is available. This patch begins to move libata away from doing its own per-port thread, by moving the ATAPI command initiation code to work under the workqueue system. This patch also creates a private workqueue, global to all of libata.