devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Frank Li <Frank.li@nxp.com>
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
Subject: Re: [PATCH v4 1/3] of: address: Add parent_bus_addr to struct of_pci_range
Date: Thu, 10 Oct 2024 17:54:06 -0500	[thread overview]
Message-ID: <20241010225406.GA583899@bhelgaas> (raw)
In-Reply-To: <ZwhX8I1SIpbRA1OU@lizhi-Precision-Tower-5810>

On Thu, Oct 10, 2024 at 06:40:48PM -0400, Frank Li wrote:
> On Thu, Oct 10, 2024 at 04:57:45PM -0500, Bjorn Helgaas wrote:
> > On Tue, Oct 08, 2024 at 03:53:58PM -0400, Frank Li wrote:
> > > Introduce field 'parent_bus_addr' in of_pci_range to retrieve untranslated
> > > CPU address information.

> It is "untranslated CPU address", previous patch use cpu_untranslate_addr.
> Rob suggest change to parent_bus_addr.
> 
> Is it better change to "to retrieve the address at bus fabric port" instead
> of *untranslated* CPU address

"parent_bus_addr" will hold an untranslated CPU address in some cases,
but not all.  I think it's better to use a generic term like "parent
bus addres" here because that is accurate in all cases.

> > and this "ranges":
> >
> >   ranges = <0x5f000000 0x0 0x5f000000 0x21000000>,
> >            <0x80000000 0x0 0x70000000 0x10000000>;
> >
> > means:
> >
> >   (IA 0x5f000000, CPU 0x0 0x5f000000, length 0x21000000)
> >   (IA 0x80000000, CPU 0x0 0x70000000, length 0x10000000)
> >
> > which would mean:
> >
> >   CPU 0x0_5f000000-0x0_7fffffff -> IA 0x5f000000-0x7fffffff
> >   CPU 0x0_70000000-0x0_7fffffff -> IA 0x80000000-0x8fffffff
> 
> Yes,
> 
> > I must be misunderstanding something because this would mean CPU addr
> > 0x70000000 would translate to IA addr 0x70000000 via the first range
> > and to IA addr 0x80000000 via the second range, which doesn't make
> > sense.
> 
> Yes, it is my mistake, first length should reduce to 0x0100_0000 from
> 0x21000000. It works because dt convert IA to CPU, instead of CPU to
> IA.  for example, input IA: 0x80000000, match second one, convert to
> CPU address 0x0_70000000.

Great, if we can omit 0x5f000000 completely that will avoid the
confusion.  I hope the actual DT doesn't have this error.

Bjorn

  reply	other threads:[~2024-10-10 22:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08 19:53 [PATCH v4 0/3] PCI: dwc: opitimaze RC host pci_fixup_addr() Frank Li
2024-10-08 19:53 ` [PATCH v4 1/3] of: address: Add parent_bus_addr to struct of_pci_range Frank Li
2024-10-10 21:57   ` Bjorn Helgaas
2024-10-10 22:40     ` Frank Li
2024-10-10 22:54       ` Bjorn Helgaas [this message]
2024-10-08 19:53 ` [PATCH v4 2/3] PCI: dwc: Using parent_bus_addr in of_range to eliminate cpu_addr_fixup() Frank Li
2024-10-08 19:54 ` [PATCH v4 3/3] PCI: imx6: Remove cpu_addr_fixup() 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=20241010225406.GA583899@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=Frank.li@nxp.com \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).