aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2007-04-28libata: separate out ata_host_start()Tejun Heo2-13/+63
Separate out ata_host_start() from ata_device_add(). ata_host_start() calls ->port_start on each port if available and freezes the port. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28libata: allocate ap separately from shostTejun Heo2-6/+15
Don't embed ap inside shost. Allocate it separately and point it back from shosts's hostdata. This makes port allocation more flexible and allows regular ATA and SAS share host alloc/init paths. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28ahci: add PCI ID for new VIA chipTejun Heo1-0/+1
Add PCI ID for new VIA chip. Original patch is from Maarten Vanraes. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Maarten Vanraes <maarten.vanraes@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28libata: kill type mismatch compile warningTejun Heo1-1/+2
kill the following compile warning. drivers/ata/libata-core.c:1786: warning: comparison of distinct pointer types lacks a cast Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28ahci.c: remove non-existing SB600 raid id (re-send)Conke Hu2-3/+1
SB600 RAID and SB600 SATA is the same controller and share the same PCI ID 0x4380. There is no such PCI ID 0x4381. Signed-off-by: Conke Hu <conke.hu@gmail.com> --------- Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28libata: improve AC_ERR_DEV handling for ->post_internal_cmdTejun Heo6-20/+17
->post_internal_cmd is simplified EH for internal commands. Its primary mission is to stop the controller such that no rogue memory access or other activities occur after the internal command is released. It may provide error diagnostics by setting qc->err_mask but this hasn't been a requirement. To ignore SETXFER failure for CFA devices, libata needs to know whether a command was failed by the device or for any other reason. ie. internal command needs to get AC_ERR_DEV right. This patch makes the following changes to AC_ERR_DEV handling and ->post_internal_cmd semantics to accomodate this need and simplify callback implementation. 1. As long as the correct bits in the result TF registers are set, there is no need to set AC_ERR_DEV explicitly. libata EH core takes care of that for both normal and internal commands. 2. The only requirement for ->post_internal_cmd() is to put the controller into quiescent state. It needs not to set any err_mask. 3. ata_exec_internal_sg() performs minimal error analysis such that AC_ERR_DEV is automatically set as long as result_tf is filled correctly. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28libata: fix native mode disabled port handlingTejun Heo1-27/+35
Disabled port handling in ata_pci_init_native_mode() is slightly broken in that it may end up using the wrong port_info. This patch updates it such that disables ports are made dummy as done in the legacy and other cases. While at it, fix indentation in ata_resources_present(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28ahci: move port_map handling to ahci_save_initial_config()Tejun Heo1-27/+30
Move cross checking between port_map and cap.n_ports into ahci_save_initial_config(). After save_initial_config is done, hpriv->port_map is always setup properly. Tested on JMB363, ICH7 and ICH8 (with dummy ports). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28ahci: implement ata_save/restore_initial_config()Tejun Heo1-23/+72
There are several registers which describe how the controller is configured. These registers are sometimes implemented as r/w registers which are configured by firmware and get cleared on controller reset or after suspend/resume cycle. ahci saved and restored those values inside ahci_reset_controller() which is a bit messy and doesn't work over suspend/resume cycle. This patch implements ahci_save/restore_initial_config(). The save function is called during driver initialization and saves cap and port_map to hpriv. The restore function is called after the controller is reset to restore the initial values. Sometimes the initial firmware values are inconsistent and need to be fixed up. This is handled by ahci_save_initial_config(). For this, there are two versions of saved registers. One to write back to the hardware register, the other to use during driver operation. This is necessary to keep ahci's behavior unchanged (write back fixed up port_map while keeping cap as-is). This patch makes ahci save the register values once before the first controller reset, not after it's been reset. Also, the same stored values are used written back after each reset, so the register values are properly recovered after suspend/resume cycle. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28sata_promise: fix error decode regressionMikael Pettersson1-3/+6
Promise ATA ports should always be reset by pdc_reset_port() when errors are detected, but the recent error reason decoding update to sata_promise replaced that reset with a freeze. This patch changes the error detection to do a reset again. This makes the error decoding update safer, as it now only adds error decoding without changing any other behaviour. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_pdc2027x: UpdatesAlan Cox1-13/+47
Signed-off-by: Alan Cox <alan@redhat.com> Correct missing modefilter (crash if BAR4 unassigned) Use Cable Detect method Wrap ->set_mode instead ready for ->post_set_mode removal Maxtor errata as per Jeff Garzik report Remove duplicated private udma_mask hacking Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_winbondAlan Cox1-1/+0
Not a PCI device so doesn't need PCI includes Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata: cable methodsAlan Cox6-153/+67
Versus upstream as requested Last of the trivial switches to cable_detect methods. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28libata: add support for READ/WRITE LONGMark Lord4-10/+30
The READ/WRITE LONG commands are theoretically obsolete, but the majority of drives in existance still implement them. The WRITE_LONG and WRITE_LONG_ONCE commands are of particular interest for fault injection testing -- eg. creating "media errors" at specific locations on a disk. The fussy bit is that these commands require a non-standard sector size, usually 520 bytes instead of 512. This patch adds support to libata for READ/WRITE LONG commands issued via SG_IO/ATA_16. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28Add notation that the Asus W5F laptop has a short cable instead of 80-wire.Robin H\. Johnson1-0/+1
The Asus W5F laptop uses a short cable instead of the 80-wire style, and thus needs to be in the ich_laptop special cases for correct detection and support of UDMA/100 for the hard drive. I noticed this because I have the W5F laptop, and was tracing apparent slowness. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_optidma: rework for cable detect and to remove post_set_mode()Alan Cox1-25/+29
A lot of noise because I had to rename the optidma_set_mode() method to avoid confusion with the new ->set_mode() method that was added. Cable detect side is pretty trivial. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_winbond: restore cable methodAlan Cox1-0/+1
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_sl82c105: restore cable detect methodAlan Cox1-1/+1
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_netcell: re-remove all the crudAlan Cox1-28/+3
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_qdI: restore cable detectAlan Cox1-0/+2
Signed-off-by: Alan Cox <number6@the-village.bc.nu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_ali: remove all the crap again and switch to cable_detect methodAlan Cox1-59/+9
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28sata_nv: don't read shadow registers when in ADMA modeRobert Hancock1-13/+20
Reading from the ATA shadow registers while we are in ADMA mode may cause undefined behavior. Don't read the ATA status register when completing commands for this reason, it shouldn't be needed as the controller will notify us if the command failed. Also, don't allow commands with result taskfile requested to execute in ADMA mode, since that requires accessing the shadow registers. We also still need to override tf_read since libata will read the result taskfile on a command failure, and we need to go into port register mode before allowing this. Signed-off-by: Robert Hancock <hancockr@shaw.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pcmcia - spot slave decode flaws (for testing)Alan1-0/+34
It tries to spot when the slave is a mirror of the master and to fix up problems that causes. I've got two confirmations so far that this plus the "can fail set_xfer" patch work for folks who had problems before. Also if you are unfortunate enough to be running something like HAL then it'll automount the same disk twice for you and corrupt it without the fix (aint that nice...) Tested (successfully) by Komuro <komurojun-mbn@nifty.com>. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28git-libata-all-ipr-fixAndrew Morton1-1/+2
drivers/scsi/ipr.c: In function '__ipr_eh_dev_reset': drivers/scsi/ipr.c:3865: warning: passing argument 4 of 'ata_do_eh' from incompatible pointer type 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>
2007-04-28libata: hardreset on SERR_INTERNALTejun Heo1-1/+1
There was a rare report where SB600 reported SERR_INTERNAL and SRST couldn't get it out of the failure mode. Hardreset on SERR_INTERNAL. As the problem is intermittent, whether this fixes the problem or not hasn't been verified yet, but hardresetting the channel on internal error is a good idea anyway. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28sata_promise: decode and report error reasonsMikael Pettersson1-9/+55
This patch adds much needed error reason decoding and reporting to sata_promise. It's simplistic but should log all relevant error info the controller provides. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28sata_promise: separate SATA and PATA opsMikael Pettersson1-41/+66
This patch changes sata_promise so that the PATA ports on TX2plus chips are bound to the pdc_pata_ops structure. This means that operations called from the SATA ops structures don't need any SATA-vs-PATA tests any more. Instead, operations that depend on a port being SATA or PATA are separated into different procedures. * pdc_cable_type() is split into a PATA version and a SATA version * pdc_error_handler() is split into a PATA version and a SATA version, that both call a common version after setting up the `hardreset' function pointer * pdc_old_check_atapi_dma() is now only used for SATAI ports, so is renamed to pdc_old_sata_check_atapi_dma() and simplified * pdc_sata_scr_{read,write}() are now only used for SATA ports, so their is-not-SATA tests are removed * pdc_port_start() is split into three procedures: a wrapper which performs the ->ops adjustment on TX2plus PATA ports, a procedure with the common code, and a procedure with the SATA-specific code (this bit might be cleaned up by Tejun's new init model) 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-04-28sata_promise: add missing cable_detect hooksMikael Pettersson1-1/+3
The recent change which moved cable detection from pdc_pre_reset() to the new ->cable_detect hook only added the hook for SATAII chips, leaving SATAI chips and the 20619 without the hook. Fixed by this patch. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28libata/IDE: remove combined mode quirkJeff Garzik8-173/+6
Both old-IDE and libata should be able handle all controllers and devices found using normal resource reservation methods. This eliminates the awful, low-performing split-driver configuration where old-IDE drove the PATA portion of a PCI device, in PIO-only mode, and libata drove the SATA portion of the /same/ PCI device, in DMA mode. Typically vendors would ship SATA hard drive / PATA optical configuration, which would lend itself to slow (PIO-only) CD-ROM performance. For Intel users running in combined mode, it is now wholly dependent on your driver choice (potentially link order, if you compile both drivers in) whether old-IDE or libata will drive your hardware. In either case, you will get full performance from both SATA and PATA ports now, without having to pass a kernel command line parameter. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28[libata] turn on !IORDY filterJeff Garzik1-0/+3
The previous commit erroneously noted that the !IORDY filter was turned on. No true, that change was split out into this commit. Originally authored and signed-off-by Alan Cox. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28[libata] sata_mv: support ->cable_detectJeff Garzik1-1/+3
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28libata: Change prototype of mode_filter to remove ata_port*Alan Cox7-22/+20
With Tejun having added adev->ap some time ago we can get rid of the almost unused port being passed to mode filters. And while we are doing filters, lets turn on the !IORDY filter as well. Signed-off-by: Alan Cox <alan@redhat.com> With some hand massaging from Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28sata_sil: First step to removing ->post_set_modeAlan Cox1-4/+19
Now that we have ata_do_set_mode() available for drivers to use we don't actually need ->post_set_mode() as the driver can wrap set_mode nicely and do stuff before or after (eg PCMCIA needs before), so we can kill off a method in all the structs While I was at it I added kernel-doc to the function involved. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28libata-core: Fix the iordy methodsAlan Cox1-11/+25
This alone isn't sufficient to save the universe from prehistoric disks and controllers but it is a first important step. Split off a separate function to provide a mode filter when controller iordy is not available. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata: expose set_mode method so it can be wrappedAlan2-7/+31
This splits set_mode into do_set_mode and the wrapper so that a driver can call the standard method inside its own. This in theory also obsoletes ->post_set_mode(). Signed-off-by: Alan Cox <alan@redhat.com> Cc: Jeff Garzik <jeff@garzik.org> Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_hpt37x: Updates from drivers/ide workAlan Cox1-212/+146
Drag pata_hpt37x kicking and screaming in the direction of drivers/ide/pci/hpt366.c and all the work that Sergei has been doing there. Plenty left to be done but this is a good snapshot for folks to work on and to review Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28iomap: implement pcim_iounmap_regions()Tejun Heo2-0/+27
Implement pcim_iounmap_regions() - the opposite of pcim_iomap_regions(). Signed-off-by: Tejun heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28[libata] More PATA driver ->cable_detect supportJeff Garzik8-79/+42
Roll-up of ->cable_detect feature addition patches, authored and signed-off-by Alan Cox. Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_hpt366: support ->cable_detectAlan Cox1-8/+13
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_efar: support ->cable_detectAlan Cox1-9/+22
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_atiixp: support ->cable_detectAlan Cox1-10/+16
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_radisys: support cable_detectAlan Cox1-32/+5
Signed-off-by: Alan Cox <number6@the-village.bc.nu> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_sc1200: restore cable typeAlan Cox1-0/+1
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_rz1000: support cable_detectAlan Cox1-26/+2
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_platform: Add cable_detect methodAlan Cox1-0/+1
Signed-off-by: Alan Cox <number6@the-village.bc.nu> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28sata_promise: Switch to cable method, clean up some bits as a resultAlan Cox1-18/+12
Signed-off-by: Alan Cox <number6@the-village.bc.nu> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28libata-core: fix comments on cable typeAlan Cox1-4/+4
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28libata: Restore Kconfig updated experimental levels and correctAlan Cox1-14/+14
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_cmd640: Multiple updatesAlan Cox1-14/+20
Fix suspend/resume support Write 0x5B to 0 not 0x5C The former is important as we must kill the FIFO on a resume Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-04-28pata_via: Use cable_detect methodAlan Cox1-15/+12
We end up shifting a few bits of logic around in this driver but the basic change is the same. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>