summaryrefslogtreecommitdiff
path: root/drivers/ata
AgeCommit message (Collapse)Author
2009-04-17[libata] fix build error on drivers/ata/pata_legacy.cZhenwen Xu
fix those errors: drivers/ata/pata_legacy.c: In function ‘pdc_data_xfer_vlb’: drivers/ata/pata_legacy.c:289: error: ‘ap’ undeclared (first use in this function) drivers/ata/pata_legacy.c:289: error: (Each undeclared identifier is reported only once drivers/ata/pata_legacy.c:289: error: for each function it appears in.) drivers/ata/pata_legacy.c: At top level: drivers/ata/pata_legacy.c:869: error: ‘ATA_PFLAG_PIO32_CHANGE’ undeclared here (not in a +function) make[2]: *** [drivers/ata/pata_legacy.o] Error 1 make[1]: *** [drivers/ata] Error 2 Signed-off-by: Zhenwen Xu <helight.xu@gmail.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-17pata_via: Cache and rewrite the device bitAlan Cox
Some VIA chipsets will reset the DEV bit after IEN changes on ctl. Our optimised write path avoids doing this but we need to remove the optimisation on these devices. [Identified and some original patches proposed by Josehn Chan @ VIA but discussion then all ground to a halt so given a test case I dug it back out] Signed-off-by: Alan Cox <alan@lxorguk.ukuu.org.uk Tested-by: Christoph Bisping (bug #13086) Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-17sata_mv: workaround for multi_count errata sata24Mark Lord
Workaround for errata SATA#24 in sata_mv. This errata affects WRITE_MULTI* commands when the device multi_count produces a DRQ block size >= 4Kbytes. We work around it here by converting such operations into ordinary PIO_WRITEs instead. Note that this might result in a PIO FUA write unavoidably being converted into a non-FUA write. In practice, any system using FUA is also going to be using DMA rather than PIO, so this shouldn't affect anyone in the real world. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-17sata_mv: tidy up qc->tf usage in qc_prep() functionsMark Lord
Tidy up qc->tf accesses in the mv_qc_prep() functions. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-16ata: Report 16/32bit PIO as best we canAlan Cox
The legacy old IDE ioctl API for this is a bit primitive so we try and map stuff sensibly onto it. - Set PIO over DMA devices to report 32bit - Add ability to change the PIO32 settings if the controller permits it - Add that functionality into the sff drivers - Add that functionality into the VLB legacy driver - Turn on the 32bit PIO on the ninja32 and add support there Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-16libata: use ATA_ID_CFA_*Sergei Shtylyov
Use ATA_ID_CFA_* constants for CFA specific identify data words 162 and 163. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-16pata_legacy: fix no device fail pathTejun Heo
When pata_legacy can't detect any device, it unregisters the platform_device and fails detection. However, it forgets to detach ata host triggering weird failures as the host later gets freed by devres while still attached. Fix it. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-16pata_hpt37x: fix HPT370 DMA timeoutsSergei Shtylyov
The libata driver has copied the code from the IDE driver which caused a post 2.4.18 regression on many HPT370[A] chips -- DMA stopped to work completely, only causing timeouts. Now remove hpt370_bmdma_start() for good... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-16libata: handle SEMB signature betterTejun Heo
WDC WD1600JS-62MHB5 successfully hits the window between ATA/ATAPI-7 and Serial ATA II standards and reports 3c/c3 signature which now is assigned to SEMB. Make ata_dev_classify() report ATA_DEV_SEMB on the sig and let ata_dev_read_id() work around it by trying IDENTIFY once. This fixes bko#11579. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: David Haun <drhaun88@gmail.com> Reported-by: Lars Wirzenius <liw@liw.fi> Reported-by: Juan Manuel <jmcarranza@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-13ata: fix obviously wrong commentVegard Nossum
Also remove the now-useless debug printouts which are supposed to tell us when the scan starts and ends. Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-13ahci: force CAP_NCQ for earlier NV MCPsTejun Heo
Along with MCP65, MCP67 and 73 also don't set CAP_NCQ. Force it. Reported by zaceni@yandex.ru on bko#13014 and confirmed by Peer Chen. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: NightFox <zaceni2@yandex.ru> Cc: Peer Chen <pchen@nvidia.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-13[libata] sata_via: kill uninit'd var warningJeff Garzik
Reported and initial patch by Marin Mitov. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-07Merge branch 'upstream-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: sata_mv: shorten register names sata_mv: workaround errata SATA#13 sata_mv: cosmetic renames sata_mv: workaround errata SATA#26 sata_mv: workaround errata PCI#7 sata_mv: replace 0x1f with ATA_PIO4 (v2) sata_mv: fix irq mask races sata_mv: revert SoC irq breakage libata: ahci enclosure management bios workaround ata: Add TRIM infrastructure ata_piix: VGN-BX297XP wants the controller power up on suspend libata: Remove some redundant casts from pata_octeon_cf.c pata_artop: typo
2009-04-07dma-mapping: replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32)Yang Hongyang
Replace all DMA_32BIT_MASK macro with DMA_BIT_MASK(32) Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-07dma-mapping: replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64)Yang Hongyang
Replace all DMA_64BIT_MASK macro with DMA_BIT_MASK(64) Signed-off-by: Yang Hongyang<yanghy@cn.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-07sata_mv: shorten register namesMark Lord
Rename a slew of register name constants in sata_mv, removing the _OFS suffix from them, and shortening some of them in other ways as well. Also, bump up the version number to reflect all recent changes. In theory, no actual changes to the generated code, other than the version number bump. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-07sata_mv: workaround errata SATA#13Mark Lord
Add remainder of workaround for errata SATA#13. This prevents writes of certain adjacent 32-bit registers from being combined into single 64-bit writes, which might fail for the affected registers. Most of sata_mv is already safe from this issue, but adding this code to mv_write_cached_reg() will catch the remaining cases and hopefully prevent future ones. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-07sata_mv: cosmetic renamesMark Lord
Add _OFS suffix to more of the register offset names, for consistency with the rest of the driver. Also tag the defines for LTMODE and PHY_MODE4 to note that read-after-write is necessary when updating those regs. No code changes here. [NOTE: this commit is undone a few commits later] Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-07sata_mv: workaround errata SATA#26Mark Lord
Workaround for errata SATA#26. Prevents accidently putting a drive to sleep when attempting COMRESET, by ORing 0xf000 with the values written to SCR_CONTROL. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-07sata_mv: workaround errata PCI#7Mark Lord
Workaround for 60x1-B2 errata PCI#7. Write-combining may be unreliable when chip operates in PCI-X mode, so disable write-combining when in PCI-X mode. Also, update the errata comments at the top of sata_mv, and include a note about errata PCI#11. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-07sata_mv: replace 0x1f with ATA_PIO4 (v2)Mark Lord
Cosmetic change: replace .pio_mask=0x1f with .pio_mask=ATA_PIO4 everywhere. Originally from Erik Inge Bolsø, now reworked for latest sata_mv. Signed-off-by: Erik Inge Bolsø <knan-lkml@anduin.net> Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-07sata_mv: fix irq mask racesMark Lord
Prevent racing on the main interrupt mask during port_start and port_stop. Otherwise, we end up with IRQs masked on inactive ports, and hotplug insertions then get missed later on. Found while debugging (out of tree) target mode operations, but the bug is present and impacting mainline as well. This patch should also be considered for -stable. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-07sata_mv: revert SoC irq breakageMark Lord
Revert most of commit 6be96ac1d5e4d913e1f48299db083ada5321803b2, originally from Lennert Buijtenheck (Marvell) and Saeed Bishara (Marvell), since that commit causes sata_mv to oops at startup on SOC "Kirkwood". The SOC variants do not have the hpriv->irq_{cause,mask}_ofs registers, so don't try to write to them! This patch should also be considered for -stable. Reported-by: Maxime Bizon <mbizon@freebox.fr> Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-07libata: ahci enclosure management bios workaroundDavid Milburn
During driver initialization ahci_start_port may not be able to turn LEDs off because the hardware may still be transmitting a message. And since the BIOS may not be setting the LEDs to off the drive LEDs may end up in a fault state. This has been seen on ICH9r and ICH10r when configured in AHCI mode instead of RAID mode, this patch doesn't key off a specific set of device IDs but will give the EM transmit bit a chance to clear if busy. Signed-off-by: David Milburn <dmilburn@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-07ata_piix: VGN-BX297XP wants the controller power up on suspendTejun Heo
Sony VGN-BX297XP fails suspend if the controller is powered down when calling into ACPI suspend. Add the machine to piix_broken_suspend list. This problem was reported by GNUtoo@no-log.org on bko#10293. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Rafael J. Wysocki <rjw@sisk.pl> Reported-by: GNUtoo@no-log.org Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-04-07libata: Remove some redundant casts from pata_octeon_cf.cDavid Daney
Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-30trivial: fix typos/grammar errors in Kconfig textsMatt LaPlante
Signed-off-by: Matt LaPlante <kernel1@cyberdogtech.com> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-03-28Merge branch 'origin' into develRussell King
Conflicts: sound/soc/pxa/pxa2xx-i2s.c
2009-03-25Merge branch 'for-next' of ↵Russell King
git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 into devel
2009-03-25[libata] Improve timeout handlingAlan Cox
On a timeout call a device specific handler early in the recovery so that we can complete and process successful commands which timed out due to IRQ loss or the like rather more elegantly. [Revised to exclude the timeout handling on a few devices that inherit from SFF but are not SFF enough to use the default timeout handler] Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25[libata] Drain data on errorsAlan Cox
If the device is signalling that there is data to drain after an error we should read the bytes out and throw them away. Without this some devices and controllers get wedged and don't recover. Based on earlier work by Mark Lord Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25pata_sc1200: Activate secondary channelAlan Cox
Implement serialize and turn on slave channel Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25pata_artop: Serializing supportAlan Cox
Enable both ports on the 6210 and serialize them Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25[libata] ahci: correct enclosure LED state saveDavid Milburn
ahci_transmit_led_message saves off the led_state with a value that includes the port number OR'd in, this incorrect value maybe reported back in ahci_led_store. For instance, if you turn off all the leds for port 1 and cat the value back it will report 1 instead of 0. # echo 0 > /sys/class/scsi_host/host1/em_message # cat /sys/class/scsi_host/host1/em_message 1 Signed-off-by: David Milburn <dmilburn@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25[libata] More robust parsing for IDENTIFY DEVICE multi_count fieldMark Lord
Make libata more robust when parsing the multi_count field from a drive's identify data. This prevents us from attempting to use dubious multi_count values ad infinitum. Reset dev->multi_count to zero and reprobe it each time through this routine, as it can change on device reset. Also ensure that the reported "maximum" value is valid and is a power of two, and that the reported "count" value is valid and also a power of two. And that the "count" value is not greater than the "maximum" value. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25sata_mv: fix LED blinking for SoC+NCQMark Lord
For Marvell SoC chips, the HDD LED does not blink when there is disk I/O if NCQ is enabled. Add a quirk that enables blink mode for the LED while NCQ is enabled on any port of a SoC host controller. Normal LED function is restored when NCQ is not enabled on any port. The code to enable the blink mode is based on earlier code and suggestions from Frans Pop, Saeed Bishara, and possibly others. Signed-off-by: Mark Lord <mlord@pobox.com> Tested-by: Frans Pop <elendil@planet.nl> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25sata_mv: optimize IRQ coalescing for 8-port chipsMark Lord
Enable use of the "all ports" IRQ coalescing optimization for GEN_II / GEN_IIE chips that have dual host-controllers (8-ports). Currently only the 6081 chip qualifies, but other chips may come along someday. Rather than each half of the chip having to satisfy a local set of coalescing thresholds, use of this feature groups all ports together under a single set of thresholds. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25sata_mv: implement IRQ coalescing (v2)Mark Lord
Add IRQ coalescing to sata_mv (off by default). This feature can reduce total interrupt overhead for RAID setups in some situations, by deferring the interrupt signal until one or both of: a) a specified io_count (completed SATA commands) is achieved, or b) a specified time interval elapses after an IO completion. For now, module parameters are used to set the irq_coalescing_io_count and irq_coalescing_usecs (timeout) globally. These may eventually be supplemented with sysfs attributes, so that thresholds can be set on-the-fly and on a per-chip (or even per-host_controller) basis. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25sata_mv: cosmetic preparations for IRQ coalescingMark Lord
Various cosmetic changes in preparation for the IRQ coalescing feature. Note that the various MV_IRQ_COAL_* definitions are restored/renamed in the folloup patch which adds IRQ coalescing to the driver. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25pata-rb532-cf: platform_get_irq() fix ignored failureFlorian Fainelli
platform_get_irq() can return -ENXIO, but since 'irq' is an unsigned int, it does not show when the IRQ resource wasn't found. Make irq an int so that we can use a single variable to test the platform_get_irq() return value. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Phil Sutter <n0-1@freewrt.org> Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25pata_efar: fix *dma_maskErik Inge Bolsø
According to Alan: >and yes the EFAR does UDMA66. mwdma: >Yep - wrong comment. The EFAR is a sort of clone of the PIIX and I >copied the comment while EFAR don't appear to have copied the >limitation Signed-off-by: Erik Inge Bolsø <knan-lkml@anduin.net> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25pata_radisys: fix mwdma_mask to exclude mwdma0Erik Inge Bolsø
As noted by Alan: >Your suspicions are correct here btw - the device can only do MWDMA1 and >MWDMA2 (much like some PIIX devices) Signed-off-by: Erik Inge Bolsø <knan-lkml@anduin.net> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25[libata] convert drivers to use ata.h mode mask definesErik Inge Bolsø
No functional changes in this patch. Signed-off-by: Erik Inge Bolsø <knan-lkml@anduin.net> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25ahci: Blacklist HP Compaq 6720s that spins off disks during ACPI power offMaciej Rutecki
Blacklist HP Compaq 6720s so that it doesn't play a "spin down, spin up, spin down" ping-pong with the hard disk during system power off. Signed-off-by: Maciej Rutecki <maciej.rutecki@gmail.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25[libata] sata_mv: Implement direct FIS transmission via mv_qc_issue_fis().Mark Lord
This is initially needed to work around NCQ errata, whereby the READ_LOG_EXT command sometimes fails when issued in the traditional (sff) fashion. Portions of this code will likely be reused for implementation of the target mode feature later on. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25[libata] Export ata_pio_queue_task() so that it can be used from sata_mv.Mark Lord
Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25[libata] sata_mv: Add a new mv_sff_check_status() function to sata_mv.Mark Lord
This is necessary for use with the upcoming "mv_qc_issue_fis()" patch, but is being added separately here for easier code review. When using command issue via the "mv_qc_issue_fis()" mechanism, the initial ATA_BUSY bit does not show in the ATA status (shadow) register. This can confuse libata! So here we add a hook to fake ATA_BUSY for that situation, until the first time a BUSY, DRQ, or ERR bit is seen. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25[libata] sata_mv: Tighten up interrupt masking in mv_qc_issue()Mark Lord
so that it doesn't miss any protocols. Handle future cases where a qc is specially marked for polled issue or where a particular chip version prefers interrupts over polling for PIO. This mimics the polling decision logic from ata_sff_qc_issue(). Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25[libata] sata_mv: Enable use of (basic) DMA for ATAPI on GEN_IIE chipsMark Lord
This also gets rid of any need for mv_mode_filter(). Using basic DMA on GEN_IIE requires setting an undocumented bit in an undocumented register. For safety, we clear that bit again when switching back to EDMA mode. To avoid a performance penalty when switching modes, we cache the register in port_priv, as already done for other regs. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2009-03-25[libata] sata_mv: cache frequently-accessed registersMark Lord
Maintain a local (mv_port_priv) cache of frequently accessed registers, to avoid having to re-read them (very slow) on every transistion between EDMA and non-EDMA modes. This speeds up things like flushing the drive write cache, and anything using basic DMA transfers. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>