U-boot Archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme: Correct the prps per page calculation method
@ 2021-06-16  3:22 Wesley Sheng
  2021-06-18  6:00 ` Bin Meng
  0 siblings, 1 reply; 5+ messages in thread
From: Wesley Sheng @ 2021-06-16  3:22 UTC (permalink / raw
  To: u-boot; +Cc: wesleyshenggit, wesley.sheng

From: wesleywesley <wesleyshenggit@sina.com>

Each prp is 8 bytes, calculate the number of prps
per page should just divide page size by 8
there is no need to minus 1

Signed-off-by: wesleywesley <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 fc64d93ab8..622bb378c0 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -79,7 +79,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) - 1;
+	u32 prps_per_page = page_size >> 3;
 	u32 num_pages;
 
 	length -= (page_size - offset);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvme: Correct the prps per page calculation method
  2021-06-16  3:22 [PATCH] nvme: Correct the prps per page calculation method Wesley Sheng
@ 2021-06-18  6:00 ` Bin Meng
  0 siblings, 0 replies; 5+ messages in thread
From: Bin Meng @ 2021-06-18  6:00 UTC (permalink / raw
  To: Wesley Sheng; +Cc: U-Boot Mailing List, wesleyshenggit

On Wed, Jun 16, 2021 at 12:09 PM Wesley Sheng <wesley.sheng@amd.com> wrote:
>
> From: wesleywesley <wesleyshenggit@sina.com>

nits: are you sure this name is correct? Should it be "Wesley Sheng"?

>
> Each prp is 8 bytes, calculate the number of prps
> per page should just divide page size by 8
> there is no need to minus 1
>
> Signed-off-by: wesleywesley <wesleyshenggit@sina.com>
> ---
>  drivers/nvme/nvme.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] nvme: Correct the prps per page calculation method
@ 2021-06-22  3:34 Wesley Sheng
  2021-06-23  8:53 ` Bin Meng
  0 siblings, 1 reply; 5+ messages in thread
From: Wesley Sheng @ 2021-06-22  3:34 UTC (permalink / raw
  To: u-boot; +Cc: wesleyshenggit, wesley.sheng

From: Wesley Sheng <wesleyshenggit@sina.com>

Each prp is 8 bytes, calculate the number of prps
per page should just divide page size by 8
there is no need to minus 1

Signed-off-by: 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 fc64d93ab8..622bb378c0 100644
--- a/drivers/nvme/nvme.c
+++ b/drivers/nvme/nvme.c
@@ -79,7 +79,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) - 1;
+	u32 prps_per_page = page_size >> 3;
 	u32 num_pages;
 
 	length -= (page_size - offset);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvme: Correct the prps per page calculation method
  2021-06-22  3:34 Wesley Sheng
@ 2021-06-23  8:53 ` Bin Meng
  2021-06-23  9:18   ` Bin Meng
  0 siblings, 1 reply; 5+ messages in thread
From: Bin Meng @ 2021-06-23  8:53 UTC (permalink / raw
  To: Wesley Sheng; +Cc: U-Boot Mailing List, wesleyshenggit

On Tue, Jun 22, 2021 at 11:34 AM Wesley Sheng <wesley.sheng@amd.com> wrote:
>
> From: Wesley Sheng <wesleyshenggit@sina.com>
>
> Each prp is 8 bytes, calculate the number of prps
> per page should just divide page size by 8
> there is no need to minus 1
>
> Signed-off-by: Wesley Sheng <wesleyshenggit@sina.com>
> ---
>  drivers/nvme/nvme.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] nvme: Correct the prps per page calculation method
  2021-06-23  8:53 ` Bin Meng
@ 2021-06-23  9:18   ` Bin Meng
  0 siblings, 0 replies; 5+ messages in thread
From: Bin Meng @ 2021-06-23  9:18 UTC (permalink / raw
  To: Wesley Sheng; +Cc: U-Boot Mailing List, wesleyshenggit

On Wed, Jun 23, 2021 at 4:53 PM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Tue, Jun 22, 2021 at 11:34 AM Wesley Sheng <wesley.sheng@amd.com> wrote:
> >
> > From: Wesley Sheng <wesleyshenggit@sina.com>
> >
> > Each prp is 8 bytes, calculate the number of prps
> > per page should just divide page size by 8
> > there is no need to minus 1
> >
> > Signed-off-by: Wesley Sheng <wesleyshenggit@sina.com>
> > ---
> >  drivers/nvme/nvme.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
>
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

applied to u-boot-x86, thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-06-23  9:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-16  3:22 [PATCH] nvme: Correct the prps per page calculation method Wesley Sheng
2021-06-18  6:00 ` Bin Meng
  -- strict thread matches above, loose matches on Subject: below --
2021-06-22  3:34 Wesley Sheng
2021-06-23  8:53 ` Bin Meng
2021-06-23  9:18   ` Bin Meng

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 read-only IMAP folder(s) and NNTP newsgroup(s).