aboutsummaryrefslogtreecommitdiff
path: root/drivers/ata
AgeCommit message (Collapse)Author
2008-04-17libata: implement and use ata_noop_irq_clear()Tejun Heo
->irq_clear() is used to clear IRQ bit of a SFF controller and isn't useful for drivers which don't use libata SFF HSM implementation. However, it's a required callback and many drivers implement their own noop version as placeholder. This patch implements ata_noop_irq_clear and use it to replace those custom placeholders. Also, SFF drivers which don't support BMDMA don't need to use ata_bmdma_irq_clear(). It becomes noop if BMDMA address isn't initialized. Convert them to use ata_noop_irq_clear(). Signed-off-by: Tejun Heo <htejun@gmail.com>
2008-04-17libata: PCI device should be powered up before being accessedTejun Heo
PCI device should be powered up or powered up before its PCI regsiters are accessed. Although PCI configuration register access is allowed in D3hot, PCI device is free to reset its status when transiting from D3hot to D0 causing configuration data to change. Many libata SFF drivers which use ata_pci_init_one() read and update configuration registers before calling ata_pci_init_one() which enables the PCI device. Also, in resume paths, some drivers access registers without resuming the PCI device. This patch adds a call to pcim_enable_device() in init path if register is accessed before calling ata_pci_init_one() and make resume paths first resume PCI devices, access PCI configuration regiters then resume ATA host. While at it... * cmd640 was strange in that it set ->resume even when CONFIG_PM is not. This is by-product of minimal build fix. Updated. * In cs5530, Don't BUG() on reinit failure. Just whine and fail resume. Signed-off-by: Tejun Heo <htejun@gmail.com>
2008-04-17libata: kill ata_ehi_schedule_probe()Tejun Heo
ata_ehi_schedule_probe() was created to hide details of link-resuming reset magic. Now that all the softreset workarounds are gone, scheduling probe is very simple - set probe_mask and request RESET. Kill ata_ehi_schedule_probe() and open code it. This also increases consistency as ata_ehi_schedule_probe() couldn't cover individual device probings so they were open-coded even when the helper existed. While at it, define ATA_ALL_DEVICES as mask of all possible devices on a link and always use it when requesting probe on link level for simplicity and consistency. Setting extra bits in the probe_mask doesn't hurt anybody. Signed-off-by: Tejun Heo <htejun@gmail.com>
2008-04-17libata: kill ATA_LFLAG_SKIP_D2H_BSYTejun Heo
Some controllers can't reliably record the initial D2H FIS after SATA link is brought online for whatever reason. Advanced controllers which don't have traditional TF register based interface often have this problem as they don't really have the TF registers to update while the controller and link are being initialized. SKIP_D2H_BSY works around the problem by skipping the wait for device readiness before issuing SRST, so for such controllers libata issues SRST blindly and hopes for the best. Now that libata defaults to hardreset, this workaround is no longer necessary. For controllers which have support for hardreset, SRST is never issued by itself. It is only issued as follow-up SRST for device classification and PMP initialization, so there's no need to wait for it from prereset. Kill ATA_LFLAG_SKIP_D2H_BSY. Signed-off-by: Tejun Heo <htejun@gmail.com>
2008-04-17libata: kill ATA_EHI_RESUME_LINKTejun Heo
ATA_EHI_RESUME_LINK has two functions - promote reset to hardreset if ATA_LFLAG_HRST_TO_RESUME is set and preventing EH from shortcutting reset action when probing is requested. The former is gone now and the latter can easily be achieved by making EH to perform at least one reset if reset is requested, which also makes more sense than depending on RESUME_LINK flag. As ATA_EHI_RESUME_LINK was the only EHI reset modifier, this also kills reset modifier handling. Signed-off-by: Tejun Heo <htejun@gmail.com>
2008-04-17libata: kill ATA_LFLAG_HRST_TO_RESUMETejun Heo
Now that hardreset is the preferred method of resetting, there's no need for ATA_LFLAG_HRST_TO_RESUME flag. Kill it. Signed-off-by: Tejun Heo <htejun@gmail.com>
2008-04-17libata: prefer hardresetTejun Heo
When both soft and hard resets are available, libata preferred softreset till now. The logic behind it was to be softer to devices; however, this doesn't really help much. Rationales for the change: * BIOS may freeze lock certain things during boot and softreset can't unlock those. This by itself is okay but during operation PHY event or other error conditions can trigger hardreset and the device may end up with different configuration. For example, after a hardreset, previously unlockable HPA can be unlocked resulting in different device size and thus revalidation failure. Similar condition can occur during or after resume. * Certain ATAPI devices require hardreset to recover after certain error conditions. On PATA, this is done by issuing the DEVICE RESET command. On SATA, COMRESET has equivalent effect. The problem is that DEVICE RESET needs its own execution protocol. For SFF controllers with bare TF access, it can be easily implemented but more advanced controllers (e.g. ahci and sata_sil24) require specialized implementations. Simply using hardreset solves the problem nicely. * COMRESET initialization sequence is the norm in SATA land and many SATA devices don't work properly if only SRST is used. For example, some PMPs behave this way and libata works around by always issuing hardreset if the host supports PMP. Like the above example, libata has developed a number of mechanisms aiming to promote softreset to hardreset if softreset is not going to work. This approach is time consuming and error prone. Also, note that, dependingon how you read the specs, it could be argued that PMP fan-out ports require COMRESET to start operation. In fact, all the PMPs on the market except one don't work properly if COMRESET is not issued to fan-out ports after PMP reset. * COMRESET is an integral part of SATA connection and any working device should be able to handle COMRESET properly. After all, it's the way to signal hardreset during reboot. This is the most used and recommended (at least by the ahci spec) method of resetting devices. So, this patch makes libata prefer hardreset over softreset by making the following changes. * Rename ATA_EH_RESET_MASK to ATA_EH_RESET and use it whereever ATA_EH_{SOFT|HARD}RESET used to be used. ATA_EH_{SOFT|HARD}RESET is now only used to tell prereset whether soft or hard reset will be issued. * Strip out now unneeded promote-to-hardreset logics from ata_eh_reset(), ata_std_prereset(), sata_pmp_std_prereset() and other places. Signed-off-by: Tejun Heo <htejun@gmail.com>
2008-04-12[libata] make ali_atapi_dma staticAdrian Bunk
This patch makes the needlessly global ali_atapi_dma static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-12[libata] sata_svw: fix reversed port countJeff Garzik
According to Broadcom, two chips have their port counts flipped. The proper count is: 0x241 is 8 ports 0x242 is 4 ports Reported by Yohei Honda on kernel bz 10424. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-04-09ata/sata_fsl: Remove unused variable in sata_fsl_probeJohann Felix Soden
In sata_fsl_probe memory is allocated but never used or deallocated. Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=10404 Thanks to Daniel Marjamäki for the bug report. Reported-by: Daniel Marjamäki <danielm77@spray.se> Signed-off-by: Johann Felix Soden <johfel@users.sourceforge.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-04-09pata_sil680: Fix build on arch/ppcBenjamin Herrenschmidt
Commit 0f436eff54f90419ac1b8accfb3e6e17c4b49a4e breaks build on arch/ppc as it doesn't implement the machine_is() macro. This fixes it by using CONFIG_PPC_MERGE instead which represents arch/powerpc only, while CONFIG_PPC is set for both. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-04-04pata_ali: disable ATAPI DMATejun Heo
ATAPI DMA just doesn't work reliably on pata_ali. The IDE driver can do it but for some mysterious reason, pata_ali can't. This patch disables it by default and makes the driver whine during initialization. "pata_ali.atapi_dma" parameter is added so that user can bypass the workaround. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-04-04libata: ATA_12/16 doesn't fall into ATAPI_MISCTejun Heo
SAT passthrus don't really fit into ATAPI_MISC class. SAT passthru commands always transfer multiple of 512 bytes and variable length response is not allowed. This patch creates a separate category - ATAPI_PASS_THRU - for these. This fixes HSM violation on "hdparm -I". Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-04-04libata: uninline atapi_cmd_type()Tejun Heo
Uninline atapi_cmd_type(). It doesn't really have to be inline and more case will be added which need to access unexported libata variable. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-04-04libata: fix IDENTIFY order in ata_bus_probe()Bartlomiej Zolnierkiewicz
Commit f58229f8060055b08b34008ea08f31de1e2f003c accidentally made ata_bus_probe() not use reverse order probing. Fix it. There currently isn't any PATA driver which uses obsolete ata_bus_probe() path, so this patch is mainly for correctness. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-31[POWERPC] sata_fsl: reduce compatibility to fsl,pq-sataKim Phillips
as prescribed in Documentation/powerpc/booting-without-of.txt. Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Acked-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-03-29libata: ATA_EHI_LPM should be ATA_EH_LPMTejun Heo
EH actions are ATA_EH_* not ATA_EHI_*. Rename ATA_EHI_LPM to ATA_EH_LPM. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-29pata_sil680: only enable MMIO on Cell bladesBenjamin Herrenschmidt
There have been reported regressions of the SIL 680 driver when using MMIO, so this makes it only try MMIO on Cell blades where it's known to be necessary (the host bridge doesn't do PIO on these). We'll try to find the root problem with MMIO separately. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-24[libata] ahci: SB600 workaround is suspect... play it safe for nowJeff Garzik
At least one report claims that a878539ef994787c447a98c2e3ba0fe3dad984ec failed to solve lockups, whereas the old limit-to-32-bit trick worked. Restore the 32-bit limit, but also leave the 255-sector limit in place, because we know that's needed as well. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-03-24sata_promise: fix hardreset hotplug events, take 2Mikael Pettersson
A Promise SATA controller will signal hotplug events when a hard reset (COMRESET) is done on a port. These events aren't masked by the driver, and the unexpected interrupts will cause a sequence of failed reset attempts util libata's EH finally gives up. This has not been a common problem so far, but the pending libata hardreset-by-default changes makes it a critical issue. The solution is to disable hotplug events before a reset, and to reenable them afterwards. (Promise's driver does this too.) This patch adds SATA-specific versions of ->freeze() and ->thaw() that also disable and enable hotplug events. PATA ports continue to use the old versions of ->freeze() and ->thaw(). Accesses to the hotplug register must be serialised via host->lock. We rely on ap->lock == &ap->host->lock and that libata takes this lock before ->freeze() and ->thaw(). Document this requirement. The interrupt handler is adjusted so its hotplug register accesses are inside the region protected by host->lock. Tested on various chips (SATA300TX4, SATA300TX2plus, SATAII150TX4, FastTrack TX4000) with various combinations of SATA and PATA disks, with and without the pending hardreset-by-default changes. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Acked-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-24libata: improve HPA error handlingTejun Heo
There's no point in retrying and eventually failing device detection when the device rejects READ_NATIVE_MAX[_EXT]. Disable HPA unlocking if READ_NATIVE_MAX[_EXT] is rejected as done when SET_MAX[_EXT] is rejected. This allows some old drives to work even if they aren't blacklisted. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-24libata: assume no device is attached if both IDENTIFYs are abortedTejun Heo
This is to fix bugzilla #10254. QSI cdrom attached to pata_sis as secondary master appears as phantom device for the slave. Interestingly, instead of not setting DRQ after IDENTIFY which triggers NODEV_HINT, it aborts both IDENTIFY and IDENTIFY PACKET which makes EH retry. Modify EH such that it assumes no device is attached if both flavors of IDENTIFY are aborted by the device. There really isn't much point in retrying when the device actively aborts the commands. While at it, convert NODEV detection message to ata_dev_printk() to help debugging obscure detection problems. This problem was reported by Jan Bücken. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Jan Bücken <jb.faq@gmx.de> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-24pata_it821x: use raw nbytes in check_atapi_dmaTejun Heo
pata_it821x needs to look at raw request size in check_atapi_dma(). Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-24libata: implement ata_qc_raw_nbytes()Tejun Heo
Implement ata_qc_raw_nbytes() which determines the raw user-requested size of a PC command. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-18ACPI: fix ATA_ACPI buildLen Brown
drivers/ata/libata-acpi.c fails to build drivers/built-in.o: In function `ata_acpi_associate': (.text+0x7106a): undefined reference to `register_hotplug_dock_device' When CONFIG_ATA_ACPI=y and CONFIG_ACPI_DOCK=m But if dock is selected from ata_acpi, dock will =y when ata_acpi=y, avoiding this problem. http://bugzilla.kernel.org/show_bug.cgi?id=10272 Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-17ahci: Add Marvell 6121 SATA supportJose Alberto Reguero
Signed-off-by: Jose Alberto Reguero <jareguero@telefonica.net> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-17pata_ali: use atapi_cmd_type() to determine cmd type instead of transfer sizeTejun Heo
pata_ali was using qc->nbytes to determine whether a command is data transfer type or not. As now qc->nbytes can be extended by padding and draining buffers, these tests are not useful anymore. Use atapi_cmd_type() instead. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-17ahci: implement skip_host_reset parameterTejun Heo
Under certain circumstances (SSP turned off by the BIOS) and for debugging purposes, skipping global controller reset is helpful. Add a kernel parameter for it. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-17ahci: request all PCI BARsTejun Heo
ahci is often implemented with accompanying SFF compatible interface and legacy IDE driver may attach to the legacy IO ports when the controller is already claimed by ahci and vice-versa. This patch makes ahci use pcim_iomap_regions_request_all() so that all IO regions are claimed on attach. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-17libata-acpi: improve dock event handlingTejun Heo
Improve ACPI hotplug handling such that dock event is handled properly. * Register handlers for dock events. * Directly detach device on EJECT_REQUEST instead of signaling hotplug event. This prevents libata from accessing severed controller and/or device. * While at it, use named constants for ACPI events and move uevent signaling inside host lock. Original patch and testing by Holger Macht. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Holger Macht <hmacht@suse.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-10[libata] Add support for the RB500 PATA CompactFlashFlorian Fainelli
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-10ahci: logical-bitwise and confusion in ahci_save_initial_config()Roel Kluin
logical-bitwise & confusion Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-10libata: don't allow sysfs read access to force paramTejun Heo
Buffer for force param is deallocated after initialization, so trying to read it via sysfs results in oops. Don't allow read access to the param node. Spotted by Eric Sesterhenn. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-10ahci: add the Device IDs for nvidia MCP7B AHCIpeerchen
Signed-off-by: Peer Chen <peerchen@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-10libata-sff: handle controllers w/o ctl registerTejun Heo
SFF incorrectly assumed that ctl register is available for all controllers while some old SFF controllers don't have ctl register. Make SFF handle controllers w/o ctl register by conditionalizing ctl register access and softreset method. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-10libata: allow LLDs w/o any reset methodTejun Heo
Some old SFF controllers don't have any way to reset the channel. Currently, this isn't supported and libata EH causes an oops. Allow LLDs w/o any reset method and just assume ATA class in such cases. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-10ata: replace remaining __FUNCTION__ occurrencesHarvey Harrison
__FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-03-05ahci: work around ATI SB600 h/w quirkJeff Garzik
This addresses the recent ATI SB600 errata, where the hardware does not like 256-length PRD entries during FPDMA (aka NCQ). It hurts performance on SB600, but it is more important to get a correct patch eliminating the data corruption/lockups, and then later on tune for performance. We simply limit each command to a maximum of 255 sectors, on SB600. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-03-05pata_hpt*, pata_serverworks: fix UDMA maskingAlan Cox
When masking, mask out the modes that are unsupported not the ones that are supported. This makes life happier. 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>
2008-03-04block: separate out padding from alignmentTejun Heo
Block layer alignment was used for two different purposes - memory alignment and padding. This causes problems in lower layers because drivers which only require memory alignment ends up with adjusted rq->data_len. Separate out padding such that padding occurs iff driver explicitly requests it. Tomo: restorethe code to update bio in blk_rq_map_user introduced by the commit 40b01b9bbdf51ae543a04744283bf2d56c4a6afa according to padding alignment. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2008-03-04block: restore the meaning of rq->data_len to the true data lengthFUJITA Tomonori
The meaning of rq->data_len was changed to the length of an allocated buffer from the true data length. It breaks SG_IO friends and bsg. This patch restores the meaning of rq->data_len to the true data length and adds rq->extra_len to store an extended length (due to drain buffer and padding). This patch also removes the code to update bio in blk_rq_map_user introduced by the commit 40b01b9bbdf51ae543a04744283bf2d56c4a6afa. The commit adjusts bio according to memory alignment (queue_dma_alignment). However, memory alignment is NOT padding alignment. This adjustment also breaks SG_IO friends and bsg. Padding alignment needs to be fixed in a proper way (by a separate patch). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <axboe@carl.home.kernel.dk>
2008-02-29[libata] wrap kmap_atomic(KM_IRQ0) with local_irq_save/restore()Jeff Garzik
Interrupts must be disabled if using kmap_atomic(KM_IRQ0), but that was not the case in a few code paths coming directly from ATA driver interrupt handlers (which use spin_lock rather than spin_lock_irqsave). Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-02-28sata_svw: Add support for HT1100 SATA controllerAnantha Subramanyam
This patch adds support (including ATAPI DMA) for HT1100 (aka BCM11000) SATA controller. Signed-off-by: Anantha Subramanyam <ananth@broadcom.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-25Revert "power_state: get rid of write-only variable in SATA"Jeff Garzik
This reverts commit 559bbe6cbd0d8c68d40076a5f7dc98e3bf5864b2. Michael S. Tsirkin reports that this changes breaks suspend/resume. Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2008-02-25make atapi_dmadir staticAdrian Bunk
atapi_dmadir can now become static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-24libata-core: fix kernel-doc warningRandy Dunlap
Fix libata-core kernel-doc warning: Warning(linux-2.6.25-rc2-git6//drivers/ata/libata-core.c:168): No description found for parameter 'ap' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-24sata_fsl: fix build with ATA_VERBOSE_DEBUGAnton Vorontsov
This patch fixes build and few warnings when ATA_VERBOSE_DEBUG is defined: CC drivers/ata/sata_fsl.o drivers/ata/sata_fsl.c: In function ‘sata_fsl_fill_sg’: drivers/ata/sata_fsl.c:338: warning: format ‘%x’ expects type ‘unsigned int’, but argument 3 has type ‘void *’ drivers/ata/sata_fsl.c:338: warning: format ‘%x’ expects type ‘unsigned int’, but argument 4 has type ‘struct prde *’ drivers/ata/sata_fsl.c: In function ‘sata_fsl_qc_issue’: drivers/ata/sata_fsl.c:459: error: ‘csr_base’ undeclared (first use in this function) drivers/ata/sata_fsl.c:459: error: (Each undeclared identifier is reported only once drivers/ata/sata_fsl.c:459: error: for each function it appears in.) drivers/ata/sata_fsl.c: In function ‘sata_fsl_freeze’: drivers/ata/sata_fsl.c:525: error: ‘csr_base’ undeclared (first use in this function) make[2]: *** [drivers/ata/sata_fsl.o] Error 1 Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-24[libata] ahci: AMD SB700/SB800 SATA support 64bit DMAShane Huang
SB700 SATA controller can support 64 bit DMA, the previous commit badc2341579511a247f5993865aa68379e283c5c was added with careless reference to SB600, which should be modified by this patch. Signed-off-by: Shane Huang <shane.huang@amd.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-24libata-pmp: clear hob for pmp register accessesMark Lord
>> Mark Lord wrote: >>> Tejun, I've added PMP to sata_mv, and am now trying to get it >>> to work with a Marvell PM attached. >>> >>> And the behaviour I see is very bizarre. >>> >>> After hard+soft resets, the PM signature is found, >>> and libata interrogates the PM registers. >>> >>> It successfully reads register 0, and then register 1. >>> But all subsequent registers read out (incorrectly) as zeros. ... This behavior has been confirmed by Marvell with a SATA analyzer. The Marvell port-multiplier apparently likes to see clean HOB information when accessing PMP registers. Since sata_mv uses PIO shadow register access, this doesn't happen automatically, as it might in a more purely FIS-based driver (eg. ahci). One way to fix this is to flag these commands with ATA_TFLAG_LBA48, forcing libata to write out the HOB fields with known (zero) values. Signed-off-by: Saeed Bishara <saeed@marvell.com> Acked-by: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2008-02-24libata: automatically use DMADIR if drive/bridge requires itTejun Heo
Back in 2.6.17-rc2, a libata module parameter was added for atapi_dmadir. That's nice, but most SATA devices which need it will tell us about it in their IDENTIFY PACKET response, as bit-15 of word-62 of the returned data (as per ATA7, ATA8 specifications). So for those which specify it, we should automatically use the DMADIR bit. Otherwise, disc writing will fail by default on many SATA-ATAPI drives. This patch adds ATA_DFLAG_DMADIR and make ata_dev_configure() set it if atapi_dmadir is set or identify data indicates DMADIR is necessary. atapi_xlat() is converted to check ATA_DFLAG_DMADIR before setting DMADIR. Original patch is from Mark Lord. Signed-off-by: Tejun Heo <htejun@gmail.com> Cc: Mark Lord <mlord@pobox.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>