[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2f0b9803-55ad-4425-85f9-60846fc4bd4e@oss.qualcomm.com>
Date: Wed, 26 Nov 2025 23:00:01 +0530
From: Charan Teja Kalla <charan.kalla@....qualcomm.com>
To: Robin Murphy <robin.murphy@....com>, will@...nel.org, joro@...tes.org,
robh@...nel.org, dmitry.baryshkov@....qualcomm.com,
konrad.dybcio@....qualcomm.com, bjorn.andersson@....qualcomm.com,
bod@...nel.org, conor+dt@...nel.org, krzk+dt@...nel.org,
saravanak@...gle.com, prakash.gupta@....qualcomm.com,
vikash.garodia@....qualcomm.com
Cc: iommu@...ts.linux.dev, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH 0/6] of: iommu-map parsing for multi-cell IOMMU
Thanks a lot Robin!!
On 11/24/2025 10:21 PM, Robin Murphy wrote:
>> ----------------------8888---------------------------------------------
>>
>> diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
>> index a511ecf21fcd..ac005e70de7d 100644
>> --- a/drivers/iommu/of_iommu.c
>> +++ b/drivers/iommu/of_iommu.c
>> @@ -16,6 +16,7 @@
>> #include <linux/pci.h>
>> #include <linux/slab.h>
>> #include <linux/fsl/mc.h>
>> +#include <linux/platform_device.h>
>> #include "iommu-priv.h"
>> @@ -41,6 +42,18 @@ static int of_iommu_xlate(struct device *dev,
>> return ret;
>> }
>> +static int of_iommu_configure_cb(void *arg, u32 *id_out)
>> +{
>> + struct of_phandle_args *iommu_spec =
>> + (struct of_phandle_args *)((void *)id_out - offsetof(struct
>> of_phandle_args, args));
>
> Not sure whether to be impressed or disgusted... If we are to take a
> callback approach then it should probably standardise on passing a full
> of_phandle_args to encode the map output. Particularly given what I've
> just noticed below...
>
Sure... will make patches based on this...
>> + struct device *dev = arg;
>> + int err;
>> +
>> + err = of_iommu_xlate(dev, iommu_spec);
>> + of_node_put(iommu_spec->np);
>> + return err;
>> +}
>> +
>> static int of_iommu_configure_dev_id(struct device_node *master_np,
>> struct device *dev,
>> const u32 *id)
>> @@ -48,12 +61,10 @@ static int of_iommu_configure_dev_id(struct
>> device_node *master_np,
>> struct of_phandle_args iommu_spec = { .args_count = 1 };
>
> Oh dear, I totally overlooked this, and off the top of my head I'm not
> sure it's simple to fix 🙁
>
> So it's still not actually working as intended. Oh well, I did say it
> was untested...
I assume you are talking about the .args_count here, since of_map_id()
filling id_out, should we also pass the &args_count and let of_map_id()
fill that(with cell_count) or as you mentioned, pass the complete
of_phandle_args ?
Thanks,
Charan
Powered by blists - more mailing lists