linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sven Peter" <sven@svenpeter.dev>
To: "Keith Busch" <kbusch@kernel.org>
Cc: "Linus Torvalds" <torvalds@linux-foundation.org>,
	"Aditya Garg" <gargaditya08@live.com>,
	"axboe@fb.com" <axboe@fb.com>, "hch@lst.de" <hch@lst.de>,
	"sagi@grimberg.me" <sagi@grimberg.me>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
	"james.smart@broadcom.com" <james.smart@broadcom.com>,
	"chaitanya.kulkarni@wdc.com" <chaitanya.kulkarni@wdc.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"trivial@kernel.org" <trivial@kernel.org>
Subject: Re: [PATCH] Urgent bug fix causing Apple SSDs to not work.
Date: Sat, 25 Sep 2021 22:48:39 +0200	[thread overview]
Message-ID: <08930bdf-6a3a-4d49-b366-8029b88b25b4@www.fastmail.com> (raw)
In-Reply-To: <20210925203857.GC116968@dhcp-10-100-145-180.wdc.com>



On Sat, Sep 25, 2021, at 22:38, Keith Busch wrote:
> On Sat, Sep 25, 2021 at 10:08:53PM +0200, Sven Peter wrote:
>> I actually ran into a similar issue while adding support for the NVMe
>> controller found on the M1 and assumed it was only present there.
>> 
>> Some background why this happens: ANS2 is a co-processor that emulates
>> an NVMe MMIO interface and uses the tag as an index to an internal data
>> structure. 
>
> Thanks for confirming the behavior. The patch should restore the
> command_id values to when everything was working. I'll just need to
> update the quirk description to better align with the actual limitation
> if the patch is successful. 
>
>> On the M1 we can directly talk to ANS2 and while we can submit
>> commands with a higher index it'll just ignore the upper bits and only
>> return the lowest eight IIRC in the completion queue.
>> I guess whatever software is running on the T2 actually has an assert to
>> ensure that the tag is within the limits before forwarding the command
>> to ANS2.
>
> Is the PCI Device ID for the M1 the same as reported for the T2? Either
> 0x2005 or 0x2003 should make this quirk apply.

Oh, it's worse. It's no longer a PCIe device there but a platform device
directly attached to the SoC's bus. It'll need almost all T2 quirks and then
some additional changes to the way command submission works and support to
program a tightly coupled IOMMU which Apple calls NVMMU (which probably is another
reason for this limit: they use the command id to find the corresponding entry in
the IOMMU that allows access to memory listed in the PRPs).
I'll just use the quirk in my platform driver and submit it once I get it into a
shape that can actually be reviewed.



Sven


  reply	other threads:[~2021-09-25 20:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <PNZPR01MB4415600ACD3C8D9944F15058B8A59@PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM>
2021-09-25 18:47 ` [PATCH] Urgent bug fix causing Apple SSDs to not work Linus Torvalds
2021-09-25 19:54   ` Keith Busch
2021-09-25 20:08     ` Sven Peter
2021-09-25 20:38       ` Keith Busch
2021-09-25 20:48         ` Sven Peter [this message]
2021-09-25 20:34     ` Sagi Grimberg
2021-09-25 20:48       ` Keith Busch
     [not found]       ` <PNZPR01MB4415F5304CAA1A83442549DBB8A69@PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM>
     [not found]         ` <PNZPR01MB4415986CC44AACC100AD1189B8A69@PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM>
2021-09-26  8:44           ` Orlando Chamberlain
2021-09-27  4:35             ` Aditya Garg

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=08930bdf-6a3a-4d49-b366-8029b88b25b4@www.fastmail.com \
    --to=sven@svenpeter.dev \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@fb.com \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=gargaditya08@live.com \
    --cc=hch@lst.de \
    --cc=james.smart@broadcom.com \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=torvalds@linux-foundation.org \
    --cc=trivial@kernel.org \
    /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).