[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5602DA77.9090108@caviumnetworks.com>
Date: Wed, 23 Sep 2015 09:59:35 -0700
From: David Daney <ddaney@...iumnetworks.com>
To: Marc Zyngier <marc.zyngier@....com>
CC: David Daney <ddaney.cavm@...il.com>,
<linux-kernel@...r.kernel.org>,
"Will Deacon" <will.deacon@....com>,
Rob Herring <robh+dt@...nel.org>,
Pawel Moll <pawel.moll@....com>,
Mark Rutland <mark.rutland@....com>,
Ian Campbell <ijc+devicetree@...lion.org.uk>,
Kumar Gala <galak@...eaurora.org>,
<linux-arm-kernel@...ts.infradead.org>,
<devicetree@...r.kernel.org>,
"Grant Likely" <grant.likely@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>,
"Jason Cooper" <jason@...edaemon.net>,
David Daney <david.daney@...ium.com>
Subject: Re: [PATCH v2 2/3] of/irq: Add new function of_msi_map_rid()
On 09/23/2015 09:52 AM, Marc Zyngier wrote:
> On Tue, 22 Sep 2015 17:00:05 -0700
> David Daney <ddaney.cavm@...il.com> wrote:
>
>> From: David Daney <david.daney@...ium.com>
>>
>> The device tree property "msi-map" specifies how to create the PCI
>> requester id used in some MSI controllers. Add a new function
>> of_msi_map_rid() that finds the msi-map property and applies its
>> translation to a given requester id.
>>
>> Signed-off-by: David Daney <david.daney@...ium.com>
>> ---
>> drivers/of/irq.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++
>> include/linux/of_irq.h | 7 ++++
>> 2 files changed, 93 insertions(+)
>>
>> diff --git a/drivers/of/irq.c b/drivers/of/irq.c
>> index 55317fa..3f64d2e 100644
>> --- a/drivers/of/irq.c
>> +++ b/drivers/of/irq.c
>> @@ -598,3 +598,89 @@ void of_msi_configure(struct device *dev, struct device_node *np)
[...]
>> + while (!matched && msi_map_len >= 4 * sizeof(__be32)) {
>> + rid_base = be32_to_cpup(msi_map + 0);
>> + phandle = be32_to_cpup(msi_map + 1);
>> + msi_base = be32_to_cpup(msi_map + 2);
>> + rid_len = be32_to_cpup(msi_map + 3);
>
> Rob did suggest to use of_property_read_u32_index() instead of these
> be32_to_cpup(). Not sure if that'd be a major improvement though.
>
I did think about that, but the micro-optimizer in me didn't feel
comfortable with the overhead of rerunning of_find_property() for each
value. I decided to run of_find_property() once, and then iterate
through the individual values within the property.
If there are strong objections to doing it this way, we can change it.
David Daney
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists