Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ata disable NCQ by default for "Samsung SSD 860 EVO ...



details:   https://anonhg.NetBSD.org/src/rev/87fd9f869068
branches:  trunk
changeset: 968373:87fd9f869068
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Jan 13 21:20:17 2020 +0000

description:
disable NCQ by default for "Samsung SSD 860 EVO 1TB" and
"Samsung SSD 860 EVO 500GB" - these drives have known broken NCQ support
particularly when used with AMD SB710/750 chipsets, problem occur also
under Linux and Windows

https://eu.community.samsung.com/t5/Cameras-IT-Everything-Else/860-EVO-250GB-causing-freezes-on-AMD-system/td-p/575813
https://bugzilla.kernel.org/show_bug.cgi?id=201693

It seems there is no Samsung firmware update to fix this even.

Disable NCQ regardless of the controller, it's likely same problem
exists with other controllers too.

This should fix PR kern/54790 and PR kern/54855

diffstat:

 sys/dev/ata/wd.c |  27 +++++++++++++++------------
 1 files changed, 15 insertions(+), 12 deletions(-)

diffs (70 lines):

diff -r d4c39c2dbaa4 -r 87fd9f869068 sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c  Mon Jan 13 20:36:44 2020 +0000
+++ b/sys/dev/ata/wd.c  Mon Jan 13 21:20:17 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wd.c,v 1.453 2019/12/27 09:41:50 msaitoh Exp $ */
+/*     $NetBSD: wd.c,v 1.454 2020/01/13 21:20:17 jdolecek Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.453 2019/12/27 09:41:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.454 2020/01/13 21:20:17 jdolecek Exp $");
 
 #include "opt_ata.h"
 #include "opt_wd.h"
@@ -231,8 +231,9 @@
 #endif
 
 #define        WD_QUIRK_SPLIT_MOD15_WRITE      0x0001  /* must split certain writes */
+#define        WD_QUIRK_BAD_NCQ                0x0002  /* drive NCQ support broken */
 
-#define        WD_QUIRK_FMT "\20\1SPLIT_MOD15_WRITE\2FORCE_LBA48"
+#define        WD_QUIRK_FMT "\20\1SPLIT_MOD15_WRITE\2BAD_NCQ"
 
 /*
  * Quirk table for IDE drives.  Put more-specific matches first, since
@@ -259,14 +260,12 @@
         * Seagate Barracuda Serial ATA V family.
         *
         */
-       { "ST3120023AS",
-         WD_QUIRK_SPLIT_MOD15_WRITE },
-       { "ST380023AS",
-         WD_QUIRK_SPLIT_MOD15_WRITE },
-       { "ST360015AS",
-         WD_QUIRK_SPLIT_MOD15_WRITE },
-       { NULL,
-         0 }
+       { "ST3120023AS", WD_QUIRK_SPLIT_MOD15_WRITE },
+       { "ST380023AS", WD_QUIRK_SPLIT_MOD15_WRITE },
+       { "ST360015AS", WD_QUIRK_SPLIT_MOD15_WRITE },
+       { "Samsung SSD 860 EVO 1TB", WD_QUIRK_BAD_NCQ },
+       { "Samsung SSD 860 EVO 500GB", WD_QUIRK_BAD_NCQ },
+       { NULL, 0 }
 };
 
 static const struct wd_quirk *
@@ -375,6 +374,10 @@
                if (wd->sc_quirks & WD_QUIRK_SPLIT_MOD15_WRITE) {
                        aprint_error_dev(self, "drive corrupts write transfers with certain controllers, consider replacing\n");
                }
+
+               if (wd->sc_quirks & WD_QUIRK_BAD_NCQ) {
+                       aprint_error_dev(self, "drive NCQ support broken, NCQ disabled, consider replacing\n");
+               }
        }
 
        if ((wd->sc_params.atap_multi & 0xff) > 1) {
@@ -2181,7 +2184,7 @@
                return;
        }
 
-       wd->drv_ncq = true;
+       wd->drv_ncq = ((wd->sc_quirks & WD_QUIRK_BAD_NCQ) == 0) ? true : false;
        if ((error = sysctl_createv(&wd->nodelog, 0, NULL, NULL,
                                CTLFLAG_READWRITE, CTLTYPE_BOOL, "use_ncq",
                                SYSCTL_DESCR("use NCQ if supported"),



Home | Main Index | Thread Index | Old Index