Module Name: src
Committed By: jmcneill
Date: Sun May 24 22:30:05 UTC 2015
Modified Files:
src/sys/dev/ic: ahcisata_core.c ahcisatavar.h
Log Message:
Add AHCI_QUIRK_SKIP_RESET quirk to allow for skipping the drive reset
sequence in ahci_do_reset_drive.
To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/dev/ic/ahcisata_core.c
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/ic/ahcisatavar.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/ahcisata_core.c
diff -u src/sys/dev/ic/ahcisata_core.c:1.53 src/sys/dev/ic/ahcisata_core.c:1.54
--- src/sys/dev/ic/ahcisata_core.c:1.53 Thu Dec 4 21:50:29 2014
+++ src/sys/dev/ic/ahcisata_core.c Sun May 24 22:30:05 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ahcisata_core.c,v 1.53 2014/12/04 21:50:29 joerg Exp $ */
+/* $NetBSD: ahcisata_core.c,v 1.54 2015/05/24 22:30:05 jmcneill Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.53 2014/12/04 21:50:29 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.54 2015/05/24 22:30:05 jmcneill Exp $");
#include <sys/types.h>
#include <sys/malloc.h>
@@ -708,6 +708,10 @@ again:
if (drive > 0) {
KASSERT(sc->sc_ahci_cap & AHCI_CAP_SPM);
}
+
+ if (sc->sc_ahci_quirks & AHCI_QUIRK_SKIP_RESET)
+ goto skip_reset;
+
/* polled command, assume interrupts are disabled */
/* use slot 0 to send reset, the channel is idle */
cmd_h = &achp->ahcic_cmdh[0];
@@ -759,6 +763,8 @@ again:
default:
break;
}
+
+skip_reset:
/*
* wait 31s for BSY to clear
* This should not be needed, but some controllers clear the
Index: src/sys/dev/ic/ahcisatavar.h
diff -u src/sys/dev/ic/ahcisatavar.h:1.16 src/sys/dev/ic/ahcisatavar.h:1.17
--- src/sys/dev/ic/ahcisatavar.h:1.16 Mon Feb 24 12:19:05 2014
+++ src/sys/dev/ic/ahcisatavar.h Sun May 24 22:30:05 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: ahcisatavar.h,v 1.16 2014/02/24 12:19:05 jmcneill Exp $ */
+/* $NetBSD: ahcisatavar.h,v 1.17 2015/05/24 22:30:05 jmcneill Exp $ */
/*
* Copyright (c) 2006 Manuel Bouyer.
@@ -59,6 +59,7 @@ struct ahci_softc {
#define AHCI_PCI_QUIRK_BAD64 __BIT(1) /* broken 64-bit DMA */
#define AHCI_QUIRK_BADPMP __BIT(2) /* broken PMP support, ignore */
#define AHCI_QUIRK_BADPMPRESET __BIT(3) /* broken PMP support for reset */
+#define AHCI_QUIRK_SKIP_RESET __BIT(4) /* skip drive reset sequence */
uint32_t sc_ahci_cap; /* copy of AHCI_CAP */
int sc_ncmds; /* number of command slots */