From: Tomasz Nowicki <tomasz.nowicki@linaro.org>
To: Marc Zyngier <marc.zyngier@arm.com>,
Thomas Gleixner <tglx@linutronix.de>,
Jiang Liu <jiang.liu@linux.intel.com>,
Jason Cooper <jason@lakedaemon.net>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
Hanjun Guo <hanjun.guo@linaro.org>,
Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>,
Graeme Gregory <graeme@xora.org.uk>,
Jake Oshins <jakeo@microsoft.com>
Subject: Re: [PATCH v2 05/17] irqchip: Convert all alloc/xlate users from of_node to fwnode
Date: Wed, 14 Oct 2015 17:37:55 +0200 [thread overview]
Message-ID: <561E76D3.9070105@linaro.org> (raw)
In-Reply-To: <561E7545.9070305@arm.com>
On 14.10.2015 17:31, Marc Zyngier wrote:
> On 14/10/15 16:26, Tomasz Nowicki wrote:
>> Hi Marc,
>>
>> On 13.10.2015 13:51, Marc Zyngier wrote:
>>> Since we now have a generic data structure to express an
>>> interrupt specifier, convert all hierarchical irqchips that
>>> are OF based to use a fwnode_handle as part of their alloc
>>> and xlate (which becomes translate) callbacks.
>>>
>>> As most of these drivers have dependencies (they exchange IRQ
>>> specifiers), change them all in a single, massive patch...
>>>
>>> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
>>> ---
>>> arch/arm/mach-exynos/suspend.c | 55 ++++++++++++++++---------------
>>> arch/arm/mach-imx/gpc.c | 55 ++++++++++++++++---------------
>>> arch/arm/mach-omap2/omap-wakeupgen.c | 55 ++++++++++++++++---------------
>>> drivers/irqchip/irq-crossbar.c | 62 ++++++++++++++++++----------------
>>> drivers/irqchip/irq-gic-v2m.c | 18 ++++++----
>>> drivers/irqchip/irq-gic-v3-its.c | 20 ++++++-----
>>> drivers/irqchip/irq-gic-v3.c | 49 +++++++++++++--------------
>>> drivers/irqchip/irq-gic.c | 33 ++++++++++++++++---
>>> drivers/irqchip/irq-imx-gpcv2.c | 64 ++++++++++++++++--------------------
>>> drivers/irqchip/irq-mtk-sysirq.c | 49 ++++++++++++++-------------
>>> drivers/irqchip/irq-nvic.c | 18 +++++++---
>>> drivers/irqchip/irq-tegra.c | 55 ++++++++++++++++---------------
>>> drivers/irqchip/irq-vf610-mscm-ir.c | 42 +++++++++++++++--------
>>> 13 files changed, 323 insertions(+), 252 deletions(-)
>>>
>>
>> [...]
>>
>>>
>>> static int its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
>>> diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c
>>> index 5793880..05d010b 100644
>>> --- a/drivers/irqchip/irq-gic-v3.c
>>> +++ b/drivers/irqchip/irq-gic-v3.c
>>> @@ -737,32 +737,30 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq,
>>> return 0;
>>> }
>>>
>>> -static int gic_irq_domain_xlate(struct irq_domain *d,
>>> - struct device_node *controller,
>>> - const u32 *intspec, unsigned int intsize,
>>> - unsigned long *out_hwirq, unsigned int *out_type)
>>> +static int gic_irq_domain_translate(struct irq_domain *d,
>>> + struct irq_fwspec *fwspec,
>>> + unsigned long *hwirq,
>>> + unsigned int *type)
>>> {
>>> - if (irq_domain_get_of_node(d) != controller)
>>> - return -EINVAL;
>>> - if (intsize < 3)
>>> - return -EINVAL;
>>> + if (is_of_node(fwspec->fwnode)) {
>>> + if (fwspec->param_count < 3)
>>> + return -EINVAL;
>>>
>>> - switch(intspec[0]) {
>>> - case 0: /* SPI */
>>> - *out_hwirq = intspec[1] + 32;
>>> - break;
>>> - case 1: /* PPI */
>>> - *out_hwirq = intspec[1] + 16;
>>> - break;
>>> - case GIC_IRQ_TYPE_LPI: /* LPI */
>>> - *out_hwirq = intspec[1];
>>> - break;
>>> - default:
>>> - return -EINVAL;
>>> + /* Get the interrupt number and add 16 to skip over SGIs */
>>> + *hwirq = fwspec->param[1] + 16;
>>> +
>>> + /*
>>> + * For SPIs, we need to add 16 more to get the GIC irq
>>> + * ID number
>>> + */
>>> + if (!fwspec->param[0])
>>> + *hwirq += 16;
>>> +
>>> + *type = fwspec->param[2] & IRQ_TYPE_SENSE_MASK;
>>> + return 0;
>>> }
>>>
>>> - *out_type = intspec[2] & IRQ_TYPE_SENSE_MASK;
>>> - return 0;
>>> + return -EINVAL;
>>> }
>>
>> What about GIC_IRQ_TYPE_LPI type? Previously we leaved interrupt line nr
>> and now +32.
>
> Please see the patch I've posted earlier that address this particular issue:
>
> https://lkml.org/lkml/2015/10/14/272
>
Makes sense, thanks.
Tomasz
next prev parent reply other threads:[~2015-10-14 15:38 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-13 11:51 [PATCH v2 00/17] Divorcing irqdomain and device_node Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 01/17] irqdomain: Use irq_domain_get_of_node() instead of direct field access Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 02/17] irqdomain: Convert irqdomain->of_node to fwnode Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 03/17] irqdomain: Allow irq domain lookup by fwnode Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 04/17] irqdomain: Introduce a firmware-specific IRQ specifier structure Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 05/17] irqchip: Convert all alloc/xlate users from of_node to fwnode Marc Zyngier
2015-10-14 15:26 ` Tomasz Nowicki
2015-10-14 15:31 ` Marc Zyngier
2015-10-14 15:37 ` Tomasz Nowicki [this message]
2015-10-13 11:51 ` [PATCH v2 06/17] irqdomain: Introduce irq_create_fwspec_mapping Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 07/17] irqdomain: Introduce irq_domain_create_{linear, tree} Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 08/17] irqdomain: Add a fwnode_handle allocator Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 09/17] acpi/gsi: Always perform an irq domain lookup Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 10/17] acpi/gsi: Add acpi_set_irq_model to initialize the GSI layer Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 11/17] irqchip/gic: Get rid of gic_init_bases() Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 12/17] irqchip/gic: Switch ACPI support to stacked domains Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 13/17] irqchip/gic: Kill the xlate method Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 14/17] acpi/gsi: Cleanup acpi_register_gsi Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 15/17] irqdomain: Introduce irq_domain_create_hierarchy Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 16/17] irqdomain/msi: Use fwnode instead of of_node Marc Zyngier
2015-10-13 11:51 ` [PATCH v2 17/17] irqdomain: Documentation updates Marc Zyngier
2015-10-13 13:49 ` [PATCH v2 00/17] Divorcing irqdomain and device_node Hanjun Guo
2015-10-13 15:33 ` Hanjun Guo
2015-10-13 15:38 ` Marc Zyngier
2015-10-13 16:39 ` Lorenzo Pieralisi
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=561E76D3.9070105@linaro.org \
--to=tomasz.nowicki@linaro.org \
--cc=Suravee.Suthikulpanit@amd.com \
--cc=graeme@xora.org.uk \
--cc=hanjun.guo@linaro.org \
--cc=jakeo@microsoft.com \
--cc=jason@lakedaemon.net \
--cc=jiang.liu@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=marc.zyngier@arm.com \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).