diff options
| author | jdolecek <jdolecek@NetBSD.org> | 2019-01-18 19:16:50 +0000 |
|---|---|---|
| committer | jdolecek <jdolecek@NetBSD.org> | 2019-01-18 19:16:50 +0000 |
| commit | b8418ee75e5e97038362bcf5f74484bb8a5cee8f (patch) | |
| tree | d16f6fb1f5df98c0891eaac33fcbfc45aebcadc2 /sys | |
| parent | 187e20cf33e5b46c18d5142406ecfdb9a190dd61 (diff) | |
revert rev 1.73 - while it apparently helped Christos case, it re-broke
the disk detection on several other systems, so need something else
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/ic/ahcisata_core.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/sys/dev/ic/ahcisata_core.c b/sys/dev/ic/ahcisata_core.c index 6adf61d24ba..1a6408deb0e 100644 --- a/sys/dev/ic/ahcisata_core.c +++ b/sys/dev/ic/ahcisata_core.c @@ -1,4 +1,4 @@ -/* $NetBSD: ahcisata_core.c,v 1.73 2019/01/12 15:16:51 jdolecek Exp $ */ +/* $NetBSD: ahcisata_core.c,v 1.74 2019/01/18 19:16:50 jdolecek Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.73 2019/01/12 15:16:51 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.74 2019/01/18 19:16:50 jdolecek Exp $"); #include <sys/types.h> #include <sys/malloc.h> @@ -850,8 +850,6 @@ ahci_do_reset_drive(struct ata_channel *chp, int drive, int flags, case TIMEOUT: aprint_error("%s port %d: setting WDCTL_RST failed " "for drive %d\n", AHCINAME(sc), chp->ch_channel, drive); - if (sigp) - *sigp = 0xffffffff; error = EBUSY; goto end; default: @@ -877,8 +875,6 @@ ahci_do_reset_drive(struct ata_channel *chp, int drive, int flags, case TIMEOUT: aprint_error("%s port %d: clearing WDCTL_RST failed " "for drive %d\n", AHCINAME(sc), chp->ch_channel, drive); - if (sigp) - *sigp = 0xffffffff; error = EBUSY; goto end; default: @@ -900,8 +896,6 @@ skip_reset: if (i == AHCI_RST_WAIT) { aprint_error("%s: BSY never cleared, TD 0x%x\n", AHCINAME(sc), sig); - if (sigp) - *sigp = 0xffffffff; goto end; } AHCIDEBUG_PRINT(("%s: BSY took %d ms\n", AHCINAME(sc), i * 10), @@ -1000,7 +994,6 @@ ahci_probe_drive(struct ata_channel *chp) return; } -again: /* bring interface up, accept FISs, power up and spin up device */ AHCI_WRITE(sc, AHCI_P_CMD(chp->ch_channel), AHCI_P_CMD_ICC_AC | AHCI_P_CMD_FRE | @@ -1011,6 +1004,9 @@ again: case SStatus_DET_DEV: ata_delay(chp, 500, "ahcidv", AT_WAIT); + /* Initial value, used in case the soft reset fails */ + sig = AHCI_READ(sc, AHCI_P_SIG(chp->ch_channel)); + if (sc->sc_ahci_cap & AHCI_CAP_SPM) { error = ahci_do_reset_drive(chp, PMP_PORT_CTL, AT_WAIT, &sig, c_slot); @@ -1023,7 +1019,7 @@ again: PMP_PORT_CTL); sc->sc_ahci_cap &= ~AHCI_CAP_SPM; - goto again; + ahci_reset_channel(chp, AT_WAIT); } } else { ahci_do_reset_drive(chp, 0, AT_WAIT, &sig, c_slot); |
