Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic nvme(4): Do not use bus_space_{read, write}_8() ev...
details: https://anonhg.NetBSD.org/src/rev/7badcf987e1d
branches: trunk
changeset: 353940:7badcf987e1d
user: nonaka <nonaka%NetBSD.org@localhost>
date: Mon May 29 02:24:00 2017 +0000
description:
nvme(4): Do not use bus_space_{read,write}_8() even on LP64 archs.
> some (broken) controllers require ordered split transfers.
> From linux a310acd7a7ea53533886c11bb7edd11ffd61a036
from OpenBSD nvme.c r1.53.
diffstat:
sys/dev/ic/nvme.c | 15 ++++++---------
1 files changed, 6 insertions(+), 9 deletions(-)
diffs (43 lines):
diff -r 67e0377832d7 -r 7badcf987e1d sys/dev/ic/nvme.c
--- a/sys/dev/ic/nvme.c Mon May 29 02:20:34 2017 +0000
+++ b/sys/dev/ic/nvme.c Mon May 29 02:24:00 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nvme.c,v 1.27 2017/05/29 02:20:34 nonaka Exp $ */
+/* $NetBSD: nvme.c,v 1.28 2017/05/29 02:24:00 nonaka Exp $ */
/* $OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
/*
@@ -18,7 +18,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.27 2017/05/29 02:20:34 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.28 2017/05/29 02:24:00 nonaka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -121,12 +121,10 @@
bus_space_read_4((_s)->sc_iot, (_s)->sc_ioh, (_r))
#define nvme_write4(_s, _r, _v) \
bus_space_write_4((_s)->sc_iot, (_s)->sc_ioh, (_r), (_v))
-#ifdef __LP64__
-#define nvme_read8(_s, _r) \
- bus_space_read_8((_s)->sc_iot, (_s)->sc_ioh, (_r))
-#define nvme_write8(_s, _r, _v) \
- bus_space_write_8((_s)->sc_iot, (_s)->sc_ioh, (_r), (_v))
-#else /* __LP64__ */
+/*
+ * Some controllers, at least Apple NVMe, always require split
+ * transfers, so don't use bus_space_{read,write}_8() on LP64.
+ */
static inline uint64_t
nvme_read8(struct nvme_softc *sc, bus_size_t r)
{
@@ -157,7 +155,6 @@
nvme_write4(sc, r + 4, a[0]);
#endif
}
-#endif /* __LP64__ */
#define nvme_barrier(_s, _r, _l, _f) \
bus_space_barrier((_s)->sc_iot, (_s)->sc_ioh, (_r), (_l), (_f))
Home |
Main Index |
Thread Index |
Old Index