svn commit: r188905 - head/sys/dev/ata/chipsets
Alexander Motin
mav at FreeBSD.org
Sat Feb 21 15:42:29 PST 2009
Author: mav
Date: Sat Feb 21 23:42:28 2009
New Revision: 188905
URL: http://svn.freebsd.org/changeset/base/188905
Log:
Increase initial busy waiting time. If drive was hot-plugged, it may need
much time to spin-up.
Modified:
head/sys/dev/ata/chipsets/ata-ahci.c
Modified: head/sys/dev/ata/chipsets/ata-ahci.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-ahci.c Sat Feb 21 23:15:34 2009 (r188904)
+++ head/sys/dev/ata/chipsets/ata-ahci.c Sat Feb 21 23:42:28 2009 (r188905)
@@ -624,7 +624,7 @@ ata_ahci_start(device_t dev)
}
static int
-ata_ahci_wait_ready(device_t dev)
+ata_ahci_wait_ready(device_t dev, int t)
{
struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
struct ata_channel *ch = device_get_softc(dev);
@@ -634,7 +634,7 @@ ata_ahci_wait_ready(device_t dev)
while (ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset) &
(ATA_S_BUSY | ATA_S_DRQ)) {
DELAY(1000);
- if (timeout++ > 1000) {
+ if (timeout++ > t) {
device_printf(dev, "port is not ready\n");
return (-1);
}
@@ -680,7 +680,7 @@ ata_ahci_softreset(device_t dev, int por
if (ata_ahci_issue_cmd(dev, 0, 0))
return -1;
- if (ata_ahci_wait_ready(dev))
+ if (ata_ahci_wait_ready(dev, 1000))
return (-1);
return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset);
@@ -738,7 +738,7 @@ ata_ahci_reset(device_t dev)
ATA_AHCI_P_IX_PS | ATA_AHCI_P_IX_DHR));
/* Wait for initial TFD from device. */
- ata_ahci_wait_ready(dev);
+ ata_ahci_wait_ready(dev, 10000);
/* only probe for PortMultiplier if HW has support */
if (ATA_INL(ctlr->r_res2, ATA_AHCI_CAP) & ATA_AHCI_CAP_SPM) {
More information about the svn-src-all
mailing list