From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Grant Likely <grant.likely@secretlab.ca>,
devicetree-discuss@lists.ozlabs.org,
linux-kernel@vger.kernel.org,
Andres Salomon <dilinger@queued.net>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [RFC PATCH] irq: add irq_domain translation infrastructure
Date: Mon, 27 Jun 2011 11:57:46 +0200 [thread overview]
Message-ID: <4E08541A.4060302@linutronix.de> (raw)
In-Reply-To: <1309166659.32158.380.camel@pasglop>
Benjamin Herrenschmidt wrote:
> On Mon, 2011-06-27 at 11:00 +0200, Sebastian Andrzej Siewior wrote:
>> * Grant Likely | 2011-05-26 00:54:38 [-0600]:
>>
>>> diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
>>> index 39645b6..9891cd4 100644
>>> --- a/arch/x86/kernel/devicetree.c
>>> +++ b/arch/x86/kernel/devicetree.c
>>> @@ -371,36 +321,49 @@ static struct of_ioapic_type of_ioapic_type[] =
>>> },
>>> };
>>>
>>> -static int ioapic_xlate(struct irq_domain *id, const u32 *intspec, u32 intsize,
>>> - u32 *out_hwirq, u32 *out_type)
>>> +static int ioapic_dt_translate(struct irq_domain *domain,
>>> + struct device_node *controller,
>>> + const u32 *intspec, u32 intsize,
>>> + irq_hw_number_t *out_hwirq, u32 *out_type)
>>> {
>>> - struct mp_ioapic_gsi *gsi_cfg;
>>> struct io_apic_irq_attr attr;
>>> struct of_ioapic_type *it;
>>> u32 line, idx, type;
>>> + int rc;
>>>
>>> - if (intsize < 2)
>>> + if (controller != domain->of_node)
>>> return -EINVAL;
>> Is there a reason not havining the (controller != domain->of_node) check
>> in irq_create_of_mapping()?
>
> Not all domains are associated with a single OF node.
>
> Take xics, where there can be quite a few "source controllers" which act
> as device-tree interrupt parents but there's a single global domain.
I see. No, actually I don't. xics is pseries where I don't see the .dts.
So you are saying that we have one irq_domain but 2+ different
interrupt-parents nodes?
How do you distinguish then between two different controllers lets say
xics and a gpio based controller? This implementation calls ->dt_translate
until one controller returns 0 which looks like brute force.
xics_host_xlate() returns always zero so you would have to go for
the compatible and check it.
Every device has an interrupt-parent node. Shouldn't the code call exact
this irq controller xlate function instead of trying them all?
>
> Cheers,
> Ben.
>
Sebastian
WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Andrzej Siewior <bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
To: Benjamin Herrenschmidt
<benh-XVmvHMARGAS8U2dJNN8I7kB+6BGkLq7r@public.gmane.org>
Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org,
Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Andres Salomon <dilinger-pFFUokh25LWsTnJN9+BGXg@public.gmane.org>
Subject: Re: [RFC PATCH] irq: add irq_domain translation infrastructure
Date: Mon, 27 Jun 2011 11:57:46 +0200 [thread overview]
Message-ID: <4E08541A.4060302@linutronix.de> (raw)
In-Reply-To: <1309166659.32158.380.camel@pasglop>
Benjamin Herrenschmidt wrote:
> On Mon, 2011-06-27 at 11:00 +0200, Sebastian Andrzej Siewior wrote:
>> * Grant Likely | 2011-05-26 00:54:38 [-0600]:
>>
>>> diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
>>> index 39645b6..9891cd4 100644
>>> --- a/arch/x86/kernel/devicetree.c
>>> +++ b/arch/x86/kernel/devicetree.c
>>> @@ -371,36 +321,49 @@ static struct of_ioapic_type of_ioapic_type[] =
>>> },
>>> };
>>>
>>> -static int ioapic_xlate(struct irq_domain *id, const u32 *intspec, u32 intsize,
>>> - u32 *out_hwirq, u32 *out_type)
>>> +static int ioapic_dt_translate(struct irq_domain *domain,
>>> + struct device_node *controller,
>>> + const u32 *intspec, u32 intsize,
>>> + irq_hw_number_t *out_hwirq, u32 *out_type)
>>> {
>>> - struct mp_ioapic_gsi *gsi_cfg;
>>> struct io_apic_irq_attr attr;
>>> struct of_ioapic_type *it;
>>> u32 line, idx, type;
>>> + int rc;
>>>
>>> - if (intsize < 2)
>>> + if (controller != domain->of_node)
>>> return -EINVAL;
>> Is there a reason not havining the (controller != domain->of_node) check
>> in irq_create_of_mapping()?
>
> Not all domains are associated with a single OF node.
>
> Take xics, where there can be quite a few "source controllers" which act
> as device-tree interrupt parents but there's a single global domain.
I see. No, actually I don't. xics is pseries where I don't see the .dts.
So you are saying that we have one irq_domain but 2+ different
interrupt-parents nodes?
How do you distinguish then between two different controllers lets say
xics and a gpio based controller? This implementation calls ->dt_translate
until one controller returns 0 which looks like brute force.
xics_host_xlate() returns always zero so you would have to go for
the compatible and check it.
Every device has an interrupt-parent node. Shouldn't the code call exact
this irq controller xlate function instead of trying them all?
>
> Cheers,
> Ben.
>
Sebastian
next prev parent reply other threads:[~2011-06-27 9:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-26 6:54 [RFC PATCH] irq: add irq_domain translation infrastructure Grant Likely
2011-05-26 6:54 ` Grant Likely
2011-06-27 9:00 ` Sebastian Andrzej Siewior
2011-06-27 9:00 ` Sebastian Andrzej Siewior
2011-06-27 9:24 ` Benjamin Herrenschmidt
2011-06-27 9:24 ` Benjamin Herrenschmidt
2011-06-27 9:57 ` Sebastian Andrzej Siewior [this message]
2011-06-27 9:57 ` Sebastian Andrzej Siewior
2011-06-27 10:14 ` Benjamin Herrenschmidt
2011-06-27 10:14 ` Benjamin Herrenschmidt
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=4E08541A.4060302@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=benh@kernel.crashing.org \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=dilinger@queued.net \
--cc=grant.likely@secretlab.ca \
--cc=linux-kernel@vger.kernel.org \
--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 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.