public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@nxp.com>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: "Rob Herring" <robh@kernel.org>,
	"Saravana Kannan" <saravanak@google.com>,
	"Jingoo Han" <jingoohan1@gmail.com>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kw@linux.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Richard Zhu" <hongxing.zhu@nxp.com>,
	"Lucas Stach" <l.stach@pengutronix.de>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	imx@lists.linux.dev, "Niklas Cassel" <cassel@kernel.org>
Subject: Re: [PATCH v9 2/7] PCI: dwc: Rename cpu_addr to parent_bus_addr for ATU configuration
Date: Thu, 13 Feb 2025 11:02:52 -0500	[thread overview]
Message-ID: <Z64XrD2a5iHmLyRM@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <Z5uifr5+JE0xSi2l@lizhi-Precision-Tower-5810>

On Thu, Jan 30, 2025 at 11:02:06AM -0500, Frank Li wrote:
> On Wed, Jan 29, 2025 at 05:23:50PM -0600, Bjorn Helgaas wrote:
> > On Tue, Jan 28, 2025 at 05:07:35PM -0500, Frank Li wrote:
> > > Rename `cpu_addr` to `parent_bus_addr` in the DesignWare ATU configuration.
> > > The ATU translates parent bus addresses to PCI addresses, which are often
> > > the same as CPU addresses but can differ in systems where the bus fabric
> > > translates addresses before passing them to the PCIe controller. This
> > > renaming clarifies the purpose and avoids confusion.
> >
> > Based on dw_pcie_ep_inbound_atu() below, I guess the ATU can also
> > translate PCI addresses from incoming DMA to parent bus addresses?
>
> Yes, but root complex don't use it. Only EP use it. because most PCI root
> complex system doesn't transfer incoming address, which generally use iommu
> to do that. Linux already allow a simple map by use dt's dma-ranges and dma
> API already handle it.
>
> previous 'cpu_addr' is actually 'dma_bus_addr'.
>
> >
> > It's worth noting here that this patch only renames the member, and
> > IIUC, parent_bus_addr still incorrectly contains CPU physical
> > addresses.
>
> Anyway, call 'cpu_addr' for dw_pcie_ep_inbound_atu is wrong. Only one place
> call dw_pcie_ep_inbound_atu(), that's dw_pcie_ep_set_bar(), which use
> epf_bar->phys_addr, I think name 'phys_addr' is okay because most case it
> is refer to dma address space.

Bjoin:
	Do you any concern/comments about my reply?  how to move forward?
keep old cpu_addr or rename to parent_bus_addr, or futher work need be done.

Frank

>
> Frank
> >
> > > +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
> > > @@ -128,7 +128,7 @@ static int dw_pcie_ep_write_header(struct pci_epc *epc, u8 func_no, u8 vfunc_no,
> > >  }
> > >
> > >  static int dw_pcie_ep_inbound_atu(struct dw_pcie_ep *ep, u8 func_no, int type,
> > > -				  dma_addr_t cpu_addr, enum pci_barno bar,
> > > +				  dma_addr_t parent_bus_addr, enum pci_barno bar,
> > >  				  size_t size)


  reply	other threads:[~2025-02-13 16:41 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-28 22:07 [PATCH v9 0/7] PCI: dwc: opitimaze RC Host/EP pci_fixup_addr() Frank Li
2025-01-28 22:07 ` [PATCH v9 1/7] PCI: dwc: Use resource start as iomap() input in dw_pcie_pme_turn_off() Frank Li
2025-01-29 23:19   ` Bjorn Helgaas
2025-01-30 16:07     ` Frank Li
2025-01-28 22:07 ` [PATCH v9 2/7] PCI: dwc: Rename cpu_addr to parent_bus_addr for ATU configuration Frank Li
2025-01-29 23:23   ` Bjorn Helgaas
2025-01-30 16:02     ` Frank Li
2025-02-13 16:02       ` Frank Li [this message]
2025-01-28 22:07 ` [PATCH v9 3/7] PCI: Add parent_bus_offset to resource_entry Frank Li
2025-02-06 17:11   ` Frank Li
2025-02-27  0:08   ` Bjorn Helgaas
2025-02-27  0:23   ` Bjorn Helgaas
2025-03-03 21:57     ` Frank Li
2025-03-04 17:50       ` Bjorn Helgaas
2025-03-04 22:11         ` Frank Li
2025-03-04 22:25           ` Frank Li
2025-03-07 15:32             ` Frank Li
2025-03-07 23:41               ` Bjorn Helgaas
2025-01-28 22:07 ` [PATCH v9 4/7] PCI: dwc: Use devicetree 'ranges' property to get rid of cpu_addr_fixup() callback Frank Li
2025-02-26 23:33   ` Bjorn Helgaas
2025-03-03 21:58     ` Frank Li
2025-01-28 22:07 ` [PATCH v9 5/7] PCI: dwc: ep: Add parent_bus_addr for outbound window Frank Li
2025-01-28 22:07 ` [PATCH v9 6/7] PCI: dwc: ep: Ensure proper iteration over outbound map windows Frank Li
2025-02-27  0:12   ` Bjorn Helgaas
2025-02-27  0:14     ` Bjorn Helgaas
2025-01-28 22:07 ` [PATCH v9 7/7] PCI: imx6: Remove cpu_addr_fixup() Frank Li
2025-01-29 10:13 ` [PATCH v9 0/7] PCI: dwc: opitimaze RC Host/EP pci_fixup_addr() Niklas Cassel
2025-01-29 15:28   ` Frank Li
2025-01-29 16:39     ` Niklas Cassel
2025-01-29 17:04       ` Frank Li

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=Z64XrD2a5iHmLyRM@lizhi-Precision-Tower-5810 \
    --to=frank.li@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=cassel@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=helgaas@kernel.org \
    --cc=hongxing.zhu@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=jingoohan1@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kw@linux.com \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=saravanak@google.com \
    --cc=shawnguo@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