From: Bjorn Helgaas <helgaas@kernel.org>
To: Wang Lu <wanglu@dapustor.com>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org,
Logan Gunthorpe <logang@deltatee.com>
Subject: Re: [PATCH] PCI/P2PDMA: fix the wrong dma address calculation when map sg
Date: Thu, 9 Sep 2021 12:28:51 -0500 [thread overview]
Message-ID: <20210909172851.GA993207@bjorn-Precision-5520> (raw)
In-Reply-To: <20210909032528.24517-1-wanglu@dapustor.com>
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@dapustor.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
>
>
>
prev parent reply other threads:[~2021-09-09 17:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-09 3:25 [PATCH] PCI/P2PDMA: fix the wrong dma address calculation when map sg Wang Lu
2021-09-09 16:51 ` Logan Gunthorpe
2021-09-09 17:28 ` Bjorn Helgaas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210909172851.GA993207@bjorn-Precision-5520 \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=wanglu@dapustor.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox