diff options
author | sos <sos@FreeBSD.org> | 2008-06-11 08:48:25 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2008-06-11 08:48:25 +0000 |
commit | 622e89669b90845bcd0c26719d54b19eb1c37583 (patch) | |
tree | b09761cb25a62686787cecc389bc50fafb42f381 /sys | |
parent | ad0eff64be686b87fd41fe643041096f172d0278 (diff) | |
download | FreeBSD-src-622e89669b90845bcd0c26719d54b19eb1c37583.zip FreeBSD-src-622e89669b90845bcd0c26719d54b19eb1c37583.tar.gz |
Wait up to 1S for the TFD data to signal un-busy before fetching the signature.
This at least helps a few slow devices out there.
Submitted by: Andrey V. Elsukov
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ata/ata-chipset.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ata/ata-chipset.c b/sys/dev/ata/ata-chipset.c index 7266ef1..47564cc 100644 --- a/sys/dev/ata/ata-chipset.c +++ b/sys/dev/ata/ata-chipset.c @@ -1059,10 +1059,10 @@ ata_ahci_softreset(device_t dev, int port) struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev)); struct ata_channel *ch = device_get_softc(dev); int offset = ch->unit << 7; + int timeout = 0; #ifdef AHCI_PM struct ata_ahci_cmd_tab *ctp = (struct ata_ahci_cmd_tab *)(ch->dma.work + ATA_AHCI_CT_OFFSET); - int timeout = 0; /* kick controller into sane state if needed */ ata_ahci_restart(dev); @@ -1091,7 +1091,7 @@ ata_ahci_softreset(device_t dev, int port) ata_udelay(150000); - timeout = 0; +#endif do { DELAY(1000); if (timeout++ > 1000) { @@ -1101,7 +1101,7 @@ ata_ahci_softreset(device_t dev, int port) } while (ATA_INL(ctlr->r_res2, ATA_AHCI_P_TFD + offset) & ATA_S_BUSY); if (bootverbose) device_printf(dev, "BUSY wait time=%dms\n", timeout); -#endif + return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset); } |