mbox series

[U-Boot,0/1] NVME fix PRP Offset Invalid

Message ID 20190821002329.24906-1-awilliams@marvell.com
Headers show
Series NVME fix PRP Offset Invalid | expand

Message

Aaron Williams Aug. 21, 2019, 12:23 a.m. UTC
Let's try this yet again.  I'm sorry if multiple emails are going
out, I'm having issues getting git send-email working with our
mail server.

Anyway, this fixes a problem where the U-Boot NVME driver fails
during large transfers due to the way the NVME driver allocates
the PRP data structure.  This data structure cannot cross a
page boundary and hence it should be aligned to a page boundary
and be a multiple of the page size (4K).  The last entry in
the PRP points to the next page if there are more entries than
will fit in a single page.  Without this fix, I was seeing a
status code of 0x13 (PRP Offset Invalid) when writing a 187MiB
Linux kernel image to a 128GiB FAT32 filesystem on a Samsung
1TB 970+ NVME SSD drive.

-Aaron

Comments

Aaron Williams Aug. 21, 2019, 12:23 a.m. UTC | #1
Our QA team had problems writing large files (187MB) to the
FAT filesystem on a Samsung EVO 970 NVME drive and I was
able to track it down to PRP buffer issues.  Namely, this
buffer cannot cross a page boundary and it should be
allocated in page-sized chunks.  This patch modifies the
U-Boot NVME driver to match what the Linux kernel PCI
driver does.

Aaron Williams (1):
  nvme: Fix PRP Offset Invalid

 drivers/nvme/nvme.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--
2.16.4
Aaron Williams Aug. 21, 2019, 2:29 a.m. UTC | #2
OK, for some reason my patch with this fix is not making it to this mailing 
list.

-Aaron

On Tuesday, August 20, 2019 5:23:29 PM PDT Aaron Williams wrote:
> Our QA team had problems writing large files (187MB) to the
> FAT filesystem on a Samsung EVO 970 NVME drive and I was
> able to track it down to PRP buffer issues.  Namely, this
> buffer cannot cross a page boundary and it should be
> allocated in page-sized chunks.  This patch modifies the
> U-Boot NVME driver to match what the Linux kernel PCI
> driver does.
> 
> Aaron Williams (1):
>   nvme: Fix PRP Offset Invalid
> 
>  drivers/nvme/nvme.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> --
> 2.16.4
Bin Meng Aug. 21, 2019, 3:09 a.m. UTC | #3
On Wed, Aug 21, 2019 at 10:29 AM Aaron Williams <awilliams@marvell.com> wrote:
>
> OK, for some reason my patch with this fix is not making it to this mailing
> list.
>

It looks the patch arrived the ML. I will take a look. Thanks.

Regards,
Bin
Aaron Williams Aug. 21, 2019, 4:08 a.m. UTC | #4
Thanks. I'm still trying to figure out why my patch isn't showing up in the 
mailing list. Without it I can easily cause my Samsung NVME drive to
fail with the status containing 0x2013 when doing large writes in a FAT
filesystem (but for some reason not reads). I also could not reproduce
this with an Intel NVME card.

The error code is valid, however, since the PRP is not page aligned.

Ideally the NVME driver could use SGLs instead of PRPs except in architectures 
that need PRPs. I would think PSDT=2 would work better for this.

-Aaron


On Tuesday, August 20, 2019 8:09:39 PM PDT Bin Meng wrote:
> External Email
> 
> ----------------------------------------------------------------------
> 
> On Wed, Aug 21, 2019 at 10:29 AM Aaron Williams <awilliams@marvell.com> 
wrote:
> > OK, for some reason my patch with this fix is not making it to this
> > mailing
> > list.
> 
> It looks the patch arrived the ML. I will take a look. Thanks.
> 
> Regards,
> Bin