[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 9 Sep 2021 12:28:51 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: Wang Lu <wanglu@...ustor.com>
Cc: bhelgaas@...gle.com, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, Logan Gunthorpe <logang@...tatee.com>
Subject: Re: [PATCH] PCI/P2PDMA: fix the wrong dma address calculation when
map sg
On Thu, Sep 09, 2021 at 11:25:28AM +0800, Wang Lu wrote:
> The bus offset is bus address - physical address,
> so the calculation in __pci_p2pdma_map_sg should be:
> bus address = physical address + bus offset.
>
> Signed-off-by: Wang Lu <wanglu@...ustor.com>
Applied with Logan's reviewed-by to pci/p2pdma for v5.16, thanks!
I fixed the subject line and commit log for you to follow the usual
conventions.
> ---
> drivers/pci/p2pdma.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/p2pdma.c b/drivers/pci/p2pdma.c
> index 50cdde3e9a8b..327882638b30 100644
> --- a/drivers/pci/p2pdma.c
> +++ b/drivers/pci/p2pdma.c
> @@ -874,7 +874,7 @@ static int __pci_p2pdma_map_sg(struct pci_p2pdma_pagemap *p2p_pgmap,
> int i;
>
> for_each_sg(sg, s, nents, i) {
> - s->dma_address = sg_phys(s) - p2p_pgmap->bus_offset;
> + s->dma_address = sg_phys(s) + p2p_pgmap->bus_offset;
> sg_dma_len(s) = s->length;
> }
>
> --
> 2.17.1
>
>
>
Powered by blists - more mailing lists