aboutsummaryrefslogtreecommitdiff
path: root/drivers/ata
AgeCommit message (Collapse)Author
2007-03-02libata: add missing CONFIG_PM in LLDsTejun Heo
Add missing #ifdef CONFIG_PM conditionals around all PM related parts in libata LLDs. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-02libata: add missing PM callbacksTejun Heo
Some LLDs were missing scsi device PM callbacks while having host/port suspend support. Add missing ones. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-02pata_qdi: Fix initialisationAlan Cox
The QDI init code contains some bugs which mean it only works if you have a test setup that causes both a successful and failed probe. Fix this Found by Philip Guo (Who found it working on code analysis tools not running VLB IDE controllers) Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-02[libata] pata_cmd64x: fix driver description in commentsJeff Garzik
Trivial comment fix, taken out of a larger Alan Cox patch. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-02[libata] pata_{legacy,sc1200,sl82c105}: add missing hooksJeff Garzik
Alan Cox noticed several hooks in pata_* drivers were missing, when he authored his ->cable_detect hook patches. This patch extracts just those fixes from Alan's patches, adding the necessary hooks (usually ->freeze, ->thaw, and ->post_internal_cmd) to the drivers. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-02[libata] change master/slave IDENTIFY orderJeff Garzik
2.6.21-rc has horrible problems with libata and PATA cable types (and thus speeds). This occurs because Tejun fixed a pile of other bugs and we now do cable detect enforcement for drive side detection properly. Unfortunately we don't do the process around cable detection right. Tejun identified the problem and pointed to the right Annex in the spec, this patch implements the needed changes. The basic requirement is that we have to identify the slave before the master. The patch switches the identify order so that we can do the drive side detection correctly. [NOTE: patch and description extracted from a larger work written and signed-off-by Alan Cox] Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-02libata-core: Fix simplex handlingAlan
The initial simplex handling code is fooled if you suspend and resume. This also causes problems with some single channel controllers which claim to be simplex. The fix is fairly simple, instead of keeping a flag to remember if we gave away the simplex channel we remember the actual owner. As the owner is always part of the host_set we don't even need a refcount. Knowing the owner also means we can reassign simplex DMA channels in future hotplug code etc if we need to Signed-off-by: Alan Cox <alan@redhat.com> (and a signed-off for the patch I sent before while I remember) Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-01ahci: improve spurious SDB FIS handlingTejun Heo
Spurious SDB FIS during NCQ might not contain spurious completions. It could be spurious TF update or invalid async notification. Treat as HSM violation iff a spurious SDB FIS contains spurious completions; otherwise, just whine once about it. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-01ahci/pata_jmicron: match class not function numberTejun Heo
Make jmiron_ata quirk update pdev->class after programming the device and update ahci and pata_jmicron such that they match class code instead of checking function number manually. For ahci, it matches for vendor and class. For pata_jmicron, it matches vendor, device and class as IDE class isn't as well defined as AHCI class. This makes jmicron device matching more conventional and script friendly. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-01pata_jmicron: drop unnecessary device programming in [re]initTejun Heo
Channel redirect and AHCI mode enable programmings are done via PCI quirk for both probe and resume paths. Drop duplicate and possibly unsafe device programming from pata_jmicron(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-01libata: blacklist FUJITSU MHT2060BH for NCQTejun Heo
Blacklist FUJITSU MHT2060BH for NCQ. On this drive, NCQ works iff queue depth is equal to or less than 4. Just turn it off. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Mike Accetta <maccetta@laurelnetworks.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-01sata_sil24: kill unused local variable idx in sil24_fill_sg()Tejun Heo
Kill unused local variable idx in sil24_fill_sg(). Spotted by Jeff Garzik. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-03-01libata: clear drvdata in ata_host_release(), take#2Tejun Heo
Clearing drvdata in ->remove_one causes NULL pointer deference. Clear drvdata only in ata_host_release() after all resources are freed. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-26[libata] bump versionsJeff Garzik
Bump versions based on changes submitted during 2.6.21 merge window. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-26[libata] Trim trailing whitespace.Jeff Garzik
No code changes. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-26[libata] sata_mv: Fix 50xx irq maskJeff Garzik
IRQ mask bits assumed a 60xx or newer generation chip, which is very wrong for the 50xx series. Luckily both generations shared the per-port interrupt mask bits, leaving only the "misc chip features" bits to be completely mismatched. Fix 50xx by ensuring we only program bits that exist. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-26[libata] sata_mv: don't touch reserved bits in EDMA config registerJeff Garzik
The code in mv_edma_cfg() reflected its 60xx origins, by doing things [slightly] incorrectly on the older 50xx and newer 6042/7042 chips. Clean up the EDMA configuration setup such that, each chip family carefully initializes its own EDMA setup. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-25libata: Use new id_to_dma_mode function to tidy reporting in more drivers ↵Alan
(minimally tested) Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-25pata_pcmcia: Fix oops in 2.6.21-rc1Alan
Manuel Lass reports: > This bug is also present in 2.6.21-rc1, and this patch > indeed fixes it. The change to the devres layer re-orders the execution of cleanup functions and in turn causes the pcmcia layer to oops as it zaps a pointer now needed later on. We simply leave the pointer alone. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-25Add id_to_dma_mode function for printing DMA modesAlan
Also export dev_disable as this is needed by drivers doing slave decode filtering, which will follow shortly Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-25sata_promise: simplify port setupMikael Pettersson
Each place in pdc_ata_init_one() that initialises a SATA port first calls pdc_ata_setup_port(), and then manually assigns the port's ->scr_addr. Simplify the code by extending pdc_ata_setup_port() to also handle scr_addr initialisation; for PATA ports we pass NULL as scr_addr. The initialisation of the PATA-only 20619 redundantly set up scr_addr for the ports. Remove this. Tested on 20619, 20575, and 20775 chips. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-25sata_promise: fix 20619 new EH merge errorMikael Pettersson
When I merged my 20619 new EH conversion with #libata-upstream I had to manually resolve a conflict, and inadvertently lost pdc_pata_ops' ->post_internal_cmd binding. Corrected by this patch. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-24[libata] ACPI: remove needless ->qc_issue hook existence testJeff Garzik
All drivers must implement this hook, otherwise ATA commands would go nowhere (and a lot of other oopsen would appear as well). Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-24sata_vsc: refactor vsc_sata_interrupt and hook up error handlingDan Williams
Separate sata_vsc interrupt handling into a normal (per-port) path and an error path with the addition of vsc_port_intr and vsc_error_intr respectively. The error path handles interrupt based hotplug events which requires the definition of vsc_freeze and vsc_thaw. Note: vsc_port_intr has a workaround for unexpected interrupts that occur during polled commands. This fixes a regression between 2.6.19 and 2.6.20. Changes in take2: * removed definition of invalid fis bit * let standard ata-error-handling handle the serror register * clear all unhandled interrupts * revert changes to vsc_intr_mask_update (vsc_thaw enables all interrupts) * use unlikely() for the pci-abort and not-our-interrupt cases in vsc_sata_interrupt Changes in take3: * Unify the "add" + "hook-up" patches into this single patch [htejun@gmail.com: clean up comments and suggestions] Cc: Jeremy Higdon <jeremy@sgi.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-24sata_sil: ignore and clear spurious IRQs while executing commands by pollingTejun Heo
sata_sil used to trigger HSM error if IRQ occurs during polling command. This didn't matter because polling wasn't used in sata_sil. However, as of 2.6.20, all IDENTIFYs are performed by polling and device detection sometimes fails due to spurious IRQ. This patch makes sata_sil ignore and clear spurious IRQ while executing commands by polling. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-24sata_mv: fix pci_enable_msi() error handlingTejun Heo
intx should be turned on when pci_enable_msi() fails not when it succeeds. Fix it. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-24pata_amd: fix an obvious bug in cable detectionTejun Heo
80c test mask is at bits 18 and 19 of EIDE Controller Configuration not 22 and 23. Fix it. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-23[libata] ata_piix: remove duplicate PCI IDsJeff Garzik
Duplicate ids noticed by Kay Sievers <kay.sievers@suse.de> Although 100% different, this is based on a patch by Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-23sata_nv: complain on spurious completion notifiersRobert Hancock
Recently Tejun wrote a patch to ahci.c to make it raise a HSM violation if the drive attempted to complete a tag that wasn't outstanding. We could run into the same problem with sata_nv ADMA. This adds code to raise a HSM violation error if the controller gives us a notifier tag that isn't outstanding, since the drive may be issuing spurious completions. Signed-off-by: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-23sata_nv: kill old private BMDMA helper functionsRobert Hancock
sata_nv implemented its own copies of the BMDMA helper functions for ADMA, since the ADMA BMDMA status registers are PIO while the other registers are MMIO, and this was the only way to handle this previously. Now that we have iomap support, the standard routines should just work, so use them. The only thing we need to override as far as ADMA and BMDMA is the post_internal_cmd callback, where we should only call ata_post_internal_cmd if we are in port-register mode. Signed-off-by: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-23libata: fix remaining ap->idTejun Heo
Merge order left libata-acpi and pata_scc with remainling usage of ap->id. Kill superflous id printing and substitute the remaining ones with ap->print_id. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-23ahci: consider SDB FIS containing spurious NCQ completions HSM violation ↵Tejun Heo
(regenerated) SDB FIS containing spurious NCQ completions is a clear protocol violation. Currently, only some Maxtors with early firmware revisions are showing this problem. Those firmwares have other NCQ related problems including buggy NCQ error reporting and occasional lock up after NCQ errors. Consider spurious NCQ completions HSM violation and freeze the port after it. EH will turn off NCQ after this happens several times. Eventually drives which show this behavior should be blacklisted for NCQ. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21pata_sl82c105: remove un-needed code pathsAlan
Remove the DMA setup function. As pointed out by Sergey we set the actual DMA clock timing in set_dmamode so we don't actually need to do anything with it at set up time, but just leave the PIO timings loaded. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21pata_sil680: Assorted fixesAlan
Correct iordy handling and DMA bit flag handling. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21pata_oldpiix: Call both PIO and DMA setup functions on switch as they are ↵Alan
called on set up Keeps the behaviour consistent and easier to understand. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21pata_ixp4xx: Fix up set_mode() function and display Configured for PIO infoAlan
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21pata_cs5520: suspend/resumeAlan
The CS5520 isn't just an ATA controller and we must not pci_disable_device it as it turns into pci_disable_computer. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21pata: Display Configuring .. lines for devices with private set_mode methodsAlan
We can't specify which mode in the cases below but we can at least say PIO and look consistent with the default. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21libata: s/ap->id/ap->print_id/gTejun Heo
ata_port has two different id fields - id and port_no. id is system-wide 1-based unique id for the port while port_no is 0-based host-wide port number. The former is primarily used to identify the ATA port to the user in printk messages while the latter is used in various places in libata core and LLDs to index the port inside the host. The two fields feel quite similar and sometimes ap->id is used in place of ap->port_no, which is very difficult to spot. This patch renames ap->id to ap->print_id to reduce the possibility of such bugs. Some printk messages are adjusted such that id string (ata%u[.%u]) isn't printed twice and/or to use ata_*_printk() instead of hardcoded id format. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21sata_nv: enable hotplug interrupt and fix some readl/readw mismatchesRobert Hancock
We already have code that handles hotplug interrupt indications in ADMA mode, this turns on the control flag that actually enables these interrupts. Also fixes some cases in the same functions where a 16-bit register was read using a readl instead of a readw. Signed-off-by: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21sata_nv: Use notifier for completion checksRobert Hancock
The hardware provides us a notifier register that indicates what command tags have completed. Use this to determine which CPBs to check, rather than blindly checking all active CPBs. This should provide a minor performance win, since if the controller has touched some of these incomplete CPBs, accessing them will likely result in a cache miss. Signed-off-by: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21sata_nv: Cleanup taskfile setupRobert Hancock
This edits the taskfile setup to more closely match the way that libata sends the taskfile for other controllers. This avoids putting taskfile writes into the CPB buffer that are not needed according to the taskfile flags. Signed-off-by: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21sata_nv: cleanup CPB and APRD initializationRobert Hancock
Clean up the initialization of the CPB and APRD structures so that we strictly follow the rules for ordering of writes to the CPB flags and response flags, and prevent duplicate initialization. Signed-off-by: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21sata_nv: Add CPB register info to error_handler outputRobert Hancock
When error handling occurs with pending commands, output the contents of the next CPB count and next CPB index registers as well as the others, since these may be useful for debugging. Signed-off-by: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21libata: Remove duplicate dma blacklist entryMagnus Damm
libata: Remove duplicate dma blacklist entry The exact same entry is already present. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21pata_pcmcia: Update device tableMagnus Damm
pata_pcmcia: Update device table Add CFA devices from I-O Data, Mitsubishi and Viking. Add SanDisk comment. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21sata_via: fix resource-managed iomap conversionTejun Heo
Conversion to resource-managed iomap was buggy causing init failures on both vt6420 and 6421 - BAR5 wasn't mapped for both controllers while on vt6420 sata_via tried to map BAR0-4 twice. Fix it. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21libata: fix ata_scsi_change_queue_depth()Tejun Heo
Fix ata_scsi_change_queue_depth() such that... * NCQ on/off is exactly determined using the same logic as the issue path. * queue depth is adjusted to 1 if NCQ is not enabled. * -EINVAL is returned if requested action is ignored due to limitations. This fixes the bug which allows queue depth to be increased on blacklisted NCQ hosts/devices. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21libata: fix ata_scmd_need_defer()Tejun Heo
Fix ata_scmd_need_defer() such that... * whether NCQ is used or not is exactly determined using the same criteria as the issue path. * defer-check is performed in all cases. This fixes race condition where turning off NCQ on the fly causes non-NCQ commands sneak into NCQ phase. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-02-21libata: separate out ata_ncq_enabled()Tejun Heo
Separate out ata_ncq_enabled(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>