Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ata move the comment (and expand) about NCQ TRIM to ...



details:   https://anonhg.NetBSD.org/src/rev/4b1f6f175978
branches:  trunk
changeset: 445356:4b1f6f175978
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Wed Oct 24 19:46:44 2018 +0000

description:
move the comment (and expand) about NCQ TRIM to wd_trim()

diffstat:

 sys/dev/ata/TODO.ncq |   2 --
 sys/dev/ata/wd.c     |  15 +++++++++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r 8c1151e395d9 -r 4b1f6f175978 sys/dev/ata/TODO.ncq
--- a/sys/dev/ata/TODO.ncq      Wed Oct 24 19:38:00 2018 +0000
+++ b/sys/dev/ata/TODO.ncq      Wed Oct 24 19:46:44 2018 +0000
@@ -12,5 +12,3 @@
 - not easy to fix, open needs to read disklabel and all this mechanics
   is too much for emergency crash dump code path
 - old bug - kern/16789
-
-add support for the NCQ TRIM if supported by device?
diff -r 8c1151e395d9 -r 4b1f6f175978 sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c  Wed Oct 24 19:38:00 2018 +0000
+++ b/sys/dev/ata/wd.c  Wed Oct 24 19:46:44 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wd.c,v 1.442 2018/10/22 20:13:47 jdolecek Exp $ */
+/*     $NetBSD: wd.c,v 1.443 2018/10/24 19:46:44 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.442 2018/10/22 20:13:47 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.443 2018/10/24 19:46:44 jdolecek Exp $");
 
 #include "opt_ata.h"
 #include "opt_wd.h"
@@ -1819,6 +1819,9 @@
        return error;
 }
 
+/*
+ * Execute TRIM command, assumes sleep context.
+ */
 static int
 wd_trim(struct wd_softc *wd, daddr_t bno, long size)
 {
@@ -1839,6 +1842,14 @@
        req[6] = size & 0xff;
        req[7] = (size >> 8) & 0xff;
 
+       /*
+        * XXX We could possibly use NCQ TRIM, which supports executing
+        * this command concurrently. It would need some investigation, some
+        * early or not so early disk firmware caused data loss with NCQ TRIM.
+        * atastart() et.al would need to be adjusted to allow and support
+        * running several non-I/O ATA commands in parallel.
+        */
+
        xfer->c_ata_c.r_command = ATA_DATA_SET_MANAGEMENT;
        xfer->c_ata_c.r_count = 1;
        xfer->c_ata_c.r_features = ATA_SUPPORT_DSM_TRIM;



Home | Main Index | Thread Index | Old Index