aboutsummaryrefslogtreecommitdiff
path: root/drivers/ata
AgeCommit message (Collapse)Author
2007-10-29[libata] Link power management infrastructureKristen Carlson Accardi
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>
2007-10-29[libata] AHCI: fix newly introduced host-reset bugJeff Garzik
The recent fix to host reset introduced a problem, whereby AHCI-enable bit would be cleared upon reset, if it was not asserted prior to reset. Unconditionally enable AHCI-enable bit. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-29[libata] sata_nv: fix SWNCQ enablingJeff Garzik
Adapted from patches by Kuan Lou @ NVIDIA and Bartlomiej Zolnierkiewicz. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-29libata: add MAXTOR 7V300F0/VA111900 to NCQ blacklistTejun Heo
MAXTOR 7V300F0/VA111900 does spurious NCQ completions. Add it to blacklist. This problem is reported by Carsten Otto. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Carsten Otto <c-otto@gmx.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-29libata: no need to speed down if already at PIO0Tejun Heo
After reset, transfer mode is always PIO0 regardless of dev->xfer_mask. Check dev->pio_mode before trying to slow down after configuration failure. This prevents bogus speed down before device is actually configured. Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-29libata: relocate forcing PIO0 on resetTejun Heo
Forcing PIO0 on reset was done inside ata_bus_softreset(), which is a bit out of place as it should be applied to all resets - hard, soft and implementation which don't use ata_bus_softreset(). Relocate it such that... * For new EH, it's done in ata_eh_reset() before calling prereset. * For old EH, it's done before calling ap->ops->phy_reset() in ata_bus_probe(). This makes PIO0 forced after all resets. Another difference is that reset itself is done after PIO0 is forced. Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-29pata_ns87415: define SUPERIO_IDE_MAX_RETRIESFrank Lichtenheld
Code copied from drivers/ide/pci/ns87415.c uses this, so copy the definition from there as well. Fixes the following build error: CC [M] drivers/ata/pata_ns87415.o drivers/ata/pata_ns87415.c: In function ‘ns87560_read_buggy’: drivers/ata/pata_ns87415.c:228: error: ‘SUPERIO_IDE_MAX_RETRIES’ undeclared (first use in this function) drivers/ata/pata_ns87415.c:228: error: (Each undeclared identifier is reported only once drivers/ata/pata_ns87415.c:228: error: for each function it appears in.) Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-29[libata] Address some checkpatch-spotted issuesJeff Garzik
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-29[libata] fix 'if(' and similar areas that lack whitespaceJeff Garzik
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-29libata: implement ata_wait_after_reset()Tejun Heo
On certain device/controller combination, 0xff status is asserted after reset and doesn't get cleared during 150ms post-reset wait. As 0xff status is interpreted as no device (for good reasons), this can lead to misdetection on such cases. This patch implements ata_wait_after_reset() which replaces the 150ms sleep and waits upto ATA_TMOUT_FF_WAIT if status is 0xff. ATA_TMOUT_FF_WAIT is currently 800ms which is enough for HHD424020F7SV00 to get detected but not enough for Quantum GoVault drive which is known to take upto 2s. Without parallel probing, spending 2s on 0xff port would incur too much delay on ata_piix's which use 0xff to indicate empty port and doesn't have SCR register, so GoVault needs to wait till parallel probing. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-29libata: track SLEEP state and issue SRST to wake it upTejun Heo
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>
2007-10-29libata: relocate and fix post-command processingTejun Heo
Some commands need post-processing after successful completion. This was done in ata_scsi_qc_complete() till now but this has the following problems. * Post-command processing gets executed when qc is completed from EH. Some qc's are retried from EH with zero err_mask and thus triggers unnecessary/incorrect post-command processing. * Command post processing doesn't belong to SAT layer. * Link-wide revalidation was scheduled where device revalidation suffices. This patch moves post-command processing to success completion path of ata_qc_complete() which is travelled iff the command is going to be completed without passing through EH and updates post-command processing such that device-specific action is used. While at it, restructure code a bit for readability. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-25Merge branch 'sg' of git://git.kernel.dk/linux-2.6-blockLinus Torvalds
* 'sg' of git://git.kernel.dk/linux-2.6-block: fix sg_phys to use dma_addr_t ub: add sg_init_table for sense and read capacity commands x86: pci-gart fix blackfin: fix sg fallout xtensa: dma-mapping.h is using linux/scatterlist.h functions, so include it SG: audit of drivers that use blk_rq_map_sg() arch/um/drivers/ubd_kern.c: fix a building error SG: Change sg_set_page() to take length and offset argument AVR32: Fix sg_page breakage mmc: sg fallout m68k: sg fallout More SG build fixes sg: add missing sg_init_table calls to zfcp SG build fix
2007-10-25[libata] sata_nv: SWNCQ should not apply to MCP61Kuan Luo
The mcp61 has bug with ncq. Signed-off-by: Kuan Luo <kluo@nvidia.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-25libata-core: Be a bit more relaxed about early DMA zero devicesAlan Cox
I guess Windows didn't care about the command so neither did they Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-25ahci: ahci: implement workaround for ASUS P5W-DH Deluxe ↵Tejun Heo
ahci_broken_hardreset(), take #2 P5W-DH Deluxe has ICH9 which doesn't have PMP support but SIMG 4726 hardwired to the second port of AHCI controller at PCI device 1f.2. The 4726 doesn't work as PMP but as a storage processor which can do hardware RAID on downstream ports. When no device is attached to the downstream port of the 4726, pseudo ATA device for configuration appears. Unfortunately, ATA emulation on the device is very lousy and causes long hang during boot. This patch implements workaround for the board. If the mainboard is P5W-DH Deluxe (matched using DMI), only hardreset is used on the second port of AHCI controller @ 1f.2 and the hardreset doesn't depend on receiving the first FIS and just proceed to IDENTIFY. This workaround fixes bugzilla #8923. http://bugzilla.kernel.org/show_bug.cgi?id=8923 Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-25Fix pata_icside build for recent libata API changesAl Viro
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-25libata: cosmetic clean up in ata_eh_reset()Tejun Heo
Local variable @action usage in ata_eh_reset() is a bit confusing. It's used only to cache ehc->i.action to test reset masks after clearing it; however, due to the generic name "action", it's easy to misinterpret the local variable as containing the selected reset method later. Also, the reason for caching the original value is easy to miss. This patch renames @action to @tmp_action and make it buffer newly selected value instead to improve readability. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-25libata-core.c: make 2 functions staticAdrian Bunk
strn_pattern_cmp() and ata_port_detach() can become static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-25[libata] Create internal helper ata_dev_set_feature()Jeff Garzik
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-24SG: Change sg_set_page() to take length and offset argumentJens Axboe
Most drivers need to set length and offset as well, so may as well fold those three lines into one. Add sg_assign_page() for those two locations that only needed to set the page, where the offset/length is set outside of the function context. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-23libata: add HTS542525K9SA00 to NCQ blacklistTejun Heo
Another one doing spurious NCQ completions. Blacklist it. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Luca Tettamanti <kronos.it@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-23libata-core: auditting chk_status v check_statusAlan Cox
Did a complete audit of these and found we have another error case. ata_bus_softreset calls ata_check_status which means that it tries to do an ioread8 on the port blindly and check versus 0xFF for an error. It should of course be using the ap->ops method for this via chk_status, and this bug causes a wrog status call on the NS87415 at least. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-23[libata] checkpatch-inspired cleanupsJeff Garzik
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>
2007-10-22[SG] Update drivers to use sg helpersJens Axboe
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-19Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivialLinus Torvalds
* git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (74 commits) fix do_sys_open() prototype sysfs: trivial: fix sysfs_create_file kerneldoc spelling mistake Documentation: Fix typo in SubmitChecklist. Typo: depricated -> deprecated Add missing profile=kvm option to Documentation/kernel-parameters.txt fix typo about TBI in e1000 comment proc.txt: Add /proc/stat field small documentation fixes Fix compiler warning in smount example program from sharedsubtree.txt docs/sysfs: add missing word to sysfs attribute explanation documentation/ext3: grammar fixes Documentation/java.txt: typo and grammar fixes Documentation/filesystems/vfs.txt: typo fix include/asm-*/system.h: remove unused set_rmb(), set_wmb() macros trivial copy_data_pages() tidy up Fix typo in arch/x86/kernel/tsc_32.c file link fix for Pegasus USB net driver help remove unused return within void return function Typo fixes retrun -> return x86 hpet.h: remove broken links ...
2007-10-19[libata] sata_sis: use correct S/G table sizeJeff Garzik
sata_sis has the same restrictions as other SFF controllers, and so must use LIBATA_MAX_PRD to denote that SCSI may only fill ATA_MAX_PRD/2 entries, due to our need to handle IOMMU merging. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-19pata_cs5536: MWDMA fixBartlomiej Zolnierkiewicz
* Fix out-of-bound array access for MWDMA modes. * Bump driver version. Cc: "Martin K. Petersen" <martin.petersen@oracle.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-19sata_sis: fix SCR read breakageTejun Heo
SCR read for controllers which uses PCI configuration space for SCR access got broken while adding @val argument to SCR accessors. Fix it. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-19libata: fix kernel-doc param nameRandy Dunlap
Fix libata kernel-doc parameter name. Warning(linux-2.6.23-git13//drivers/ata/libata-core.c:1415): No description found for parameter 'sgl' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-20pata_cmd64x.c typo fixAdrian Bunk
Spotted by David Miller <davem@davemloft.net>. Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-19Fix misspellings of "system", "controller", "interrupt" and "necessary".Robert P. J. Day
Fix the various misspellings of "system", controller", "interrupt" and "[un]necessary". Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Adrian Bunk <bunk@kernel.org>
2007-10-18Merge branch 'upstream-linus' of ↵Linus Torvalds
master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev * 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: [libata] kill ata_sg_is_last() Update libata driver for bf548 atapi controller against the 2.6.24 tree. libata-sff: Correct use of check_status() drivers/ata: add support to Freescale 3.0Gbps SATA Controller pata_acpi: fix build breakage if !CONFIG_PM
2007-10-18sparse pointer use of zero as nullStephen Hemminger
Get rid of sparse related warnings from places that use integer as NULL pointer. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> Cc: Andi Kleen <ak@suse.de> Cc: Jeff Garzik <jeff@garzik.org> Cc: Matt Mackall <mpm@selenic.com> Cc: Ian Kent <raven@themaw.net> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Davide Libenzi <davidel@xmailserver.org> Cc: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-18[libata] kill ata_sg_is_last()Jeff Garzik
Short term, this works around a bug introduced by early sg-chaining work. Long term, removing this function eliminates a branch from a hot path loop in each scatter/gather table build. Also, as this code demonstrates, we don't need to _track_ the end of the s/g list, as long as we mark it in some way. And doing so programatically is nice. So its a useful cleanup, regardless of its short term effects. Based conceptually on a quick patch by Jens Axboe. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-17Update libata driver for bf548 atapi controller against the 2.6.24 tree.Sonic Zhang
Changes: 1. Remove irq_ack() and port_disable() methods 2. Acocomodate for the libata-link patches 3. Change Kconfig ATAPI mode option into a module param. 4. Add supported WMDMA mode. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-17libata-sff: Correct use of check_status()Alan Cox
ata_check_status() does an SFF compliant check ata_chk_status() does a generic call to ap->ops->check_status (usually ata_check_status) libata-sff uses the wrong one. Hardly suprising given the naming here, which ought to get fixed to ata_sff_check_status() perhaps ? Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-17drivers/ata: add support to Freescale 3.0Gbps SATA ControllerLi Yang
This patch adds support for Freescale 3.0Gbps SATA Controller supporting Native Command Queueing(NCQ), device hotplug, and ATAPI. This controller can be found on MPC8315 and MPC8378. Signed-off-by: Ashish Kalra <ashish.kalra@freescale.com> Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-17pata_acpi: fix build breakage if !CONFIG_PMTejun Heo
There are configurations where CONFIG_ACPI but !CONFIG_PM. In this case, pata_acpi can be selected but won't build. Fix it. Reported by Avuton Olrich. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Avuton Olrich <avuton@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-16Merge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-blockLinus Torvalds
* 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block: (63 commits) Fix memory leak in dm-crypt SPARC64: sg chaining support SPARC: sg chaining support PPC: sg chaining support PS3: sg chaining support IA64: sg chaining support x86-64: enable sg chaining x86-64: update pci-gart iommu to sg helpers x86-64: update nommu to sg helpers x86-64: update calgary iommu to sg helpers swiotlb: sg chaining support i386: enable sg chaining i386 dma_map_sg: convert to using sg helpers mmc: need to zero sglist on init Panic in blk_rq_map_sg() from CCISS driver remove sglist_len remove blk_queue_max_phys_segments in libata revert sg segment size ifdefs Fixup u14-34f ENABLE_SG_CHAINING qla1280: enable use_sg_chaining option ...
2007-10-16remove blk_queue_max_phys_segments in libataFUJITA Tomonori
LIBATA_MAX_PRD is the maximum number of DMA scatter/gather elements permitted by the HBA's DMA engine. It's properly set to q->max_hw_segments via the sg_tablesize parameter. libata shouldn't call blk_queue_max_phys_segments. Now LIBATA_MAX_PRD is equal to SCSI_MAX_PHYS_SEGMENTS by default (both is 128), so everything is fine. But if they are changed, some code (like the scsi mid layer, sg chaining, etc) might not work properly. (Addition from Jens) The basic issue is that the physical segment setting is purely a driver issue. And since SCSI is managing the sglist, libata has no business changing the setting. All libata should care about is the hw segment setting. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-16libata sg chaining support fixFUJITA Tomonori
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-16libata: convert to using sg helpersJens Axboe
This converts libata to using the sg helpers for looking up sg elements, instead of doing it manually. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2007-10-15docbook: fix libata contentRandy Dunlap
Fix libata docbook warnings. Warning(linux-2.6.23-git8//drivers/ata/libata-scsi.c:3251): No description found for parameter 'dev' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-15[libata] pata_cs5536: new API build fixJeff Garzik
This driver was using hooks that were very recently removed. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-15[libata] pata_pcmcia: Add additional id string (corsair, 1GB)Kristoffer Ericson
Signed-off-by: Kristoffer Ericson <kristoffer.ericson@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-15libata: prevent devices with blank model names from being DMA blacklistedAndrew Paprocki
The strn_pattern_cmp routine does not handle a blank name parameter properly. The only patterns which should match a blank name are "*" and an explicit "". If the function is passed a blank name in current code, it will always match against the patt parameter. The bug manifests itself as the device with the empty model name always matching the first device in the DMA blacklist, forcing it to revert to PIO mode. Signed-off-by: Andrew Paprocki <andrew@ishiboo.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2007-10-15ata_piix: SATA 2port controller port map fixJason Gaston
This patch adds a port map for ICH9 and ICH8 SATA controllers that have only 2 ports available in that mode. Signed-off-by: Jason Gaston <jason.d.gaston@intel.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-15pata_cs5536: ATA driver for Geode companion chipMartin K. Petersen
This is a driver for the ATA controller on the Geode CS5536 companion chip. The PCI device ID for this device was previously claimed by pata_amd.c but the PIO timings were not correct. This driver also works around a bug in some BIOSes that handle unaligned access to the PCI config registers poorly. Finally, the driver allows fallback to using MSR registers for configuration on BIOSes that are truly broken. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-15libata: add ST9160821AS / 3.CCD to NCQ blacklistTejun Heo
ST9160821AS / 3.CCD does spurious completions too. Blacklist it. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>