From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Frank Li <Frank.li@nxp.com>
Cc: "Bjorn Helgaas" <bhelgaas@google.com>,
"Richard Zhu" <hongxing.zhu@nxp.com>,
"Lucas Stach" <l.stach@pengutronix.de>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Rob Herring" <robh@kernel.org>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, imx@lists.linux.dev,
alyssa@rosenzweig.io, bpf@vger.kernel.org, broonie@kernel.org,
jgg@ziepe.ca, joro@8bytes.org, lgirdwood@gmail.com,
maz@kernel.org, p.zabel@pengutronix.de, robin.murphy@arm.com,
will@kernel.org
Subject: Re: [PATCH v5 2/2] PCI: imx6: Add IOMMU and ITS MSI support for i.MX95
Date: Tue, 19 Nov 2024 14:46:59 +0530 [thread overview]
Message-ID: <20241119091659.rmdufvdi6jkynvfe@thinkpad> (raw)
In-Reply-To: <ZzTrdUX0NUsHQLvd@lizhi-Precision-Tower-5810>
On Wed, Nov 13, 2024 at 01:09:57PM -0500, Frank Li wrote:
[...]
> > > + for (i = 0; i < IMX95_MAX_LUT; i++) {
> > > + regmap_write(imx_pcie->iomuxc_gpr, IMX95_PE0_LUT_ACSCTRL, IMX95_PEO_LUT_RWA | i);
> > > + regmap_read(imx_pcie->iomuxc_gpr, IMX95_PE0_LUT_DATA1, &data1);
> > > +
> > > + if (!(data1 & IMX95_PE0_LUT_VLD)) {
> > > + if (free < 0)
> > > + free = i;
> >
> > So you don't increment 'free' once it becomes >=0? Why can't you use the loop
> > iterator 'i' itself instead of 'free'?
>
> It is used to find first free slot. This loop check if there are duplicated
> entry. If no duplicated rid entry, then use first free slot.
>
Ah, so you have combined both in one loop. A comment on top would've been
helpful to understand the logic.
[...]
> > > + if (!err_i)
> > > + return imx_pcie_add_lut(imx_pcie, rid, sid_i);
> > > + else if (!err_m)
> > > + /* Hardware auto add 2 bit controller id ahead of stream ID */
> >
> > What is this comment for? I don't find it relevant here.
>
> The comment for why need mask 2bits before config lut. for example, dts
> set stream id is 0xC4, but lut only need 0x4.
>
Ok. It was not super clear. Could you please reword it as below?
"LUT only needs the lower 6 bits of the SID as it will prepend the 2 bit
controller ID by default."
- Mani
--
மணிவண்ணன் சதாசிவம்
next prev parent reply other threads:[~2024-11-19 9:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 19:22 [PATCH v5 0/2] PCI: add enabe(disable)_device() hook for bridge Frank Li
2024-11-04 19:22 ` [PATCH v5 1/2] PCI: Add enable_device() and disable_device() callbacks for bridges Frank Li
2024-11-13 17:15 ` Manivannan Sadhasivam
2024-12-03 20:42 ` Frank Li
2024-12-03 22:39 ` Bjorn Helgaas
2024-11-04 19:23 ` [PATCH v5 2/2] PCI: imx6: Add IOMMU and ITS MSI support for i.MX95 Frank Li
2024-11-13 17:48 ` Manivannan Sadhasivam
2024-11-13 18:09 ` Frank Li
2024-11-19 9:16 ` Manivannan Sadhasivam [this message]
2024-11-13 15:55 ` [PATCH v5 0/2] PCI: add enabe(disable)_device() hook for bridge Frank Li
2024-11-13 17:53 ` Marc Zyngier
2024-11-14 16:48 ` 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=20241119091659.rmdufvdi6jkynvfe@thinkpad \
--to=manivannan.sadhasivam@linaro.org \
--cc=Frank.li@nxp.com \
--cc=alyssa@rosenzweig.io \
--cc=bhelgaas@google.com \
--cc=bpf@vger.kernel.org \
--cc=broonie@kernel.org \
--cc=festevam@gmail.com \
--cc=hongxing.zhu@nxp.com \
--cc=imx@lists.linux.dev \
--cc=jgg@ziepe.ca \
--cc=joro@8bytes.org \
--cc=kernel@pengutronix.de \
--cc=kw@linux.com \
--cc=l.stach@pengutronix.de \
--cc=lgirdwood@gmail.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=maz@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=will@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