From: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: "Nipun Gupta" <nipun.gupta@amd.com>,
"Nikhil Agarwal" <nikhil.agarwal@amd.com>,
"Joerg Roedel" <joro@8bytes.org>, "Will Deacon" <will@kernel.org>,
"Robin Murphy" <robin.murphy@arm.com>,
"Marc Zyngier" <maz@kernel.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Thomas Gleixner" <tglx@kernel.org>,
"Saravana Kannan" <saravanak@kernel.org>,
"Richard Zhu" <hongxing.zhu@nxp.com>,
"Lucas Stach" <l.stach@pengutronix.de>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Frank Li" <Frank.Li@nxp.com>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"Juergen Gross" <jgross@suse.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Oleksandr Tyshchenko" <oleksandr_tyshchenko@epam.com>,
"Konrad Dybcio" <konrad.dybcio@oss.qualcomm.com>,
"Bjorn Andersson" <bjorn.andersson@oss.qualcomm.com>,
"Rob Herring" <robh@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Prakash Gupta" <prakash.gupta@oss.qualcomm.com>,
"Vikash Garodia" <vikash.garodia@oss.qualcomm.com>,
linux-kernel@vger.kernel.org, iommu@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
linux-pci@vger.kernel.org, imx@lists.linux.dev,
xen-devel@lists.xenproject.org, linux-arm-msm@vger.kernel.org,
"Charan Teja Kalla" <charan.kalla@oss.qualcomm.com>
Subject: Re: [PATCH v10 2/3] of: factor arguments passed to of_map_id() into a struct
Date: Mon, 16 Mar 2026 22:37:25 +0530 [thread overview]
Message-ID: <dbfcbc9c-2175-49a3-aee4-434b69cbaece@oss.qualcomm.com> (raw)
In-Reply-To: <dyjdwxaq4oc7ahri3iuhnmobh3gwmn6drhox7t2elep4rlqhuq@fe4gp5t7q5r5>
On 3/12/2026 7:48 PM, Dmitry Baryshkov wrote:
> On Thu, Mar 12, 2026 at 05:12:51PM +0530, Vijayanand Jitta wrote:
>>
>>
>> On 3/10/2026 2:53 AM, Dmitry Baryshkov wrote:
>>> On Mon, Mar 09, 2026 at 01:03:38AM +0530, Vijayanand Jitta wrote:
>>>> From: Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
>>>>
>>>> Change of_map_id() to take a pointer to struct of_phandle_args
>>>> instead of passing target device node and translated IDs separately.
>>>> Update all callers accordingly.
>>>>
>>>> Subsequent patch will make use of the args_count field in
>>>> struct of_phandle_args.
>>>>
>>>> Suggested-by: Rob Herring (Arm) <robh@kernel.org>
>>>> Signed-off-by: Charan Teja Kalla <charan.kalla@oss.qualcomm.com>
>>>> Signed-off-by: Vijayanand Jitta <vijayanand.jitta@oss.qualcomm.com>
>>>> ---
>>>> drivers/cdx/cdx_msi.c | 5 ++-
>>>> drivers/iommu/of_iommu.c | 2 +-
>>>> drivers/irqchip/irq-gic-its-msi-parent.c | 11 ++++--
>>>> drivers/of/base.c | 63 ++++++++++++++++----------------
>>>> drivers/of/irq.c | 8 +++-
>>>> drivers/pci/controller/dwc/pci-imx6.c | 16 ++++++--
>>>> drivers/pci/controller/pcie-apple.c | 5 ++-
>>>> drivers/xen/grant-dma-ops.c | 4 +-
>>>> include/linux/of.h | 12 +++---
>>>> 9 files changed, 76 insertions(+), 50 deletions(-)
>>>>
>>>> diff --git a/drivers/cdx/cdx_msi.c b/drivers/cdx/cdx_msi.c
>>>> index 63b3544ec997..03232b5ffbca 100644
>>>> --- a/drivers/cdx/cdx_msi.c
>>>> +++ b/drivers/cdx/cdx_msi.c
>>>> @@ -121,6 +121,7 @@ static int cdx_msi_prepare(struct irq_domain *msi_domain,
>>>> struct device *dev,
>>>> int nvec, msi_alloc_info_t *info)
>>>> {
>>>> + struct of_phandle_args msi_spec = { .np = NULL };
>>>
>>> Why do you need to set it? Parse functions ignore passed args, don't
>>> they?
>>>
>>
>> The parse function does check arg->np on input — if it is non-NULL,
>> it is used to match only entries targeting that specific node.
>>
>> Also, there is this existing path in drivers/pci/msi/irqdomain.c which
>> pre-sets the node and passes it as input to of_msi_xlate(), so the node
>> pointer is not ignored by the parse code:
>
> Is it only being used for MSIs? If so, can we make that explicit in the
> API by having the 'filter' device_node pointer?
>
Yes, I see this is used only in the MSI path via of_msi_xlate().
By filter do you mean the below changes ? here of_map_id() and of_map_msi_id() would accept the filter
as a separate parameter so that arg becomes a pure output:
int of_map_id(const struct device_node *np, u32 id, const char *map_name,
const char *cells_name, const char *map_mask_name,
const struct device_node *filter_np, struct of_phandle_args *arg);
int of_map_msi_id(const struct device_node *np, u32 id,
const struct device_node *filter_np, struct of_phandle_args *arg);
of_msi_xlate() would then pass *msi_np as filter_np down to of_map_msi_id
and IOMMU callers would pass NULL to of_map_id.
Does this look fine ? I can include this in v11.
Thanks,
Vijay
>>
>> u32 pci_msi_domain_get_msi_rid(struct irq_domain *domain, struct pci_dev *pdev)
>> {
>> struct device_node *of_node;
>> u32 rid = pci_dev_id(pdev);
>>
>> pci_for_each_dma_alias(pdev, get_msi_id_cb, &rid);
>>
>> of_node = irq_domain_get_of_node(domain);
>> rid = of_node ? of_msi_xlate(&pdev->dev, &of_node, rid) :
>> iort_msi_map_id(&pdev->dev, rid);
>>
>> return rid;
>> }
>>
>
next prev parent reply other threads:[~2026-03-16 17:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-08 19:33 [PATCH v10 0/3] of: parsing of multi #{iommu,msi}-cells in maps Vijayanand Jitta
2026-03-08 19:33 ` [PATCH v10 1/3] of: Add convenience wrappers for of_map_id() Vijayanand Jitta
2026-03-09 21:16 ` Dmitry Baryshkov
2026-03-12 11:40 ` Vijayanand Jitta
2026-03-08 19:33 ` [PATCH v10 2/3] of: factor arguments passed to of_map_id() into a struct Vijayanand Jitta
2026-03-09 21:23 ` Dmitry Baryshkov
2026-03-12 11:42 ` Vijayanand Jitta
2026-03-12 14:18 ` Dmitry Baryshkov
2026-03-16 17:07 ` Vijayanand Jitta [this message]
2026-03-16 18:49 ` Dmitry Baryshkov
2026-03-08 19:33 ` [PATCH v10 3/3] of: Respect #{iommu,msi}-cells in maps Vijayanand Jitta
2026-03-09 21:08 ` Bjorn Helgaas
2026-03-12 11:42 ` Vijayanand Jitta
2026-03-09 21:05 ` [PATCH v10 0/3] of: parsing of multi " Bjorn Helgaas
2026-03-12 11:41 ` Vijayanand Jitta
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=dbfcbc9c-2175-49a3-aee4-434b69cbaece@oss.qualcomm.com \
--to=vijayanand.jitta@oss.qualcomm.com \
--cc=Frank.Li@nxp.com \
--cc=bhelgaas@google.com \
--cc=bjorn.andersson@oss.qualcomm.com \
--cc=charan.kalla@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=festevam@gmail.com \
--cc=hongxing.zhu@nxp.com \
--cc=imx@lists.linux.dev \
--cc=iommu@lists.linux.dev \
--cc=jgross@suse.com \
--cc=joro@8bytes.org \
--cc=kernel@pengutronix.de \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=krzk+dt@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=l.stach@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=mani@kernel.org \
--cc=maz@kernel.org \
--cc=nikhil.agarwal@amd.com \
--cc=nipun.gupta@amd.com \
--cc=oleksandr_tyshchenko@epam.com \
--cc=prakash.gupta@oss.qualcomm.com \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=s.hauer@pengutronix.de \
--cc=saravanak@kernel.org \
--cc=sstabellini@kernel.org \
--cc=tglx@kernel.org \
--cc=vikash.garodia@oss.qualcomm.com \
--cc=will@kernel.org \
--cc=xen-devel@lists.xenproject.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