45 lines
1.6 KiB
Diff
45 lines
1.6 KiB
Diff
From 3a13ff4eb509e8e80a52ae45c9a5573e745803c3 Mon Sep 17 00:00:00 2001
|
|
Message-Id: <3a13ff4eb509e8e80a52ae45c9a5573e745803c3.1645627172.git.stefan@agner.ch>
|
|
In-Reply-To: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch>
|
|
References: <24b77460dbfa2497ceb7a1611bf28b6eb88a1d74.1645627172.git.stefan@agner.ch>
|
|
From: Stefan Agner <stefan@agner.ch>
|
|
Date: Thu, 23 Sep 2021 23:43:31 +0200
|
|
Subject: [PATCH 4/5] Revert "nvme: Correct the prps per page calculation
|
|
method"
|
|
|
|
This reverts commit 859b33c948945f7904f60a2c12a3792d356d51ad.
|
|
|
|
If there is more than one PRP List the last entry is a pointer to
|
|
the next list. From the NVM Express specification:
|
|
|
|
"The last entry within a memory page, as indicated by the memory page
|
|
size in the CC.MPS field, shall be a PRP List pointer if there is more
|
|
than a single memory page of data to be transferred."
|
|
|
|
For the purpose of calculating the number of pages required for PRP
|
|
lists we should always assume that the last entry is required for
|
|
the next PRP list.
|
|
|
|
Signed-off-by: Stefan Agner <stefan@agner.ch>
|
|
Cc: Wesley Sheng <wesleyshenggit@sina.com>
|
|
---
|
|
drivers/nvme/nvme.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c
|
|
index 3c529a2fce..3bda491e12 100644
|
|
--- a/drivers/nvme/nvme.c
|
|
+++ b/drivers/nvme/nvme.c
|
|
@@ -81,7 +81,7 @@ static int nvme_setup_prps(struct nvme_dev *dev, u64 *prp2,
|
|
u64 *prp_pool;
|
|
int length = total_len;
|
|
int i, nprps;
|
|
- u32 prps_per_page = page_size >> 3;
|
|
+ u32 prps_per_page = (page_size >> 3) - 1;
|
|
u32 num_pages;
|
|
|
|
length -= (page_size - offset);
|
|
--
|
|
2.35.1
|
|
|