devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Arnd Bergmann" <arnd@arndb.de>
To: "Manivannan Sadhasivam" <mani@kernel.org>
Cc: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	"Chester Lin" <chester62515@gmail.com>,
	"Matthias Brugger" <mbrugger@suse.com>,
	"Ghennadi Procopciuc" <ghennadi.procopciuc@oss.nxp.com>,
	"NXP S32 Linux Team" <s32@nxp.com>,
	bhelgaas@google.com, jingoohan1@gmail.com,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	krzk+dt@kernel.org, "Conor Dooley" <conor+dt@kernel.org>,
	Ionut.Vicovan@nxp.com, "Larisa Grigore" <larisa.grigore@nxp.com>,
	"Ghennadi Procopciuc" <Ghennadi.Procopciuc@nxp.com>,
	ciprianmarian.costea@nxp.com,
	"Bogdan Hamciuc" <bogdan.hamciuc@nxp.com>,
	"Frank Li" <Frank.li@nxp.com>,
	linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev, "Niklas Cassel" <cassel@kernel.org>
Subject: Re: [PATCH 1/3 v2] dt-bindings: PCI: s32g: Add NXP PCIe controller
Date: Wed, 08 Oct 2025 19:56:44 +0200	[thread overview]
Message-ID: <3d480f73-15b4-4fb8-8d2b-f9961c1736ca@app.fastmail.com> (raw)
In-Reply-To: <2erycpxudpckmme3k2cpn6wgti4ueyvupo2tzrvmu7aqp7tm6d@itfj7pfrpzzg>

On Wed, Oct 8, 2025, at 17:19, Manivannan Sadhasivam wrote:
> On Wed, Oct 08, 2025 at 10:35:34AM +0200, Arnd Bergmann wrote:
>> On Wed, Oct 8, 2025, at 10:26, Arnd Bergmann wrote:
>> > the physical addresses for RAM at 0x80000000 and on-chip devices
>> > at 0x40000000. This probably works fine as long as the total
>> > PCI memory space assignment stays below 0x40000000 but would
>> > fail once addresses actually start clashing.
>> 
>> I got confused here myself, but what I should have said is that
>> having the DMA address for the RAM overlap the BAR space
>> as seen from PCI is problematic as the PCI host bridge
>> cannot tell PCI P2P transfers from DMA to RAM, so one
>> of them will be broken here.
>> 
>
> No. The IP just sets up the outbound mapping here for the entire 'ranges'. When
> P2P happens, it will use the inbound mapping translation.

That is not my impression from reading the code: At least for
the case where both devices are on the same bridge and they
use map_type=PCI_P2PDMA_MAP_BUS_ADDR, I would expect the DMA
to use the plain PCI bus address, not going through the
dma-ranges+ranges translation that would apply when they are
on different host bridges.

> So your concern would be valid if the 'dma-ranges' (for which inbound
> translation happens) overlapped with the RAM/MMIO range. But that is not the
> case here.

dma-ranges should normally list all the memory controllers, so in
this case at least the 0x80000000..0xffffffff range of PCI bus
addresses must be routed from the host bridge to RAM. If a BAR
is assigned to the same numbers, I would expect a PCI bridge
to direct a DMA transfer downstream to that BAR instead
of upstream to the CPU even before it gets to the host bridge.

      Arnd

  reply	other threads:[~2025-10-08 17:57 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-19 15:58 [PATCH 0/4 v2] PCI: s32g: Add support for PCIe controller Vincent Guittot
2025-09-19 15:58 ` [PATCH 1/3 v2] dt-bindings: PCI: s32g: Add NXP " Vincent Guittot
2025-09-19 16:39   ` Frank Li
2025-09-23 14:49     ` Vincent Guittot
2025-09-23 16:28       ` Frank Li
2025-09-22  6:21   ` Manivannan Sadhasivam
2025-09-23 17:40     ` Vincent Guittot
2025-10-07 15:41     ` Lorenzo Pieralisi
2025-10-07 22:28       ` Manivannan Sadhasivam
2025-10-08  8:26         ` Arnd Bergmann
2025-10-08  8:35           ` Arnd Bergmann
2025-10-08 15:19             ` Manivannan Sadhasivam
2025-10-08 17:56               ` Arnd Bergmann [this message]
2025-10-09 18:47                 ` Manivannan Sadhasivam
2025-10-09 21:16                   ` Arnd Bergmann
2025-10-17 15:12                     ` Manivannan Sadhasivam
2025-10-08 15:14           ` Manivannan Sadhasivam
2025-09-19 15:58 ` [PATCH 2/3 v2] PCI: s32g: Add initial PCIe support (RC) Vincent Guittot
2025-09-19 17:03   ` [External] : " ALOK TIWARI
2025-09-19 18:37   ` Frank Li
2025-09-25 17:09     ` Vincent Guittot
2025-09-22  4:07   ` kernel test robot
2025-09-22  7:56   ` Manivannan Sadhasivam
2025-09-25 16:52     ` Vincent Guittot
2025-09-29 13:57       ` Manivannan Sadhasivam
2025-09-29 16:23         ` Vincent Guittot
2025-09-29 16:32           ` Manivannan Sadhasivam
2025-09-30 16:11             ` Vincent Guittot
2025-09-22 14:52   ` Rob Herring
2025-09-25 16:56     ` Vincent Guittot
2025-09-25 19:15     ` Bjorn Helgaas
2025-09-26 14:18       ` Rob Herring
2025-09-19 15:58 ` [PATCH 3/3 v2] MAINTAINERS: Add MAINTAINER for NXP S32G PCIe driver Vincent Guittot
2025-09-19 16:58   ` Frank Li
2025-09-25 17:16     ` Vincent Guittot

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=3d480f73-15b4-4fb8-8d2b-f9961c1736ca@app.fastmail.com \
    --to=arnd@arndb.de \
    --cc=Frank.li@nxp.com \
    --cc=Ghennadi.Procopciuc@nxp.com \
    --cc=Ionut.Vicovan@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=bogdan.hamciuc@nxp.com \
    --cc=cassel@kernel.org \
    --cc=chester62515@gmail.com \
    --cc=ciprianmarian.costea@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ghennadi.procopciuc@oss.nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=jingoohan1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=larisa.grigore@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=mbrugger@suse.com \
    --cc=robh@kernel.org \
    --cc=s32@nxp.com \
    --cc=vincent.guittot@linaro.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;
as well as URLs for NNTP newsgroup(s).