From: Robert Beckett <bob.beckett@collabora.com>
To: "Keith Busch" <kbusch@kernel.org>
Cc: "Pawel Anikiel" <panikiel@google.com>, "axboe" <axboe@kernel.dk>,
"hch" <hch@lst.de>, "kernel" <kernel@collabora.com>,
"linux-kernel" <linux-kernel@vger.kernel.org>,
"linux-nvme" <linux-nvme@lists.infradead.org>,
"sagi" <sagi@grimberg.me>
Subject: Re: [PATCH] nvme-pci: 512 byte aligned dma pool segment quirk
Date: Wed, 11 Dec 2024 10:55:56 +0000 [thread overview]
Message-ID: <193b55c7998.d66e7e7c1942154.6474606603462169748@collabora.com> (raw)
In-Reply-To: <Z1i0d5Ht8zUHhSu-@kbusch-mbp.dhcp.thefacebook.com>
---- On Tue, 10 Dec 2024 21:36:55 +0000 Keith Busch wrote ---
> On Mon, Dec 09, 2024 at 04:33:01PM +0100, Paweł Anikiel wrote:
> > On Mon, Dec 9, 2024 at 1:33 PM Robert Beckett bob.beckett@collabora.com> wrote:
> > > [...]
> > > I have no further updates on this. I have received no further info from the vendor.
> > > I think we can go ahead and use the alignment patch as is. The only outstanding question was whether it is an
> > > implicit last entry per page chain vs simple alisngment requirement. Either way, using the dmapool
> > > alignment fixes both of these potential causes, so we should just take it as is.
> > > If we ever get any better info and can do a more specific patch in future, we can rework it then.
> >
> > I think the 512 byte alignment fix is good. I tried coming up with
> > something more specific, but everything I could think of was either
> > too complicated or artificial.
> >
> > Regarding the question of whether this is an alignment requirement or
> > the last PRP entry issue, I strongly believe it's the latter. I have a
> > piece of code that clearly demonstrates the hardware bug when run on a
> > device with the nvme bridge. I would really appreciate it if this was
> > verified and my explanation was included in the patch.
>
> I've pushed this to nvme-6.13 with an updated commit message here:
>
> https://git.infradead.org/?p=nvme.git;a=commitdiff;h=ccd84b8d6f4a60626dacb933b5d56dadca75c0ca
lgtm. Thanks!
>
> I can force an update if you have any edit suggestions.
>
> Commit message copied below:
>
> Author: Robert Beckett bob.beckett@collabora.com>
>
> nvme-pci: 512 byte aligned dma pool segment quirk
>
> We initially introduced a quick fix limiting the queue depth to 1 as
> experimentation showed that it fixed data corruption on 64GB steamdecks.
>
> Further experimentation revealed corruption only happens when the last
> PRP data element aligns to the end of the page boundary. The device
> appears to treat this as a PRP chain to a new list instead of the data
> element that it actually is. This is an implementation is in violation
> of the spec. Encountering this errata with the Linux driver requires the
> host request a 128k transfer and coincidently get the last small pool
> dma buffer within a page.
>
> The QD1 quirk effectly works around this because the last data PRP
> always was at a 248 byte offset from the page start, so it never
> appeared at the end of the page. Further, the MDTS is also small enough
> that the "large" prp pool can hold enough PRP elements to never get to
> the end, so that pool is not a problem either.
>
> Introduce a new quirk to ensure the small pool is always aligned such
> that the last PRP element can't appear a the end of the page. This comes
> at the expense of wasting 256 bytes per small pool page allocated.
>
> Link: https://lore.kernel.org/linux-nvme/20241113043151.GA20077@lst.de/T/#u
> Fixes: 83bdfcbdbe5d ("nvme-pci: qdepth 1 quirk")
> Cc: Paweł Anikiel panikiel@google.com>
> Signed-off-by: Robert Beckett bob.beckett@collabora.com>
> Signed-off-by: Keith Busch kbusch@kernel.org>
>
next prev parent reply other threads:[~2024-12-11 10:56 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-12 19:50 Bob Beckett
2024-11-12 20:47 ` Keith Busch
2024-11-13 4:31 ` Christoph Hellwig
2024-11-13 18:05 ` Keith Busch
2024-11-13 20:08 ` Robert Beckett
2024-11-14 5:55 ` Christoph Hellwig
2024-11-14 13:10 ` Robert Beckett
2024-11-14 11:38 ` Paweł Anikiel
2024-11-14 12:17 ` Christoph Hellwig
2024-11-14 15:37 ` Keith Busch
2024-11-14 13:24 ` Robert Beckett
2024-11-14 14:13 ` Paweł Anikiel
2024-11-14 16:28 ` Robert Beckett
2024-11-22 19:36 ` Keith Busch
2024-12-09 12:32 ` Robert Beckett
2024-12-09 15:33 ` Paweł Anikiel
2024-12-10 21:36 ` Keith Busch
2024-12-11 10:55 ` Robert Beckett [this message]
2024-12-17 11:18 ` Paweł Anikiel
2024-11-14 15:46 ` Keith Busch
2024-11-14 16:47 ` Robert Beckett
2024-11-14 18:00 ` Keith Busch
2024-11-14 18:01 ` Jens Axboe
2024-11-25 11:01 ` Niklas Cassel
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=193b55c7998.d66e7e7c1942154.6474606603462169748@collabora.com \
--to=bob.beckett@collabora.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=panikiel@google.com \
--cc=sagi@grimberg.me \
/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
all inboxes | Powered by JetHome®