All of lore.kernel.org
 help / color / mirror / Atom feed
From: ddaney@caviumnetworks.com (David Daney)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/3] of/irq: Add new function of_msi_map_rid()
Date: Wed, 23 Sep 2015 09:59:35 -0700	[thread overview]
Message-ID: <5602DA77.9090108@caviumnetworks.com> (raw)
In-Reply-To: <20150923175216.3384d7b4@arm.com>

On 09/23/2015 09:52 AM, Marc Zyngier wrote:
> On Tue, 22 Sep 2015 17:00:05 -0700
> David Daney <ddaney.cavm@gmail.com> wrote:
>
>> From: David Daney <david.daney@cavium.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@cavium.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

WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney-M3mlKVOIwJVv6pq1l3V1OdBPR1lH4CV8@public.gmane.org>
To: Marc Zyngier <marc.zyngier-5wv7dgnIgG8@public.gmane.org>
Cc: David Daney <ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Grant Likely
	<grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
	Jason Cooper <jason-NLaQJdtUoK4Be96aLqz0jA@public.gmane.org>,
	David Daney <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v2 2/3] of/irq: Add new function of_msi_map_rid()
Date: Wed, 23 Sep 2015 09:59:35 -0700	[thread overview]
Message-ID: <5602DA77.9090108@caviumnetworks.com> (raw)
In-Reply-To: <20150923175216.3384d7b4-5wv7dgnIgG8@public.gmane.org>

On 09/23/2015 09:52 AM, Marc Zyngier wrote:
> On Tue, 22 Sep 2015 17:00:05 -0700
> David Daney <ddaney.cavm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> From: David Daney <david.daney-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
>>
>> 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-YGCgFSpz5w/QT0dZR+AlfA@public.gmane.org>
>> ---
>>   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 devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: David Daney <ddaney@caviumnetworks.com>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: David Daney <ddaney.cavm@gmail.com>,
	<linux-kernel@vger.kernel.org>,
	"Will Deacon" <will.deacon@arm.com>,
	Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<devicetree@vger.kernel.org>,
	"Grant Likely" <grant.likely@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Jason Cooper" <jason@lakedaemon.net>,
	David Daney <david.daney@cavium.com>
Subject: Re: [PATCH v2 2/3] of/irq: Add new function of_msi_map_rid()
Date: Wed, 23 Sep 2015 09:59:35 -0700	[thread overview]
Message-ID: <5602DA77.9090108@caviumnetworks.com> (raw)
In-Reply-To: <20150923175216.3384d7b4@arm.com>

On 09/23/2015 09:52 AM, Marc Zyngier wrote:
> On Tue, 22 Sep 2015 17:00:05 -0700
> David Daney <ddaney.cavm@gmail.com> wrote:
>
>> From: David Daney <david.daney@cavium.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@cavium.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

  reply	other threads:[~2015-09-23 16:59 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-23  0:00 [PATCH v2 0/3] of, irqchip/gicv3-its: Handle "msi-map" properties David Daney
2015-09-23  0:00 ` David Daney
2015-09-23  0:00 ` David Daney
2015-09-23  0:00 ` [PATCH v2 1/3] Docs: dt: Add PCI MSI map bindings David Daney
2015-09-23  0:00   ` David Daney
2015-09-23  0:00   ` David Daney
2015-09-23 16:37   ` Marc Zyngier
2015-09-23 16:37     ` Marc Zyngier
2015-09-23 16:37     ` Marc Zyngier
2015-09-23  0:00 ` [PATCH v2 2/3] of/irq: Add new function of_msi_map_rid() David Daney
2015-09-23  0:00   ` David Daney
2015-09-23 16:52   ` Marc Zyngier
2015-09-23 16:52     ` Marc Zyngier
2015-09-23 16:52     ` Marc Zyngier
2015-09-23 16:59     ` David Daney [this message]
2015-09-23 16:59       ` David Daney
2015-09-23 16:59       ` David Daney
2015-09-23 17:07   ` Rob Herring
2015-09-23 17:07     ` Rob Herring
2015-09-23 17:07     ` Rob Herring
2015-09-23 17:12     ` David Daney
2015-09-23 17:12       ` David Daney
2015-09-23 17:12       ` David Daney
2015-09-23  0:00 ` [PATCH v2 3/3] irqchip/gicv3-its: Handle OF device tree "msi-map" properties David Daney
2015-09-23  0:00   ` David Daney
2015-09-23 17:01   ` Marc Zyngier
2015-09-23 17:01     ` Marc Zyngier
2015-09-23 17:01     ` Marc Zyngier
2015-09-23 17:08     ` David Daney
2015-09-23 17:08       ` David Daney
2015-09-23 17:08       ` David Daney
2015-09-23 17:52       ` Will Deacon
2015-09-23 17:52         ` Will Deacon
2015-09-23 18:18         ` Marc Zyngier
2015-09-23 18:18           ` Marc Zyngier
2015-09-23 19:23           ` Robin Murphy
2015-09-23 19:23             ` Robin Murphy
2015-09-23 19:23             ` Robin Murphy

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=5602DA77.9090108@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.