public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Robin Murphy <robin.murphy@arm.com>
To: "Frank Li" <Frank.Li@nxp.com>,
	"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>,
	"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
	"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>
Cc: 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, will@kernel.org
Subject: Re: [PATCH v3 2/2] PCI: imx6: Add IOMMU and ITS MSI support for i.MX95
Date: Fri, 1 Nov 2024 17:23:06 +0000	[thread overview]
Message-ID: <391c735a-7daf-4256-8998-952652799dda@arm.com> (raw)
In-Reply-To: <20241024-imx95_lut-v3-2-7509c9bbab86@nxp.com>

On 2024-10-24 11:34 pm, Frank Li wrote:
[...]
> +static int imx_pcie_enable_device(struct pci_host_bridge *bridge, struct pci_dev *pdev)
> +{
> +	u32 sid_i = 0, sid_m = 0, rid = pci_dev_id(pdev);
> +	struct device_node *target;
> +	struct imx_pcie *imx_pcie;
> +	struct device *dev;
> +	int err_i, err_m;
> +
> +	imx_pcie = to_imx_pcie(to_dw_pcie_from_pp(bridge->sysdata));
> +	dev = imx_pcie->pci->dev;
> +
> +	target = NULL;
> +	err_i = of_map_id(dev->of_node, rid, "iommu-map", "iommu-map-mask", &target, &sid_i);

No, you still need to actually check "target" at this point - if it is 
now set, a mapping was found and "sid_i" is valid, otherwise if it still 
NULL, no mapping exists even if "err_i" is 0 (i.e. an "iommu-map" 
property was found, but did not contain any entries matching "rid" as 
input). Note that the target node is returned with a reference held, so 
needs an of_node_put() as well.

Thanks,
Robin.

> +	target = NULL;
> +	err_m = of_map_id(dev->of_node, rid, "msi-map", "msi-map-mask", &target, &sid_m);


  reply	other threads:[~2024-11-01 17:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24 22:34 [PATCH v3 0/2] PCI: add enabe(disable)_device() hook for bridge Frank Li
2024-10-24 22:34 ` [PATCH v3 1/2] PCI: Add enable_device() and disable_device() callbacks for bridges Frank Li
2024-10-30 21:00   ` Bjorn Helgaas
2024-11-01 16:58     ` Marc Zyngier
2024-11-02 11:10   ` Manivannan Sadhasivam
2024-11-02 11:32     ` Marc Zyngier
2024-11-02 11:54       ` Manivannan Sadhasivam
2024-11-02 12:24         ` Marc Zyngier
2024-11-02 12:48           ` Manivannan Sadhasivam
2024-10-24 22:34 ` [PATCH v3 2/2] PCI: imx6: Add IOMMU and ITS MSI support for i.MX95 Frank Li
2024-11-01 17:23   ` Robin Murphy [this message]
2024-11-02 11:49   ` Manivannan Sadhasivam
2024-11-02 17:26     ` Frank Li
2024-11-02 22:18       ` Marc Zyngier
2024-11-03  6:23       ` Manivannan Sadhasivam

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=391c735a-7daf-4256-8998-952652799dda@arm.com \
    --to=robin.murphy@arm.com \
    --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=manivannan.sadhasivam@linaro.org \
    --cc=maz@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --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