aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-eh.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-10-29 03:41:09 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-29 06:21:33 -0400
commitcdeab1140799f09c5f728a5ff85e0bdfa5679cd2 (patch)
tree51e70854ce9a41e3d7e0363fe5748635671b6a6f /drivers/ata/libata-eh.c
parenta9efacbad1a735ec410acb26c9de72be8efb33d5 (diff)
libata: relocate forcing PIO0 on reset
Forcing PIO0 on reset was done inside ata_bus_softreset(), which is a bit out of place as it should be applied to all resets - hard, soft and implementation which don't use ata_bus_softreset(). Relocate it such that... * For new EH, it's done in ata_eh_reset() before calling prereset. * For old EH, it's done before calling ap->ops->phy_reset() in ata_bus_probe(). This makes PIO0 forced after all resets. Another difference is that reset itself is done after PIO0 is forced. Signed-off-by: Tejun Heo <htejun@gmail.com> Acked-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r--drivers/ata/libata-eh.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 496edaff119a..b237ff18b39e 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2083,6 +2083,25 @@ int ata_eh_reset(struct ata_link *link, int classify,
2083 2083
2084 ata_eh_about_to_do(link, NULL, ehc->i.action & ATA_EH_RESET_MASK); 2084 ata_eh_about_to_do(link, NULL, ehc->i.action & ATA_EH_RESET_MASK);
2085 2085
2086 ata_link_for_each_dev(dev, link) {
2087 /* If we issue an SRST then an ATA drive (not ATAPI)
2088 * may change configuration and be in PIO0 timing. If
2089 * we do a hard reset (or are coming from power on)
2090 * this is true for ATA or ATAPI. Until we've set a
2091 * suitable controller mode we should not touch the
2092 * bus as we may be talking too fast.
2093 */
2094 dev->pio_mode = XFER_PIO_0;
2095
2096 /* If the controller has a pio mode setup function
2097 * then use it to set the chipset to rights. Don't
2098 * touch the DMA setup as that will be dealt with when
2099 * configuring devices.
2100 */
2101 if (ap->ops->set_piomode)
2102 ap->ops->set_piomode(ap, dev);
2103 }
2104
2086 /* Determine which reset to use and record in ehc->i.action. 2105 /* Determine which reset to use and record in ehc->i.action.
2087 * prereset() may examine and modify it. 2106 * prereset() may examine and modify it.
2088 */ 2107 */