aboutsummaryrefslogtreecommitdiff
path: root/drivers/ata
AgeCommit message (Collapse)Author
2007-07-10pata_hpt3x3: major reworking and testingAlan Cox
The HPT343/345 (aka 363) is a bit of a warped device. For many setups you need to access the other registers via BAR4 offsets. PIO is now rock solid, DMA isn't. Unfortunately the drivers/ide hpt34x driver is completely broken so doesn't help further debug. Signed-off-by: Alan Cox <alan@redhat.com> Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-10libata: clean up horkage handlingTejun Heo
Horkage handling had the following problems. * dev->horkage was positioned after ATA_DEVICE_CLEAR_OFFSET, so it was cleared before the device is configured. This broke HORKAGE_DIAGNOSTIC. * Some used dev->horkage while others called ata_device_blacklisted() directly. This was at best confusing. This patch moves dev->horkage right after dev->flags and set the field according to the blacklist during device configuration. All users test against dev->horkage. ata_device_blacklisted() now has only one user, make it static. While at it, rename it to ata_dev_blacklisted() for consistency. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-10libata: quirk IOMEGA ZIP 250 ATAPI FLOPPYTejun Heo
The Zip 250 which chokes on MWDMA SET_XFERMODE sometimes have "Floppy" appeneded to its model number. Quirk it too. http://bugzilla.kernel.org/show_bug.cgi?id=8563 Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Hans de Bruin <bruinjm@xs4all.nl> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-10libata: simplify PCI legacy SFF host handlingTejun Heo
With PCI resource fix up for legacy hosts. We can use the same code path to allocate IO resources and initialize host for both legacy and native SFF hosts. Only IRQ requesting needs to be different. Rename ata_pci_*_native_host() to ata_pci_*_sff_host(), kill all legacy specific functions and use the renamed functions instead. This simplifies code a lot. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-10pata_mpc52xx: suspend/resume supportDomen Puncer
Implement suspend and resume routines for mpc52xx ata driver. Tested on Lite5200b with deep-sleep and low-power (not yet in-tree) modes. Signed-off-by: Domen Puncer <domen.puncer@telargo.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-10sata_promise: SATA hotplug support, take 2Mikael Pettersson
This patch enables hotplugging of SATA devices in the sata_promise driver. It's been tested successfully on both first- and second-generation Promise SATA chips: SATA150 TX2plus, SATAII150 TX2plus, SATAII150 TX4, SATA300 TX2plus, and SATA300 TX4. The only quirk I've seen is that hotplugging (insertion) on the first-generation SATA150 TX2plus requires a lengthier EH sequence than on the second-generation chips. On the second-generation chips a simple soft reset seems to suffice, but on the first-generation chip there's a "port is slow to respond" after the initial soft reset, after which libata issues a hard reset, and then the device is recognised. The hotplug checks are high up in the interrupt handling path, not deep down in error_intr as in ahci/sata_sil24. That's because the chip doesn't signal hotplug status changes in the per-port status register: instead a global register contains hotplug control and status flags for all ports. I considered following the ahci/sata_sil24 structure, but that would have required non-trivial changes to the interrupt handling path, so I chose to keep the hotplug changes simple and unobtrusive. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> -- This patch depends on the "sata_promise: cleanups" patch. Changes since the previous version (posted June 19): - Correct pdc_interrupt() to increment 'handled' also in the hotplug case. This prevents IRQ_NONE from being returned when an interrupt only has hotplug events to handle, which could confuse the kernel's IRQ machinery. - Added testing on the SATAII150 TX4. drivers/ata/sata_promise.c | 41 ++++++++++++++++++++++++++++++++++++----- 1 files changed, 36 insertions(+), 5 deletions(-) Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-10pata_sis: FIFO whackAlan Cox
If you are using a SiS controller and the BIOS didn't set it up then the FIFO may be left active when we try and set up the CD. Not convinced this matters but I'd prefer to be safe Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-10libata-core: convert to use cancel_rearming_delayed_work()Oleg Nesterov
We should not use cancel_work_sync(delayed_work->work). This works, but not good. We can use cancel_rearming_delayed_work(), this also simplifies the code. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] sata_mv: print out additional chip info during probeJeff Garzik
Indicate whether this is a Generation-I (50xx), Generation-II (60xx), or Generation-II-E (6042/7042) chip. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] Use ATA_UDMAx standard masks when filling driver's udma_mask infoJeff Garzik
The ATA_UDMAx masks are self-documenting, and far better than manually writing in the hex mask. Note that pata_it8213 mask differed from the comment. Added a FIXME there. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] AHCI: Add support for Marvell AHCI-like chips (initially 6145)Jeff Garzik
Add support for the SATA portion of Marvell's AHCI-compatible chips. The PATA port capability, also available via AHCI, is disabled until support is completed. NCQ and PCI MSI are disabled by default. Marvell says "we use NCQ" in their drivers but "we do not use PCI MSI." Theoretically that implies we need to fix ahci.c to work with Marvell NCQ, but one wonders why Marvell NCQ is any different from other AHCI chips. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] Clean up driver udma_mask initializersJeff Garzik
* Use ATA_UDMA* * Remove FIXME notations that once served to remind us to verify that these were indeed the correct UDMA masks. They are. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09libata: Support chips with 64K PRD quirkAlan Cox
Add ata_dumb_qc_prep and supporting logic so that a driver can just specify it needs to be helped in this area. 64K entries are split as with drivers/ide. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09Add a PCI ID for santa rosa's PATA controller.Christian Lamparter
Signed-off-by: Christian Lamparter <chunkeey@web.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09sata_sil24: sil24_interrupt() micro-optimisationMikael Pettersson
sil24_interrupt() loads host->ports[i] into a local variable, validates it, and then loads the value again in the call to sil24_host_intr(). This patch replaces the second load by a reference to the local variable. This is safe since no side-effects have occurred since the initial load. It also improves readability since it makes it clear that the parameter to sil24_host_intr() is the same value which was just validated. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09Add irq_flags to struct pata_platform_infoSonic Zhang
On some embedded platforms, such as blackfin, the gpio interrupt for IDE interface is designed to be triggered with high voltage. The gpio port should be configured properly by set_irq_type() when register the irq. This patch enable the generic pata platform driver to accept platform irq flags data. Signed-off-by: Sonic Zhang <sonic.adi@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09sata_promise: cleanupsMikael Pettersson
This patch applies some trivial cleanups to sata_promise: - repair whitespace damage - correct comment at board_2057x_pata definition - pull SATAII TX4 support code out to separate functions - rename ata_nr to ata_no for consistency with libata's port_no - remove some init-time debug printks (requested by Jeff) This patch should cause no behavioural changes, except for the removed printks. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> -- drivers/ata/sata_promise.c | 56 ++++++++++++++++++--------------------------- 1 files changed, 23 insertions(+), 33 deletions(-) Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] pata_ixp4xx: kill unused varJeff Garzik
Reported by Michael-Luke Jones. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09ata_piix: fix pio/mwdma programmingTejun Heo
Fix various bugs in pio/mwdma mode programming. * Control bits in the timing register wasn't cleared properly while programming PIO mode. * MWDMA mode programming cleared the wrong part of control bits. * MWDMA mode programming cleared udma_mask even when the controller doesn't support UDMA. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Art Haas <ahaas@airmail.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] ahci: minor internal cleanupsJeff Garzik
Minor cleanups, in preparation for merging Marvell PATA AHCI support in the future. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] sata_sx4, sata_via: minor documentation updatesJeff Garzik
sata_sx4: - describe overall driver theory of operation - add a few constants that will be used in the future sata_via: - remove mention of an old-EH function that is going away Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] ahci: minor internal cleanupsJeff Garzik
Function renaming and factorization. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] ahci: Factor out SATA port init into a separate functionJeff Garzik
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] pata_sil680: minor cleanups from benhJeff Garzik
Merge unrelated cleanups (__devinit, dev_dbg, hardware constant) from changeset "pata_sil680: Add MMIO support" authored by Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] sata_sx4: named constant cleanupJeff Garzik
* convert tabs to spaces * convert some hex numbers to (1 << n) preferred format * document i2c and timer control register bits Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] pata_ixp4xx: convert to new EHAlessandro Zummo
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] pdc_adma: Reorder initializers with a couple structsJeff Garzik
Make it easier to verify which struct initializers are present, by presenting them in the order in which they are defined in the API header. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] drivers: remove 'void __iomem *' casts from pre-iomap daysJeff Garzik
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] PATA drivers: remove ATA_FLAG_SRSTJeff Garzik
This flag only has meaning in old-EH drivers, and these drivers have already been converted to the new EH. Remove. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] sata_sil: register table cleanupJeff Garzik
Make the register offset table more maintainable. From the 'sii-lbt' branch, which enables the LBT chip feature. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09use_clustering (sht) bit set to 0 in AHCI ?Jens Axboe
ahci: enable sg segment clustering The specification states that ahci supports segments up to 4MiB in size, so enable clustering. Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09libata: replace ap->cbl tests with ATA_FLAG_SATA testsTejun Heo
ap->cbl == ATA_CBL_SATA indicates SATA cable while ap->flags & ATA_FLAG_SATA indicates SATA host port. Till now they always gave the same result but SATA/PATA bridge handling will change that. Switch to ATA_FLAG_SATA test if we're testing for host port type. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09[libata] pata_atiixp: add SB700 PCI IDJeff Garzik
From AMD. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09libata-acpi: implement _GTM/_STM supportTejun Heo
Implement _GTM/_STM support. acpi_gtm is added to ata_port which stores _GTM parameters over suspend/resume cycle. A new hook ata_acpi_on_suspend() is responsible for storing _GTM parameters during suspend. _STM is executed in ata_acpi_on_resume(). With this change, invoking _GTF is safe on IDE hierarchy and acpi_sata check before _GTF is removed. ata_acpi_gtm() and ata_acpi_stm() implementation is taken from Alan Cox's pata_acpi implementation. ata_acpi_gtm() is fixed such that the result parameter is not shifted by sizeof(union acpi_object). Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09libata-acpi: remove redundant checksTejun Heo
Remove remaining unnecessary feature and status checks. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09libata: reimplement ACPI invocationTejun Heo
This patch reimplements ACPI invocation such that, instead of exporting ACPI details to the rest of libata, ACPI event handlers - ata_acpi_on_resume() and ata_acpi_on_devcfg() - are used. These two functions are responsible for determining whether specific ACPI method is used and when. On resume, _GTF is scheduled by setting ATA_DFLAG_ACPI_PENDING device flag. This is done this way to avoid performing the action on wrong device device (device swapping while suspended). On every ata_dev_configure(), ata_acpi_on_devcfg() is called, which performs _SDD and _GTF. _GTF is performed only after resuming and, if SATA, hardreset as the ACPI spec specifies. As _GTF may contain arbitrary commands, IDENTIFY page is re-read after _GTF taskfiles are executed. If one of ACPI methods fails, ata_acpi_on_devcfg() retries on the first failure. If it fails again on the second try, ACPI is disabled on the device. Note that successful configuration clears ACPI failed status. With all feature checks moved to the above two functions, do_drive_set_taskfiles() is trivial and thus collapsed into ata_acpi_exec_tfs(), which is now static and converted to return the number of executed taskfiles to be used by ata_acpi_on_resume(). As failures are handled properly, ata_acpi_push_id() now returns -errno on errors instead of unconditional zero. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09libata-acpi: miscellaneous cleanupsTejun Heo
* Add missing LOCKING: and RETURNS: to function comment. * Don't conditionalize warning messages with ata_msg_probe(). Print directly with KERN_WARNING. * Drop duplicate debug messages. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09libata-acpi: clean up ata_acpi_exec_tfs()Tejun Heo
This patch cleans up ata_acpi_exec_tfs() and its friends. * Rename taskfile_array to ata_acpi_gtf and make it __packed as it's used as argument to ACPI method, and use pointer to ata_acpi_gtf and number of taskfiles to represent _GTF taskfiles instead of a pointer casted into unsigned long and byte count. This makes argument re-checking in do_drive_set_taskfiles() unnecessary. * Pointer in void * not in unsigned long. * Clean up do_drive_get_GTF() error handling and make do_drive_get_GTF() return number of taskfiles on success, 0 if _GTF doesn't exist or doesn't contain valid ata. -errno on other errors. * Remove superflous check for acpi->buffer.pointer. * Update taskfile_load_raw() such that printed messages look similar to the messages printed by ata_eh_report(). * s/do_drive_get_GTF/ata_dev_get_GTF/ s/do_drive_set_taskfiles/ata_dev_set_taskfiles/ Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-09libata-acpi: implement ata_acpi_associate()Tejun Heo
* Add acpi_handle to ata_host and ata_port. Rename ata_device->obj_handle to ->acpi_handle and move it above such that it doesn't get cleared on reconfiguration. * Replace ACPI node association which ata_acpi_associate() which is called once during host initialization. Unlike the previous implementation, ata_acpi_associate() uses ATA_FLAG_ACPI_SATA to choose between IDE or SATA ACPI hierarchy and uses simple child look up instead of recursive walk to match the nodes. This is way safer and simpler. Please read the following message for more info. http://article.gmane.org/gmane.linux.ide/17554 Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-03pata_pcmcia: Switch to ata_sff_port_startAlan Cox
PCMCIA doesn't use DMA and as this driver is used on many platforms we don't want it to fail on those that define the DMA alloc API as a NULL return Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-03pata_pdc202xx_old: Correct cable detect logicAlan Cox
We got it backwards and now the other detects are fixed it shows up Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-03ata_generic: Check the right register for the DMA enabled flagsAlan Cox
Mirrors change in IT821X Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-03pata_ali: fix UDMA settingsChuck Ebbert
This patch was found to fix some of the problems with the pata_ali driver. https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=156482 Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-03sata_mv: PCI-ID for Adaptec 1430SA SATA ControllerFlorian Attenberger
Signed-off-by: Florian Attenberger <valdyn@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-03libata: fix assigned IRQ reportingTejun Heo
host->irq and host->irq2 should be set before ata_host_register() for IRQ reporting to work. Move up host->irq assignment in ata_host_activate() and add it to ata_pci_init_one() native path and pata_cs5520. The port info printing in ata_host_register() doesn't fit all the different controllers. It should probably be moved out to LLDs with some helpers in the future. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-02[libata] sata_nv: undo merge errorJeff Garzik
Only the ADMA entry was supposed to be able to change queue depth. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-02libata: PATA-mode fixes for sis_sataUwe Koziolek
Changed PATA handler for PATA-ports used by sata_sis. This patch was originally submitted by Jeff Garzik. Added PCI-ID 1180 for SiS966 Controller in pata_sis. The 1180 mode is fully compatible to other SiS PATA-controller. The PCI-ID 1183 is SATA in PATA-emulation, but not fully compatible to SiS5513/5518. sata_sis.c is forwarding this ID to pata_sis. 1183 is not working if simply added to pata_sis. This handling fixes issues with SiS968. Signed-off-by: Uwe Koziolek <uwe.koziolek@gmx.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-02libata: add HTS541616J9SA00 to NCQ blacklistTejun Heo
Another member of HTS5416* family doing spurious NCQ completion. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Enrico Sardi <enricoss@tiscali.it> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-02sata_nv: allow changing queue depthRobert Hancock
The sata_nv driver was missing the change_queue_depth hook in the SCSI host template which the other NCQ-capable libata drivers had. This made it impossible to change the queue depth by user request. Add this in. Signed-off-by: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-07-02sata_inic162x: disable LBA48 devicesTejun Heo
sata_inic162x can't do LBA48 properly yet and is likely to corrupt data on drives larger than LBA28 limit. Disable LBA48 devices during device configuration. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>