Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/dev Pull up following revision(s) (requested by simon...



details:   https://anonhg.NetBSD.org/src/rev/f801ccc715b0
branches:  netbsd-9
changeset: 843773:f801ccc715b0
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Jan 21 15:19:51 2020 +0000

description:
Pull up following revision(s) (requested by simonb in ticket #630):

        sys/dev/ic/ahcisatavar.h: revision 1.24
        sys/dev/pci/ahcisata_pci.c: revision 1.57
        sys/dev/ic/ahcisata_core.c: revision 1.81

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 c64697699bc9 -r f801ccc715b0 sys/dev/ic/ahcisata_core.c
--- a/sys/dev/ic/ahcisata_core.c        Tue Jan 21 15:15:23 2020 +0000
+++ b/sys/dev/ic/ahcisata_core.c        Tue Jan 21 15:19:51 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahcisata_core.c,v 1.75.4.2 2019/12/24 17:34:33 martin Exp $    */
+/*     $NetBSD: ahcisata_core.c,v 1.75.4.3 2020/01/21 15:19:51 martin Exp $    */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.75.4.2 2019/12/24 17:34:33 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_core.c,v 1.75.4.3 2020/01/21 15:19:51 martin 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 c64697699bc9 -r f801ccc715b0 sys/dev/ic/ahcisatavar.h
--- a/sys/dev/ic/ahcisatavar.h  Tue Jan 21 15:15:23 2020 +0000
+++ b/sys/dev/ic/ahcisatavar.h  Tue Jan 21 15:19:51 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahcisatavar.h,v 1.22 2019/01/14 21:29:56 jdolecek Exp $        */
+/*     $NetBSD: ahcisatavar.h,v 1.22.4.1 2020/01/21 15:19:51 martin 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 c64697699bc9 -r f801ccc715b0 sys/dev/pci/ahcisata_pci.c
--- a/sys/dev/pci/ahcisata_pci.c        Tue Jan 21 15:15:23 2020 +0000
+++ b/sys/dev/pci/ahcisata_pci.c        Tue Jan 21 15:19:51 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahcisata_pci.c,v 1.55.4.1 2019/10/23 18:09:18 martin Exp $     */
+/*     $NetBSD: ahcisata_pci.c,v 1.55.4.2 2020/01/21 15:19:51 martin Exp $     */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.55.4.1 2019/10/23 18:09:18 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.55.4.2 2020/01/21 15:19:51 martin 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