Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic change DIOCCACHESYNC to not issue the FLUSH comma...
details: https://anonhg.NetBSD.org/src/rev/c0a2f67cc442
branches: trunk
changeset: 351833:c0a2f67cc442
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Tue Feb 28 20:55:09 2017 +0000
description:
change DIOCCACHESYNC to not issue the FLUSH command at all when the controller
has no volatile write cache
diffstat:
sys/dev/ic/ld_nvme.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diffs (30 lines):
diff -r 3acda8c7681e -r c0a2f67cc442 sys/dev/ic/ld_nvme.c
--- a/sys/dev/ic/ld_nvme.c Tue Feb 28 20:53:50 2017 +0000
+++ b/sys/dev/ic/ld_nvme.c Tue Feb 28 20:55:09 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ld_nvme.c,v 1.13 2017/02/28 20:53:50 jdolecek Exp $ */
+/* $NetBSD: ld_nvme.c,v 1.14 2017/02/28 20:55:09 jdolecek Exp $ */
/*-
* Copyright (C) 2016 NONAKA Kimihiro <nonaka%netbsd.org@localhost>
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld_nvme.c,v 1.13 2017/02/28 20:53:50 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld_nvme.c,v 1.14 2017/02/28 20:55:09 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -199,6 +199,11 @@
{
struct ld_nvme_softc *sc = device_private(ld->sc_dv);
+ if (!nvme_has_volatile_write_cache(sc->sc_nvme)) {
+ /* cache not present, no value in trying to flush it */
+ return 0;
+ }
+
return nvme_ns_sync(sc->sc_nvme, sc->sc_nsid, sc,
poll ? NVME_NS_CTX_F_POLL : 0,
ld_nvme_syncdone);
Home |
Main Index |
Thread Index |
Old Index