aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-eh.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-11-27 05:28:57 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-23 05:24:11 -0500
commit663f99b86ac7d4c0eed8c239638da0ea8849288b (patch)
tree413952549c288d31f5dec168e3a83fa232457093 /drivers/ata/libata-eh.c
parent3884f7b0a8382b89d8ca5da23bd98e3e15fc805b (diff)
libata: adjust speed down rules
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>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r--drivers/ata/libata-eh.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index b01ade102727..7d766ada7a5d 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1525,13 +1525,13 @@ static int speed_down_verdict_cb(struct ata_ering_entry *ent, void *void_arg)
1525 * Even if multiple verdicts are returned, only one action is 1525 * Even if multiple verdicts are returned, only one action is
1526 * taken per error. ering is cleared after an action is taken. 1526 * taken per error. ering is cleared after an action is taken.
1527 * 1527 *
1528 * 1. If more than 10 ATA_BUS, TOUT_HSM or UNK_DEV errors 1528 * 1. If more than 6 ATA_BUS, TOUT_HSM or UNK_DEV errors
1529 * ocurred during last 5 mins, FALLBACK_TO_PIO 1529 * ocurred during last 5 mins, FALLBACK_TO_PIO
1530 * 1530 *
1531 * 2. If more than 3 TOUT_HSM or UNK_DEV errors occurred 1531 * 2. If more than 3 TOUT_HSM or UNK_DEV errors occurred
1532 * during last 10 mins, NCQ_OFF. 1532 * during last 10 mins, NCQ_OFF.
1533 * 1533 *
1534 * 3. If more than 3 ATA_BUS or TOUT_HSM errors, or more than 10 1534 * 3. If more than 3 ATA_BUS or TOUT_HSM errors, or more than 6
1535 * UNK_DEV errors occurred during last 10 mins, SPEED_DOWN. 1535 * UNK_DEV errors occurred during last 10 mins, SPEED_DOWN.
1536 * 1536 *
1537 * LOCKING: 1537 * LOCKING:
@@ -1554,7 +1554,7 @@ static unsigned int ata_eh_speed_down_verdict(struct ata_device *dev)
1554 1554
1555 if (arg.nr_errors[ATA_ECAT_ATA_BUS] + 1555 if (arg.nr_errors[ATA_ECAT_ATA_BUS] +
1556 arg.nr_errors[ATA_ECAT_TOUT_HSM] + 1556 arg.nr_errors[ATA_ECAT_TOUT_HSM] +
1557 arg.nr_errors[ATA_ECAT_UNK_DEV] > 10) 1557 arg.nr_errors[ATA_ECAT_UNK_DEV] > 6)
1558 verdict |= ATA_EH_SPDN_FALLBACK_TO_PIO; 1558 verdict |= ATA_EH_SPDN_FALLBACK_TO_PIO;
1559 1559
1560 /* scan past 10 mins of error history */ 1560 /* scan past 10 mins of error history */
@@ -1568,7 +1568,7 @@ static unsigned int ata_eh_speed_down_verdict(struct ata_device *dev)
1568 1568
1569 if (arg.nr_errors[ATA_ECAT_ATA_BUS] + 1569 if (arg.nr_errors[ATA_ECAT_ATA_BUS] +
1570 arg.nr_errors[ATA_ECAT_TOUT_HSM] > 3 || 1570 arg.nr_errors[ATA_ECAT_TOUT_HSM] > 3 ||
1571 arg.nr_errors[ATA_ECAT_UNK_DEV] > 10) 1571 arg.nr_errors[ATA_ECAT_UNK_DEV] > 6)
1572 verdict |= ATA_EH_SPDN_SPEED_DOWN; 1572 verdict |= ATA_EH_SPDN_SPEED_DOWN;
1573 1573
1574 return verdict; 1574 return verdict;
@@ -1647,10 +1647,10 @@ static unsigned int ata_eh_speed_down(struct ata_device *dev,
1647 } 1647 }
1648 1648
1649 /* Fall back to PIO? Slowing down to PIO is meaningless for 1649 /* Fall back to PIO? Slowing down to PIO is meaningless for
1650 * SATA. Consider it only for PATA. 1650 * SATA ATA devices. Consider it only for PATA and SATAPI.
1651 */ 1651 */
1652 if ((verdict & ATA_EH_SPDN_FALLBACK_TO_PIO) && (dev->spdn_cnt >= 2) && 1652 if ((verdict & ATA_EH_SPDN_FALLBACK_TO_PIO) && (dev->spdn_cnt >= 2) &&
1653 (link->ap->cbl != ATA_CBL_SATA) && 1653 (link->ap->cbl != ATA_CBL_SATA || dev->class == ATA_DEV_ATAPI) &&
1654 (dev->xfer_shift != ATA_SHIFT_PIO)) { 1654 (dev->xfer_shift != ATA_SHIFT_PIO)) {
1655 if (ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO) == 0) { 1655 if (ata_down_xfermask_limit(dev, ATA_DNXFER_FORCE_PIO) == 0) {
1656 dev->spdn_cnt = 0; 1656 dev->spdn_cnt = 0;