Skip to contentSkip to conversation

NVME fix PRP Offset Invalid

PATCH New Aaron Williams 2 participants 5 messages Aug 21, 2019

lore
Share & tools
lore
#0 lore raw

cover NVME fix PRP Offset Invalid

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

#1 lore raw

cover NVME fix PRP Offset Invalid

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

#2 lore raw

cover NVME fix PRP Offset Invalid

OK, for some reason my patch with this fix is not making it to this mailing list.

-Aaron

Quoted 16 lines · PDT Aaron Williams

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

Signature · 11 lines
Aaron Williams
Senior Software Engineer
Marvell Semiconductor, Inc.
(408) 943-7198	(510) 789-8988 (cell)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190820/cd5f9ac0/attachment.sig>
#3 lore raw

cover NVME fix PRP Offset Invalid

Quoted 4 lines · Aaron Williams

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

#4 lore raw

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

Quoted 5 lines · PDT Bin Meng

External Email

----------------------------------------------------------------------

On Wed, Aug 21, 2019 at 10:29 AM Aaron Williams <[email protected]>

Quoted 8 lines · wrote:
Quoted 3 lines

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

Signature · 11 lines
Aaron Williams
Senior Software Engineer
Marvell Semiconductor, Inc.
(408) 943-7198	(510) 789-8988 (cell)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190820/2d1cd786/attachment.sig>