Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev Add new AHCI_QUIRK_BADNCQ quick for controllers that...



details:   https://anonhg.NetBSD.org/src/rev/703b132a3715
branches:  trunk
changeset: 968497:703b132a3715
user:      simonb <simonb%NetBSD.org@localhost>
date:      Sat Jan 18 11:26:11 2020 +0000

description:
Add new AHCI_QUIRK_BADNCQ quick for controllers that have issues with
NCQ on (some) drives.  Enable this quirk for ATI (AMD) SB600/SB700
controllers.  Alternate fix for kern/54790 and kern/54855.

ok jdolecek@, tested on my SB700 chipset and tsutsui's SB600 chipset.

diffstat:

 sys/dev/ic/ahcisata_core.c |   9 +++++++--
 sys/dev/ic/ahcisatavar.h   |   3 ++-
 sys/dev/pci/ahcisata_pci.c |  16 ++++++++--------
 3 files changed, 17 insertions(+), 11 deletions(-)

diffs (89 lines):

diff -r cf81e84f9bd8 -r 703b132a3715 sys/dev/ic/ahcisata_core.c
--- a/sys/dev/ic/ahcisata_core.c        Sat Jan 18 11:24:40 2020 +0000
+++ b/sys/dev/ic/ahcisata_core.c        Sat Jan 18 11:26:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahcisata_core.c,v 1.80 2019/12/27 09:41:50 msaitoh Exp $       */
+/*     $NetBSD: ahcisata_core.c,v 1.81 2020/01/18 11:26:11 simonb Exp $        */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.80 2019/12/27 09:41:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.81 2020/01/18 11:26:11 simonb Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -276,6 +276,11 @@
                    "ignoring broken port multiplier support\n");
                sc->sc_ahci_cap &= ~AHCI_CAP_SPM;
        }
+       if (sc->sc_ahci_quirks & AHCI_QUIRK_BADNCQ) {
+               aprint_verbose_dev(sc->sc_atac.atac_dev,
+                   "ignoring broken NCQ support\n");
+               sc->sc_ahci_cap &= ~AHCI_CAP_NCQ;
+       }
        sc->sc_atac.atac_nchannels = (sc->sc_ahci_cap & AHCI_CAP_NPMASK) + 1;
        sc->sc_ncmds = ((sc->sc_ahci_cap & AHCI_CAP_NCS) >> 8) + 1;
        ahci_rev = AHCI_READ(sc, AHCI_VS);
diff -r cf81e84f9bd8 -r 703b132a3715 sys/dev/ic/ahcisatavar.h
--- a/sys/dev/ic/ahcisatavar.h  Sat Jan 18 11:24:40 2020 +0000
+++ b/sys/dev/ic/ahcisatavar.h  Sat Jan 18 11:26:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahcisatavar.h,v 1.23 2019/09/29 21:16:14 jakllsch Exp $        */
+/*     $NetBSD: ahcisatavar.h,v 1.24 2020/01/18 11:26:11 simonb Exp $  */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -59,6 +59,7 @@
 #define AHCI_PCI_QUIRK_BAD64   __BIT(1)  /* broken 64-bit DMA */
 #define AHCI_QUIRK_BADPMP      __BIT(2)  /* broken PMP support, ignore */
 #define AHCI_QUIRK_SKIP_RESET  __BIT(4)  /* skip drive reset sequence */
+#define AHCI_QUIRK_BADNCQ      __BIT(5)  /* possibly broken NCQ support, ignore */
 
        uint32_t sc_ahci_cap;   /* copy of AHCI_CAP */
        int sc_ncmds; /* number of command slots */
diff -r cf81e84f9bd8 -r 703b132a3715 sys/dev/pci/ahcisata_pci.c
--- a/sys/dev/pci/ahcisata_pci.c        Sat Jan 18 11:24:40 2020 +0000
+++ b/sys/dev/pci/ahcisata_pci.c        Sat Jan 18 11:26:11 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahcisata_pci.c,v 1.56 2019/10/18 17:16:50 tnn Exp $    */
+/*     $NetBSD: ahcisata_pci.c,v 1.57 2020/01/18 11:26:11 simonb Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.56 2019/10/18 17:16:50 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.57 2020/01/18 11:26:11 simonb Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ahcisata_pci.h"
@@ -179,17 +179,17 @@
            AHCI_PCI_QUIRK_FORCE },
        /* ATI SB600 AHCI 64-bit DMA only works on some boards/BIOSes */
        { PCI_VENDOR_ATI, PCI_PRODUCT_ATI_SB600_SATA_1,
-           AHCI_PCI_QUIRK_BAD64 | AHCI_QUIRK_BADPMP },
+           AHCI_PCI_QUIRK_BAD64 | AHCI_QUIRK_BADPMP | AHCI_QUIRK_BADNCQ },
        { PCI_VENDOR_ATI, PCI_PRODUCT_ATI_SB700_SATA_AHCI,
-           AHCI_QUIRK_BADPMP },
+           AHCI_QUIRK_BADPMP | AHCI_QUIRK_BADNCQ },
        { PCI_VENDOR_ATI, PCI_PRODUCT_ATI_SB700_SATA_RAID,
-           AHCI_QUIRK_BADPMP },
+           AHCI_QUIRK_BADPMP | AHCI_QUIRK_BADNCQ },
        { PCI_VENDOR_ATI, PCI_PRODUCT_ATI_SB700_SATA_RAID5,
-           AHCI_QUIRK_BADPMP },
+           AHCI_QUIRK_BADPMP | AHCI_QUIRK_BADNCQ },
        { PCI_VENDOR_ATI, PCI_PRODUCT_ATI_SB700_SATA_AHCI2,
-           AHCI_QUIRK_BADPMP },
+           AHCI_QUIRK_BADPMP | AHCI_QUIRK_BADNCQ },
        { PCI_VENDOR_ATI, PCI_PRODUCT_ATI_SB700_SATA_STORAGE,
-           AHCI_QUIRK_BADPMP },
+           AHCI_QUIRK_BADPMP | AHCI_QUIRK_BADNCQ },
        { PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT8237R_SATA,
            AHCI_QUIRK_BADPMP },
        { PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT8251_SATA,



Home | Main Index | Thread Index | Old Index