public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: "Verma, Devendra" <Devendra.Verma@amd.com>
Cc: "bhelgaas@google.com" <bhelgaas@google.com>,
	"mani@kernel.org" <mani@kernel.org>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Simek, Michal" <michal.simek@amd.com>
Subject: Re: [PATCH 2/2] dmaengine: dw-edma: Add non-LL mode
Date: Thu, 11 Sep 2025 15:43:40 -0500	[thread overview]
Message-ID: <20250911204340.GA1584422@bhelgaas> (raw)
In-Reply-To: <SA1PR12MB812027AB20BEE7C28F30A5FE9509A@SA1PR12MB8120.namprd12.prod.outlook.com>

On Thu, Sep 11, 2025 at 11:42:31AM +0000, Verma, Devendra wrote:
> > -----Original Message-----
> > From: Bjorn Helgaas <helgaas@kernel.org>

> > On Wed, Sep 10, 2025 at 12:30:39PM +0000, Verma, Devendra wrote:
> > > > From: Bjorn Helgaas <helgaas@kernel.org>
> >
> > [redundant headers removed]
> >
> > > > On Fri, Sep 05, 2025 at 03:46:59PM +0530, Devendra K Verma wrote:
> > > > > AMD MDB IP supports Linked List (LL) mode as well as non-LL mode.
> > > > > The current code does not have the mechanisms to enable the DMA
> > > > > transactions using the non-LL mode. The following two cases are
> > > > > added with this patch:
> >
> > > > > +static u64 dw_edma_get_phys_addr(struct pci_dev *pdev,
> > > > > +                              struct dw_edma_pcie_data *pdata,
> > > > > +                              enum pci_barno bar) {
> > > > > +     if (pdev->vendor == PCI_VENDOR_ID_XILINX)
> > > > > +             return pdata->phys_addr;
> > > > > +     return pci_bus_address(pdev, bar);
> > > >
> > > > This doesn't seem right.  pci_bus_address() returns pci_bus_addr_t,
> > > > so pdata->phys_addr should also be a pci_bus_addr_t, and the
> > > > function should return pci_bus_addr_t.
> > > >
> > > > A pci_bus_addr_t is not a "phys_addr"; it is an address that is
> > > > valid on the PCI side of a PCI host bridge, which may be different
> > > > than the CPU physical address on the CPU side of the bridge because
> > > > of things like IOMMUs.
> > > >
> > > > Seems like the struct dw_edma_region.paddr should be renamed to
> > > > something like "bus_addr" and made into a pci_bus_addr_t.
> > >
> > > In case of AMD, it is not an address that is accessible from host via
> > > PCI, it is the device side DDR offset of physical address which is not
> > > known to host,that is why the VSEC capability is used to let know host
> > > of the DDR offset to correctly programming the LLP of DMA controller.
> > > Without programming the LLP controller will not know from where to
> > > start reading the LL for DMA processing. DMA controller requires the
> > > physical address of LL present on its side of DDR.
> >
> > I guess "device side DDR offset" means this Xilinx device has some
> > DDR internal to the PCI device, and the CPU cannot access it via a
> > BAR?
> 
> The host can access the DDR internal to the PCI device via BAR, but
> it involves an iATU translation. The host can use the virtual /
> physical address to access that DDR.  The issue is not with the host
> rather DMA controller which does not understand the physical address
> provided by the host, eg, the address returned by pci_bus_addr(pdev,
> barno).

Does this mean dw_edma_get_phys_addr() depends on iATU programming
done by the PCI controller driver?  Is it possible for that driver to
change the iATU programming after dw_edma_get_phys_addr() in a way
that breaks this?

Bjorn

  reply	other threads:[~2025-09-11 20:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05 10:16 [PATCH 0/2] Add AMD MDB Endpoint and non-LL mode Support Devendra K Verma
2025-09-05 10:16 ` [PATCH 1/2] dmaengine: dw-edma: Add AMD MDB Endpoint Support Devendra K Verma
2025-09-05 16:54   ` Bjorn Helgaas
2025-09-10 12:28     ` Verma, Devendra
2025-09-10 16:49       ` Bjorn Helgaas
2025-09-05 10:16 ` [PATCH 2/2] dmaengine: dw-edma: Add non-LL mode Devendra K Verma
2025-09-05 19:06   ` Bjorn Helgaas
2025-09-10 12:30     ` Verma, Devendra
2025-09-10 17:56       ` Bjorn Helgaas
2025-09-11 11:42         ` Verma, Devendra
2025-09-11 20:43           ` Bjorn Helgaas [this message]
2025-09-12  9:31             ` Verma, Devendra

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=20250911204340.GA1584422@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=Devendra.Verma@amd.com \
    --cc=bhelgaas@google.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=michal.simek@amd.com \
    --cc=vkoul@kernel.org \
    /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