summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2016-10-02 18:54:02 +0000
committerpatrick <patrick@openbsd.org>2016-10-02 18:54:02 +0000
commitfd58cd83b9b96c35f9f2ec07cedba26cd254c9c4 (patch)
treea55e52b98beb87dc6ae9d434578434513864bc87
parentGiven that ahci_port_alloc() grabs one CCB for use during NCQ error (diff)
downloadwireguard-openbsd-fd58cd83b9b96c35f9f2ec07cedba26cd254c9c4.tar.xz
wireguard-openbsd-fd58cd83b9b96c35f9f2ec07cedba26cd254c9c4.zip
Some HBAs report NCQ capability despite only supporting one command
slot. Thus, extend the check whether NCQ actually should be enabled accordingly. From Marius Strobl tested by awolk (amd64), bluhm (amd64, i386), myself (amd64, armv7) ok jmatthew@
-rw-r--r--sys/dev/ic/ahci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/ic/ahci.c b/sys/dev/ic/ahci.c
index 9f0708f898a..8fa7e0b9cc7 100644
--- a/sys/dev/ic/ahci.c
+++ b/sys/dev/ic/ahci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ahci.c,v 1.26 2016/10/02 18:53:28 patrick Exp $ */
+/* $OpenBSD: ahci.c,v 1.27 2016/10/02 18:54:02 patrick Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -277,6 +277,7 @@ noccc:
aaa.aaa_nports = AHCI_MAX_PORTS;
aaa.aaa_ncmds = sc->sc_ncmds - 1;
if (!(sc->sc_flags & AHCI_F_NO_NCQ) &&
+ sc->sc_ncmds > 2 &&
(sc->sc_cap & AHCI_REG_CAP_SNCQ)) {
aaa.aaa_capability |= ASAA_CAP_NCQ | ASAA_CAP_PMP_NCQ;
/* XXX enabling ASAA_CAP_PMP_NCQ with FBS: