linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: guenther@tum.de (Stephan Günther)
Subject: [PATCH] nvme: prepare support for Apple NVMe controller
Date: Thu, 29 Oct 2015 15:38:40 +0100	[thread overview]
Message-ID: <bd1f730603ee00205657774a362aab10@localhost> (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

             reply	other threads:[~2015-10-29 14:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-29 14:38 Stephan Günther [this message]
2015-10-29 15:10 ` [PATCH] nvme: prepare support for Apple NVMe controller 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bd1f730603ee00205657774a362aab10@localhost \
    --to=guenther@tum.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).