aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-core.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-06-10 22:04:45 -0400
committerJeff Garzik <jgarzik@redhat.com>2009-06-23 01:54:30 -0400
commit0d9e6659a1bde3733cfd0072adbb3514b579e383 (patch)
tree9af1e5a8712fe02216ea52ef740f86ead5085acd /drivers/ata/libata-core.c
parentdc77ad4c8727d3a1c23eadcb287501dab480d634 (diff)
libata: don't set IORDY for reset
Before issuing reset, libata configures xfermode to PIO0 which makes some drivers turn on IORDY which may cause the controller to lock up if the port is not occupied. IORDY isn't necessary at this point anyway. Make ata_pio_need_iordy() return zero if it's being called for reset. This fixes bko#11703. Reported and tracked down by Daniel Gnoutcheff and Constantine Gavrilov. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Daniel Gnoutcheff <gnoutchd@union.edu> Cc: Constantine Gavrilov <constantine.gavrilov@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r--drivers/ata/libata-core.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 1d894c9d73d0..045a486a09ea 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -1993,11 +1993,17 @@ unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd)
1993 * Check if the current speed of the device requires IORDY. Used 1993 * Check if the current speed of the device requires IORDY. Used
1994 * by various controllers for chip configuration. 1994 * by various controllers for chip configuration.
1995 */ 1995 */
1996
1997unsigned int ata_pio_need_iordy(const struct ata_device *adev) 1996unsigned int ata_pio_need_iordy(const struct ata_device *adev)
1998{ 1997{
1999 /* Controller doesn't support IORDY. Probably a pointless check 1998 /* Don't set IORDY if we're preparing for reset. IORDY may
2000 as the caller should know this */ 1999 * lead to controller lock up on certain controllers if the
2000 * port is not occupied. See bko#11703 for details.
2001 */
2002 if (adev->link->ap->pflags & ATA_PFLAG_RESETTING)
2003 return 0;
2004 /* Controller doesn't support IORDY. Probably a pointless
2005 * check as the caller should know this.
2006 */
2001 if (adev->link->ap->flags & ATA_FLAG_NO_IORDY) 2007 if (adev->link->ap->flags & ATA_FLAG_NO_IORDY)
2002 return 0; 2008 return 0;
2003 /* CF spec. r4.1 Table 22 says no iordy on PIO5 and PIO6. */ 2009 /* CF spec. r4.1 Table 22 says no iordy on PIO5 and PIO6. */
@@ -2020,7 +2026,6 @@ unsigned int ata_pio_need_iordy(const struct ata_device *adev)
2020 * Compute the highest mode possible if we are not using iordy. Return 2026 * Compute the highest mode possible if we are not using iordy. Return
2021 * -1 if no iordy mode is available. 2027 * -1 if no iordy mode is available.
2022 */ 2028 */
2023
2024static u32 ata_pio_mask_no_iordy(const struct ata_device *adev) 2029static u32 ata_pio_mask_no_iordy(const struct ata_device *adev)
2025{ 2030{
2026 /* If we have no drive specific rule, then PIO 2 is non IORDY */ 2031 /* If we have no drive specific rule, then PIO 2 is non IORDY */