summaryrefslogtreecommitdiffstats
path: root/drivers/ata
Commit message (Collapse)AuthorAgeFilesLines
...
| * | pata_legacy: Merge winbond supportAlan Cox2008-01-231-34/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This puts winbond VLB in with the other ISA/VLB support and means we can lose pata_winbond.c. With all the VLB/ISA probe in one space (and out of the core libata) this makes legacy probing work sanely. Also switch to devm_ for resource handling on the ports post probe Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | ata_generic: Cenatek supportAlan Cox2008-01-231-1/+6
| | | | | | | | | | | | | | | | | | | | | Not much to do here. It's an ata memory as disk. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | pata_winbond: error returnAlan Cox2008-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | If no device is active return an error not zero. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | pata_serverworks: Fix cable types and cosmeticsAlan Cox2008-01-231-5/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Minor tidying up. Only real change is to return UNK not 80 wire when we don't know the cable type. This didn't use to matter but with Tejun's reworking of cable detection it may. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | pata_mpc52xx: remove un-needed assignmentAlan Cox2008-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | ata_irq is always assigned so does not need to be initialised to zero. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: fix off-by-one in error categorizationTejun Heo2008-01-231-7/+6Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ATA_ECAT_DUBIOUS_BASE was too high by one and thus all DUBIOUS error categorizations were wrong. This passed test because only ATA_BUS and UNK_DEV were used during testing and the ones after them - ATA_BUS and an overflowed entry - behaved similarly. This patch fixes the problem by adding DUBIOUS_NONE category and use it as base. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | ahci: factor out AHCI enabling and enable AHCI before reading CAPTejun Heo2008-01-231-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out AHCI enabling into ahci_enable_ahci() and enabling AHCI before reading CAP in ahci_save_initial_config() as the spec requires enabling AHCI mode before accessing any other registers. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | ata_piix: implement SIDPR SCR accessTejun Heo2008-01-231-4/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For ICH8, SCRs can be accessed using index and data register pair located at BAR 5. This patch implements support for it such that PHY status, errors and hardreset are available for those controllers. This is the only case where two devices on a PATA channel have access to SCRs and creates a unique problem of mapping two SCRs to one link. Note that this is different from PMP case in that they aren't quite separate links - e.g. softreset resets both devices. This problem is worked around by merging the SCR values. To upper layer, it looks like there is a single link with one set of SCRs but with two devices. This works well enough for PHY event, error reporting and hardreset. Supporting hardreset is important because in rare cases SATA devices fail to recover without it after PHY errors. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | ata_piix: convert to prepare - activate initializationTejun Heo2008-01-231-42/+37Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ata_piix requires more configuration during initialization than most other SFF compliant controllers and one-go initialzation with ata_pci_one() is too rigid. This patch converts ata_piix to use two step prepare - activate initialization used by other more advanced controllers. This conversion brings the happy side effect of enabling PCI device before accessing PCI configuration registers. Other than that, there shouldn't be any behavior change. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: factor out ata_pci_activate_sff_host() from ata_pci_one()Tejun Heo2008-01-232-84/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Factor out ata_pci_activate_sff_host() from ata_pci_one(). This does about the same thing as ata_host_activate() but needs to be separate because SFF controllers use different and multiple IRQs in legacy mode. This will be used to make SFF LLD initialization more flexible. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | [libata] Prefer SCSI_SENSE_BUFFERSIZE to sizeof()akpm@linux-foundation.org2008-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | pata_legacy: resychronize with upstream changes and resubmitAlan Cox2008-01-231-145/+605
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update the legacy driver so it can handle VLB ports nicely, and has an internal structure for nailing new ISA/VLB forms in. Anyone got an ALI14xx and a spare day ;) Also adds an "all" parameter so you can load this driver after all the PCI ones in a boot time kernel and tell it to grab anything ST412 compatible even if it is an unknown PCI device. That allows libata to offer the same "just get me a disk somehow" fallback that old IDE did. Obsoletes pata_qdi. Signed-off-by: Alan Cox <alan@redhat.com> Cc: Tejun Heo <htejun@gmail.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | [libata] pata_legacy: typo fixAndrew Morton2008-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | Cc: Jeff Garzik <jeff@garzik.org> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | [libata] pata_winbond: update for new ->data_xfer hookAndrew Morton2008-01-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/spi/Kconfig:156:warning: 'select' used by config symbol 'SPI_PXA2XX' refers to undefined symbol 'PXA_SSP' drivers/ata/pata_winbond.c: In function 'winbond_data_xfer': drivers/ata/pata_winbond.c:109: error: 'read' undeclared (first use in this function) drivers/ata/pata_winbond.c:109: error: (Each undeclared identifier is reported only once drivers/ata/pata_winbond.c:109: error: for each function it appears in.) drivers/ata/pata_winbond.c:123: warning: 'return' with a value, in function returning void drivers/ata/pata_winbond.c: At top level: drivers/ata/pata_winbond.c:162: warning: initialization from incompatible pointer type distcc[29718] ERROR: compile drivers/ata/pata_winbond.c on bix/8 failed make[1]: *** [drivers/ata/pata_winbond.o] Error 1 make: *** [drivers/ata/pata_winbond.o] Error 2 Cc: Jeff Garzik <jeff@garzik.org> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | pata_pcmcia: convert to new data_xfer prototypeTejun Heo2008-01-231-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | While merging data_xfer prototype change, pata_pcmcia was left out. Convert it. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata annotations and fixesAl Viro2008-01-237-19/+20
| | | | | | | | | | | | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: use dev_driver_string() instead of "libata" in libata-sff.cTejun Heo2008-01-231-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | libata-sff code used DRV_NAME which is hardcoded to "libata" when requesting resources. Use dev_driver_string() such that low level driver names are used in resource listing. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | ata_piix: kill unused constants and flagsTejun Heo2008-01-231-20/+7Star
| | | | | | | | | | | | | | | | | | | | | | | | Kill PIIX_FLAG_SCR, PIIX_PORT_ENABLED and PIIX_PORT_PRESENT. These are unused. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: make ata_port_queue_task() an internal functionJeff Garzik2008-01-231-13/+11Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | ata_port_queue_task() served a single user: ata_pio_task() Rename to ata_pio_queue_task() and un-export it, as nobody outside of libata-core.c uses it. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
| * | pata_pcmcia: Minor cleanups and support for dual channel cardsAlan Cox2008-01-231-14/+17
| | | | | | | | | | | | | | | Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata/pata_it821x: Improve handling of poorly compatible emulationsAlan Cox2008-01-232-18/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some it821x RAID firmwares return 0 for the err return off both devices. A similar issue occurs with the slave returning 0 not 1 if you plug a gigabyte sata ramdisk into a controller that fakes two SATA ports as master/slave on an SFF channel. The patch does the following - Allow the 'failed diagnostics' case on both master and slave - Move the HORKAGE_DIAGNOSTIC check after ->dev_config This second change also allows IT821x to fix up a problem where we report drive diagnostic failures when in fact the drive is fine but the microcontroller firmware doesn't appear to get it right. IT821x clears the flag again to avoid giving the user bogus warnings about their disk. The other IT821x change is a bit ugly, we slightly abuse the cable type hook to fiddle with the identify data for the devices. We could add a new hook for this but as we have only one offender and no more seeming likely it seems better to keep libata-core clean. Please let this sit in -mm briefly, just in case the relaxed checking breaks some other emulated interface. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
| * | pata_pcmcia: Add support for dumb 8bit IDE emulationsAlan Cox2008-01-231-1/+70
| | | | | | | | | | | | | | | Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
| * | libata: make qc->nbytes include extra buffersTejun Heo2008-01-231-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qc->nbytes didn't use to include extra buffers setup by libata core layer and my be odd. This patch makes qc->nbytes include any extra buffers setup by libata core layer and guaranteed to be aligned on 4 byte boundary. This value is to be used to program the host controller. As this represents the actual length of buffer available to the controller and the controller must be able to deal with short transfers for ATAPI commands which can transfer variable length, this shouldn't break any controllers while making problems like rounding-down and controllers choking up on odd transfer bytes much less likely. The unmodified value is stored in new field qc->raw_nbytes. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: convert to chained sgTejun Heo2008-01-2313-156/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libata used private sg iterator to handle padding sg. Now that sg can be chained, padding can be handled using standard sg ops. Convert to chained sg. * s/qc->__sg/qc->sg/ * s/qc->pad_sgent/qc->extra_sg[]/. Because chaining consumes one sg entry. There need to be two extra sg entries. The renaming is also for future addition of other extra sg entries. * Padding setup is moved into ata_sg_setup_extra() which is organized in a way that future addition of other extra sg entries is easy. * qc->orig_n_elem is unused and removed. * qc->n_elem now contains the number of sg entries that LLDs should map. qc->mapped_n_elem is added to carry the original number of mapped sgs for unmapping. * The last sg of the original sg list is used to chain to extra sg list. The original last sg is pointed to by qc->last_sg and the content is stored in qc->saved_last_sg. It's restored during ata_sg_clean(). * All sg walking code has been updated. Unnecessary assertions and checks for conditions the core layer already guarantees are removed. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: change ATA_QCFLAG_DMAMAP semanticsTejun Heo2008-01-231-8/+7Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ATA_QCFLAG_DMAMAP was a bit peculiar in that it got set during qc initialization and cleared if DMA mapping wasn't necessary. Make it more straight forward by making the following changes. * Don't set it during initialization. Set it after DMA is actually mapped. * Add BUG_ON() to guarantee that there is data to transfer if DMAMAP is set. This always holds for the current code. The BUG_ON() is for docummentation and sanity check. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: kill non-sg DMA interfaceTejun Heo2008-01-231-133/+15Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With atapi_request_sense() converted to use sg, there's no user of non-sg interface. Kill non-sg interface. * ATA_QCFLAG_SINGLE and ATA_QCFLAG_SG are removed. ATA_QCFLAG_DMAMAP is used instead. (this way no LLD change is necessary) * qc->buf_virt is removed. * ata_sg_init_one() and ata_sg_setup_one() are removed. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Rusty Russel <rusty@rustcorp.com.au> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: update ->data_xfer hook for ATAPITejun Heo2008-01-237-97/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on how many bytes are transferred as a unit, PIO data transfer may consume more bytes than requested. Knowing how much data is consumed is necessary to determine how much is left for draining. This patch update ->data_xfer such that it returns the number of consumed bytes. While at it, it also makes the following changes. * s/adev/dev/ * use READ/WRITE constants for rw indication * misc clean ups Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: rename ATA_PROT_ATAPI_* to ATAPI_PROT_*Tejun Heo2008-01-2310-45/+42Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | ATA_PROT_ATAPI_* are ugly and naming schemes between ATA_PROT_* and ATA_PROT_ATAPI_* are inconsistent causing confusion. Rename them to ATAPI_PROT_* and make them consistent with ATA counterpart. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
| * | libata: zero xfer length on ATAPI data xfer IRQ is HSM violationAlbert Lee2008-01-231-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Treat zero xfer length as HSM violation. While at it, add unlikely()'s to ATAPI ireason and transfer length checks. tj: Formatted patch and added unlikely()'s. Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: make atapi_request_sense() use sgTejun Heo2008-01-231-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | atapi_request_sense() is now the only left user of ata_sg_init_one(). Convert it to use sg interface. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Rusty Russel <rusty@rustcorp.com.au> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: convert NCQ test in ata_qc_issue() to ata_is_ncq()Tejun Heo2008-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | I missed one while converting to ata_is_*() protocol test helpers. Convert it. Pointed out by Jeff Garzik. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | pata_hpt37x: checkpatch fixesAndrew Morton2008-01-231-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WARNING: line over 80 characters #70: FILE: drivers/ata/pata_hpt37x.c:850: + struct pci_dev *pdev_0 = pci_get_slot(pdev->bus, pdev->devfn - 1); ERROR: else should follow close brace '}' #78: FILE: drivers/ata/pata_hpt37x.c:858: + } + else total: 1 errors, 1 warnings, 100 lines checked Your patch has style problems, please review. If any of these errors are false positives report them to the maintainer, see CHECKPATCH in MAINTAINERS. Please run checkpatch prior to sending patches Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | drivers/ata/libata-eh.c: fix printk warningAndrew Morton2008-01-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | drivers/ata/libata-eh.c: In function `ata_port_pbar_desc': drivers/ata/libata-eh.c:215: warning: long long unsigned int format, long unsigned int arg (arg 4) Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | pata_amd: update mode selection for NV PATAsTejun Heo2008-01-231-36/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cable detection on NV PATA hosts isn't implemented and the CBLID- cable isn't wired according to the sepc either, so both host-side and generic drive-side cable detections are broken. Till now, nv_cable_detect() relied on peeking BIOS and ACPI configurations to upgrade to 80C but this often results in misdetection of 40C cable as 80C. Also, the original implementation was broken in that by the time BIOS configuration is read it has already been cleared by programming PIO0 during reset. This patch reimplements NV mode selection such that... * BIOS configuration value is stored during driver attach and restored on detach. * Cable type is fixed to ATA_CBL_PATA_IGN and mode selection is soley done by nv_mode_filter() which peeks both BIOS and ACPI configurations and filter accordingly. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: reimplement ata_acpi_cbl_80wire() using ata_acpi_gtm_xfermask()Tejun Heo2008-01-233-27/+20Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reimplement ata_acpi_cbl_80wire() using ata_acpi_gtm_xfermask() and while at it relocate the function below ata_acpi_gtm_xfermask(). New ata_acpi_cbl_80wire() implementation takes @gtm, in both pata_via and pata_amd, use the initial GTM value. Both are trying to peek initial BIOS configuration, so using initial caching value makes sense. This fixes ACPI part of cable detection in pata_amd which previously always returned 0 because configuring PIO0 during reset clears DMA configuration. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: implement ata_timing_cycle2mode() and use it in libata-acpi and ↵Tejun Heo2008-01-233-53/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pata_acpi libata-acpi is using separate timing tables for transfer modes although libata-core has the complete ata_timing table. Implement ata_timing_cycle2mode() to look for matching mode given transfer type and cycle duration and use it in libata-acpi and pata_acpi to replace private timing tables. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: fix ata_acpi_gtm_xfermask()Tejun Heo2008-01-231-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ata_acpi_gtm_xfermask() as separated out from pacpi_discover_modes() has various bugs. Fix them. * The wrong comparison operator is used when finding for matching cycle resulting totally bogus result. * With the comparion operator fixed, boundary condtion handling is clumsy. * Setting of any DMA mask bit set all bits in PIO mask. * MWDMA and UDMA blocks are swapped. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: separate out ata_acpi_gtm_xfermask() from pacpi_discover_modes()Tejun Heo2008-01-232-55/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Finding out matching transfer mode from ACPI GTM values is useful for other purposes too. Separate out the function and timing tables from pata_acpi::pacpi_discover_modes(). Other than checking shared-configuration bit after doing ata_acpi_gtm() in pacpi_discover_modes() which should be safe, this patch doesn't introduce any behavior change. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | ata_piix: separate controller IDs into separate enumTejun Heo2008-01-231-16/+18
| | | | | | | | | | | | | | | | | | | | | Separate controller IDs into a separate enum as Jeff requested. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | sata_promise: make pdc_atapi_pkt() use values from qc->tfTejun Heo2008-01-231-21/+13Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make pdc_atapi_pkt() use values from qc->tf instead of creating its own. This is to ease future ATAPI handling changes. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: add ATA_CBL_PATA_IGNTejun Heo2008-01-231-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ATA_CBL_PATA_UNK indicates that the cable type can't be determined from the host side and might be either 80c or 40c. libata applies drive or other generic limit in this case. However, there are controllers where both host and drive side detections are misimplemented and the driver has to rely solely on private method - peeking BIOS or ACPI configuration or using some other private mechanism. This patch adds ATA_CBL_PATA_IGN which tells libata to ignore the cable type completely and just let the LLD determine the transfer mode via host transfer mode masks and ->mode_filter(). Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: xfer_mask is unsigned long not unsigned intTejun Heo2008-01-231-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | Jeff says xfer_mask is unsigned long not unsigned int. Convert all xfermask fields and handling functions to deal with unsigned longs. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: kill ata_id_to_dma_mode()Tejun Heo2008-01-232-44/+16Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ata_id_to_dma_mode() isn't quite generic. The function is basically privately implemented ata_id_xfermask() combined with hardcoded mode printing and configuration which are specific to ata_generic. Kill the function and open code it in generic_set_mode() using generic xfermode handling functions. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: clean up xfermode / PATA timing related stuffTejun Heo2008-01-231-42/+40Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * s/ATA_BITS_(PIO|MWDMA|UDMA)/ATA_NR_\1_MODES/g * Consistently use 0xff to indicate invalid transfer mode (0x00 is valid for PIO_SLOW). * Make ata_xfer_mode2mask() return proper mode mask instead of just the highest bit. * Sort ata_timing table in increasing xfermode order and update ata_timing_find_mode() accordingly. This patch doesn't introduce any behavior change. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: export xfermode / PATA timing related functionsTejun Heo2008-01-231-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Export the following xfermode related functions. * ata_pack_xfermask() * ata_unpack_xfermask() * ata_xfer_mask2mode() * ata_xfer_mode2mask() * ata_xfer_mode2shift() * ata_mode_string() * ata_id_xfermask() * ata_timing_find_mode() These functions will be used later by LLD updates. While at it, change unsigned short @speed to u8 @xfer_mode in ata_timing_find_mode() for consistency. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | ata_generic: unindent loop in generic_set_mode()Tejun Heo2008-01-231-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | Unindent loop body in generic_set_mode(). This is to ease future change. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | [libata] Build fix WRT ata_is_xxx() new API introductionJeff Garzik2008-01-231-1/+1
| | | | | | | | | | | | Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
| * | libata: implement fast speed down for unverified data transfer modeTejun Heo2008-01-231-14/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's very likely that the configured data transfer mode is the wrong one if device fails data transfers right after initial data transfer mode configuration (including NCQ on/off and xfermode). libata EH needs to speed down fast before upper layers give up on probing. This patch implement fast speed down rules to handle such cases better. Error occured while data transfer hasn't been verified trigger fast back-to-back speed down actions until data transfer works. This change will make cable mis-detection and other initial configuration problems corrected before partition scanning code gives up. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: implement ATA_DFLAG_DUBIOUS_XFERTejun Heo2008-01-232-2/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ATA_DFLAG_DUBIOUS_XFER is set whenever data transfer speed or method changes and gets cleared when data transfer command succeeds in the newly configured transfer mode. This will be used to improve speed down logic. Signed-off-by: Tejun Heo <htejun@gmail.com< Signed-off-by: Jeff Garzik <jeff@garzik.org>
| * | libata: adjust speed down rulesTejun Heo2008-01-231-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Speed down rules were too conservative. Adjust them a bit. * More than 10 timeouts can't happen in 5 minutes as command timeout is 30secs. Lower the limit for rule #1 to 6. * 10 timeouts is too high for rule #3 too. Lower it to 6. * SATAPI can benefit from falling back to PIO too. Allow SATAPI devices to fall back to PIO. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>