All of lore.kernel.org
 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 20:46:38 +0100	[thread overview]
Message-ID: <1765c91018bf3b7840ce79d9b51762e8@localhost> (raw)
In-Reply-To: <20151029151056.GA2580@localhost.localdomain>

On 2015/October/29 09:10, Jon Derrick wrote:
> > +#define readq lo_hi_readq
> > +#define writeq lo_hi_writeq
> > +
> 
> Good job figuring that one out. But this should be a quirk:
> a) It will sacrifice some io cycles on other devices
> b) It may get lost at some point in the name of performance

Yep.

> 
> Christoph recently added a quirks mechanism where I think it would fit

To be honest we don't know what mechanism you are referring to. Please 
give us pointer.


I assume that we concur that this workaround--as well as making the nvme 
driver claim the Apple controller--should be a runtime-decisions based 
on the device id. That avoids both penalties in terms of cpu cycles and 
the tedious manual binding.

How to do that sanely is a bit unclear to me. Detection at runtime would 
require that

1) the nvme driver attempts to bind to non-nvme devices (pci class 
018002),

2) checks whether or not that is Apples special controller (106b 2001), 
and in that case

3) binds to the device while using ordered split writes on 64bit 
platforms, which probably requires a set of function pointers to 
low-level ops.


Another approach might be to write an intermediate driver that relies on 
the nvme driver but encapsulates the remaining stuff.


If Apple's controller is expected to be the only exception, the latter 
approach would make sense. But I don't believe that Apple builds the 
only custom nvme controller that is "almost" compatible. (assuming that 
018002 instead of 010802 isn't a typo anyways).


Best,
Stephan

  parent reply	other threads:[~2015-10-29 19:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=1765c91018bf3b7840ce79d9b51762e8@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.