linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme: prepare support for Apple NVMe controller
@ 2015-10-29 14:38 Stephan Günther
  2015-10-29 15:10 ` Jon Derrick
  0 siblings, 1 reply; 10+ messages in thread
From: Stephan Günther @ 2015-10-29 14:38 UTC (permalink / raw)


The Apple NVMe controller found in the Macbook8,1 (12 inch retina model)
requires ordered split transfers even on 64bit systems to work.
Otherwise, readq() for instance returns all ones, which explains the
ridiculous page size of 128MiB reported before.

With this patch applied, the Apple NVMe controller can manually be bound
to he NVMe driver. Manual binding is still required since the controller
reports a PCI device class of 018002 (mass storage) instead of 010802
(nvme).


Signed-off-by: Stephan G?nther <guenther at tum.de>
Signed-off-by: Maurice Leclaire <leclaire at in.tum.de>
---

modprobe nvme
echo "106b 2001" > /sys/bus/pci/drivers/nvme/new_id

>From lspci after binding:

| 03:00.0 Mass storage controller: Apple Inc. Device 2001 (rev 01)
|   Subsystem: Apple Inc. Device 2001
|   (...)
|   Kernel driver in use: nvme

Partitions are correctly recognized and i/o operations seem to work so
far.

 drivers/block/nvme-core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index ccc0c1f93daa..d6c0d2f1df03 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -43,6 +43,9 @@
 #include <scsi/sg.h>
 #include <asm-generic/io-64-nonatomic-lo-hi.h>
 
+#define readq lo_hi_readq
+#define writeq lo_hi_writeq
+
 #define NVME_MINORS		(1U << MINORBITS)
 #define NVME_Q_DEPTH		1024
 #define NVME_AQ_DEPTH		256

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-11-03 20:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-29 14:38 [PATCH] nvme: prepare support for Apple NVMe controller Stephan Günther
2015-10-29 15:10 ` Jon Derrick
2015-10-29 16:36   ` Vedant Lath
2015-10-29 17:59     ` Stephan Günther
2015-10-31 22:34       ` Vedant Lath
2015-10-29 19:46   ` Stephan Günther
2015-10-29 20:31     ` Keith Busch
2015-10-29 20:41       ` Stephan Günther
2015-11-03 13:02   ` Christoph Hellwig
2015-11-03 20:43     ` Stephan Günther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).