* Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:03 ` Russell King - ARM Linux
0 siblings, 0 replies; 27+ messages in thread
From: Russell King - ARM Linux @ 2014-12-01 11:03 UTC (permalink / raw)
To: Liviu Dudau
Cc: Rob Herring, Mark Rutland, Ian Campbell, Thomas Gleixner,
Jason Cooper, Haojian Zhuang, Marc Zyngier,
devicetree@vger.kernel.org, LKML, LAKML
On Mon, Dec 01, 2014 at 10:46:13AM +0000, Liviu Dudau wrote:
> On Mon, Dec 01, 2014 at 10:41:45AM +0000, Russell King - ARM Linux wrote:
> > On Fri, Nov 28, 2014 at 05:55:40PM +0000, Liviu Dudau wrote:
> > > + /*
> > > + * PPIs are optionally configurable, but we cannot distinguish
> > > + * between high and low, nor falling and rising. Change the
> > > + * type so that it passes the next check.
> >
> > This comment could do with a /lot/ of improvement. It sounds like the
> > only reason this code exists is to bypass the check. If that's all
> > that's being done, there's better ways to code it.
>
> Hi Russell,
>
> You are right, all I want to do is bypass the next check because *if*
> the PPIs can be configured, then any combination is valid (edge
> raising/falling, level low/high). In real systems, PPIs tend to be
> configured with active level low. That falls the existing check.
"fails" :)
If all you want to do is to bypass the following check, what's wrong
with actually doing that:
- if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
+ if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
+ type != IRQ_TYPE_EDGE_RISING)
return -EINVAL;
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:03 ` Russell King - ARM Linux
0 siblings, 0 replies; 27+ messages in thread
From: Russell King - ARM Linux @ 2014-12-01 11:03 UTC (permalink / raw)
To: Liviu Dudau
Cc: Rob Herring, Mark Rutland, Ian Campbell, Thomas Gleixner,
Jason Cooper, Haojian Zhuang, Marc Zyngier,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LKML, LAKML
On Mon, Dec 01, 2014 at 10:46:13AM +0000, Liviu Dudau wrote:
> On Mon, Dec 01, 2014 at 10:41:45AM +0000, Russell King - ARM Linux wrote:
> > On Fri, Nov 28, 2014 at 05:55:40PM +0000, Liviu Dudau wrote:
> > > + /*
> > > + * PPIs are optionally configurable, but we cannot distinguish
> > > + * between high and low, nor falling and rising. Change the
> > > + * type so that it passes the next check.
> >
> > This comment could do with a /lot/ of improvement. It sounds like the
> > only reason this code exists is to bypass the check. If that's all
> > that's being done, there's better ways to code it.
>
> Hi Russell,
>
> You are right, all I want to do is bypass the next check because *if*
> the PPIs can be configured, then any combination is valid (edge
> raising/falling, level low/high). In real systems, PPIs tend to be
> configured with active level low. That falls the existing check.
"fails" :)
If all you want to do is to bypass the following check, what's wrong
with actually doing that:
- if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
+ if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
+ type != IRQ_TYPE_EDGE_RISING)
return -EINVAL;
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
--
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
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:19 ` Marc Zyngier
0 siblings, 0 replies; 27+ messages in thread
From: Marc Zyngier @ 2014-12-01 11:19 UTC (permalink / raw)
To: linux-arm-kernel
Hi Russell,
On 01/12/14 11:03, Russell King - ARM Linux wrote:
> On Mon, Dec 01, 2014 at 10:46:13AM +0000, Liviu Dudau wrote:
>> On Mon, Dec 01, 2014 at 10:41:45AM +0000, Russell King - ARM Linux wrote:
>>> On Fri, Nov 28, 2014 at 05:55:40PM +0000, Liviu Dudau wrote:
>>>> + /*
>>>> + * PPIs are optionally configurable, but we cannot distinguish
>>>> + * between high and low, nor falling and rising. Change the
>>>> + * type so that it passes the next check.
>>>
>>> This comment could do with a /lot/ of improvement. It sounds like the
>>> only reason this code exists is to bypass the check. If that's all
>>> that's being done, there's better ways to code it.
>>
>> Hi Russell,
>>
>> You are right, all I want to do is bypass the next check because *if*
>> the PPIs can be configured, then any combination is valid (edge
>> raising/falling, level low/high). In real systems, PPIs tend to be
>> configured with active level low. That falls the existing check.
>
> "fails" :)
>
> If all you want to do is to bypass the following check, what's wrong
> with actually doing that:
>
> - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> + type != IRQ_TYPE_EDGE_RISING)
> return -EINVAL;
>
I think that will require some additional changes to gic_configure_irq
(in irq-gic-common.c).
Thanks,
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:19 ` Marc Zyngier
0 siblings, 0 replies; 27+ messages in thread
From: Marc Zyngier @ 2014-12-01 11:19 UTC (permalink / raw)
To: Russell King - ARM Linux, Liviu Dudau
Cc: Rob Herring, Mark Rutland, Ian Campbell, Thomas Gleixner,
Jason Cooper, Haojian Zhuang, devicetree@vger.kernel.org, LKML,
LAKML
Hi Russell,
On 01/12/14 11:03, Russell King - ARM Linux wrote:
> On Mon, Dec 01, 2014 at 10:46:13AM +0000, Liviu Dudau wrote:
>> On Mon, Dec 01, 2014 at 10:41:45AM +0000, Russell King - ARM Linux wrote:
>>> On Fri, Nov 28, 2014 at 05:55:40PM +0000, Liviu Dudau wrote:
>>>> + /*
>>>> + * PPIs are optionally configurable, but we cannot distinguish
>>>> + * between high and low, nor falling and rising. Change the
>>>> + * type so that it passes the next check.
>>>
>>> This comment could do with a /lot/ of improvement. It sounds like the
>>> only reason this code exists is to bypass the check. If that's all
>>> that's being done, there's better ways to code it.
>>
>> Hi Russell,
>>
>> You are right, all I want to do is bypass the next check because *if*
>> the PPIs can be configured, then any combination is valid (edge
>> raising/falling, level low/high). In real systems, PPIs tend to be
>> configured with active level low. That falls the existing check.
>
> "fails" :)
>
> If all you want to do is to bypass the following check, what's wrong
> with actually doing that:
>
> - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> + type != IRQ_TYPE_EDGE_RISING)
> return -EINVAL;
>
I think that will require some additional changes to gic_configure_irq
(in irq-gic-common.c).
Thanks,
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:19 ` Marc Zyngier
0 siblings, 0 replies; 27+ messages in thread
From: Marc Zyngier @ 2014-12-01 11:19 UTC (permalink / raw)
To: Russell King - ARM Linux, Liviu Dudau
Cc: Rob Herring, Mark Rutland, Ian Campbell, Thomas Gleixner,
Jason Cooper, Haojian Zhuang,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LKML, LAKML
Hi Russell,
On 01/12/14 11:03, Russell King - ARM Linux wrote:
> On Mon, Dec 01, 2014 at 10:46:13AM +0000, Liviu Dudau wrote:
>> On Mon, Dec 01, 2014 at 10:41:45AM +0000, Russell King - ARM Linux wrote:
>>> On Fri, Nov 28, 2014 at 05:55:40PM +0000, Liviu Dudau wrote:
>>>> + /*
>>>> + * PPIs are optionally configurable, but we cannot distinguish
>>>> + * between high and low, nor falling and rising. Change the
>>>> + * type so that it passes the next check.
>>>
>>> This comment could do with a /lot/ of improvement. It sounds like the
>>> only reason this code exists is to bypass the check. If that's all
>>> that's being done, there's better ways to code it.
>>
>> Hi Russell,
>>
>> You are right, all I want to do is bypass the next check because *if*
>> the PPIs can be configured, then any combination is valid (edge
>> raising/falling, level low/high). In real systems, PPIs tend to be
>> configured with active level low. That falls the existing check.
>
> "fails" :)
>
> If all you want to do is to bypass the following check, what's wrong
> with actually doing that:
>
> - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> + type != IRQ_TYPE_EDGE_RISING)
> return -EINVAL;
>
I think that will require some additional changes to gic_configure_irq
(in irq-gic-common.c).
Thanks,
M.
--
Jazz is not dead. It just smells funny...
--
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
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:23 ` Russell King - ARM Linux
0 siblings, 0 replies; 27+ messages in thread
From: Russell King - ARM Linux @ 2014-12-01 11:23 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
> Hi Russell,
>
> On 01/12/14 11:03, Russell King - ARM Linux wrote:
> > If all you want to do is to bypass the following check, what's wrong
> > with actually doing that:
> >
> > - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> > + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> > + type != IRQ_TYPE_EDGE_RISING)
> > return -EINVAL;
> >
>
> I think that will require some additional changes to gic_configure_irq
> (in irq-gic-common.c).
I don't think so - gic_configure_irq() will treat it as a no-op as far
as trying to configure the IRQ settings.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:23 ` Russell King - ARM Linux
0 siblings, 0 replies; 27+ messages in thread
From: Russell King - ARM Linux @ 2014-12-01 11:23 UTC (permalink / raw)
To: Marc Zyngier
Cc: Liviu Dudau, Rob Herring, Mark Rutland, Ian Campbell,
Thomas Gleixner, Jason Cooper, Haojian Zhuang,
devicetree@vger.kernel.org, LKML, LAKML
On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
> Hi Russell,
>
> On 01/12/14 11:03, Russell King - ARM Linux wrote:
> > If all you want to do is to bypass the following check, what's wrong
> > with actually doing that:
> >
> > - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> > + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> > + type != IRQ_TYPE_EDGE_RISING)
> > return -EINVAL;
> >
>
> I think that will require some additional changes to gic_configure_irq
> (in irq-gic-common.c).
I don't think so - gic_configure_irq() will treat it as a no-op as far
as trying to configure the IRQ settings.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:23 ` Russell King - ARM Linux
0 siblings, 0 replies; 27+ messages in thread
From: Russell King - ARM Linux @ 2014-12-01 11:23 UTC (permalink / raw)
To: Marc Zyngier
Cc: Liviu Dudau, Rob Herring, Mark Rutland, Ian Campbell,
Thomas Gleixner, Jason Cooper, Haojian Zhuang,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LKML, LAKML
On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
> Hi Russell,
>
> On 01/12/14 11:03, Russell King - ARM Linux wrote:
> > If all you want to do is to bypass the following check, what's wrong
> > with actually doing that:
> >
> > - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> > + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> > + type != IRQ_TYPE_EDGE_RISING)
> > return -EINVAL;
> >
>
> I think that will require some additional changes to gic_configure_irq
> (in irq-gic-common.c).
I don't think so - gic_configure_irq() will treat it as a no-op as far
as trying to configure the IRQ settings.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
--
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
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:31 ` Marc Zyngier
0 siblings, 0 replies; 27+ messages in thread
From: Marc Zyngier @ 2014-12-01 11:31 UTC (permalink / raw)
To: linux-arm-kernel
On 01/12/14 11:23, Russell King - ARM Linux wrote:
> On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
>> Hi Russell,
>>
>> On 01/12/14 11:03, Russell King - ARM Linux wrote:
>>> If all you want to do is to bypass the following check, what's wrong
>>> with actually doing that:
>>>
>>> - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
>>> + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
>>> + type != IRQ_TYPE_EDGE_RISING)
>>> return -EINVAL;
>>>
>>
>> I think that will require some additional changes to gic_configure_irq
>> (in irq-gic-common.c).
>
> I don't think so - gic_configure_irq() will treat it as a no-op as far
> as trying to configure the IRQ settings.
I agree. But that's following ARM's tradition of making PPIs
non-configurable. I seem to remember that there is at least one
occurrence of a GIC with configurable PPIs (Qualcomm, IIRC).
With this use case in mind, Liviu's patch allows an active-low interrupt
to be correctly configured as level, for example.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:31 ` Marc Zyngier
0 siblings, 0 replies; 27+ messages in thread
From: Marc Zyngier @ 2014-12-01 11:31 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Liviu Dudau, Rob Herring, Mark Rutland, Ian Campbell,
Thomas Gleixner, Jason Cooper, Haojian Zhuang,
devicetree@vger.kernel.org, LKML, LAKML
On 01/12/14 11:23, Russell King - ARM Linux wrote:
> On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
>> Hi Russell,
>>
>> On 01/12/14 11:03, Russell King - ARM Linux wrote:
>>> If all you want to do is to bypass the following check, what's wrong
>>> with actually doing that:
>>>
>>> - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
>>> + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
>>> + type != IRQ_TYPE_EDGE_RISING)
>>> return -EINVAL;
>>>
>>
>> I think that will require some additional changes to gic_configure_irq
>> (in irq-gic-common.c).
>
> I don't think so - gic_configure_irq() will treat it as a no-op as far
> as trying to configure the IRQ settings.
I agree. But that's following ARM's tradition of making PPIs
non-configurable. I seem to remember that there is at least one
occurrence of a GIC with configurable PPIs (Qualcomm, IIRC).
With this use case in mind, Liviu's patch allows an active-low interrupt
to be correctly configured as level, for example.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:31 ` Marc Zyngier
0 siblings, 0 replies; 27+ messages in thread
From: Marc Zyngier @ 2014-12-01 11:31 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Liviu Dudau, Rob Herring, Mark Rutland, Ian Campbell,
Thomas Gleixner, Jason Cooper, Haojian Zhuang,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LKML, LAKML
On 01/12/14 11:23, Russell King - ARM Linux wrote:
> On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
>> Hi Russell,
>>
>> On 01/12/14 11:03, Russell King - ARM Linux wrote:
>>> If all you want to do is to bypass the following check, what's wrong
>>> with actually doing that:
>>>
>>> - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
>>> + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
>>> + type != IRQ_TYPE_EDGE_RISING)
>>> return -EINVAL;
>>>
>>
>> I think that will require some additional changes to gic_configure_irq
>> (in irq-gic-common.c).
>
> I don't think so - gic_configure_irq() will treat it as a no-op as far
> as trying to configure the IRQ settings.
I agree. But that's following ARM's tradition of making PPIs
non-configurable. I seem to remember that there is at least one
occurrence of a GIC with configurable PPIs (Qualcomm, IIRC).
With this use case in mind, Liviu's patch allows an active-low interrupt
to be correctly configured as level, for example.
Thanks,
M.
--
Jazz is not dead. It just smells funny...
--
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
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
2014-12-01 11:31 ` Marc Zyngier
@ 2014-12-01 11:54 ` Russell King - ARM Linux
-1 siblings, 0 replies; 27+ messages in thread
From: Russell King - ARM Linux @ 2014-12-01 11:54 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 01, 2014 at 11:31:05AM +0000, Marc Zyngier wrote:
> On 01/12/14 11:23, Russell King - ARM Linux wrote:
> > On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
> >> Hi Russell,
> >>
> >> On 01/12/14 11:03, Russell King - ARM Linux wrote:
> >>> If all you want to do is to bypass the following check, what's wrong
> >>> with actually doing that:
> >>>
> >>> - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> >>> + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> >>> + type != IRQ_TYPE_EDGE_RISING)
> >>> return -EINVAL;
> >>>
> >>
> >> I think that will require some additional changes to gic_configure_irq
> >> (in irq-gic-common.c).
> >
> > I don't think so - gic_configure_irq() will treat it as a no-op as far
> > as trying to configure the IRQ settings.
>
> I agree. But that's following ARM's tradition of making PPIs
> non-configurable. I seem to remember that there is at least one
> occurrence of a GIC with configurable PPIs (Qualcomm, IIRC).
>
> With this use case in mind, Liviu's patch allows an active-low interrupt
> to be correctly configured as level, for example.
Liviu's patch is nothing more than a hack. It changes (eg) the active
low level to be an active high level with the explicitly stated reason to
bypass a test, and then hopes that the remaining functions do the right
thing.
It would be better to explicitly bypass the test, and then explicitly
handle other cases in gic_configure_irq().
It would be even better to make the code reflect reality right the way
through. If PPIs are non-configurable, then we should return -EINVAL if
trying to set them to a setting which is not supported. For example,
pass through all states to gic_configure_irq(), and have gic_configure_irq()
return whether the state is valid.
Then, gic_configure_irq() can read back the register after trying to set
the appropriate value, and see whether it was taken. If the bits remain
unchanged, then it can decide that the requested mode is not supported,
and return -EINVAL.
In any case, let's not hack the code in the way that Liviu is trying to
do.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:54 ` Russell King - ARM Linux
0 siblings, 0 replies; 27+ messages in thread
From: Russell King - ARM Linux @ 2014-12-01 11:54 UTC (permalink / raw)
To: Marc Zyngier
Cc: Liviu Dudau, Rob Herring, Mark Rutland, Ian Campbell,
Thomas Gleixner, Jason Cooper, Haojian Zhuang,
devicetree@vger.kernel.org, LKML, LAKML
On Mon, Dec 01, 2014 at 11:31:05AM +0000, Marc Zyngier wrote:
> On 01/12/14 11:23, Russell King - ARM Linux wrote:
> > On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
> >> Hi Russell,
> >>
> >> On 01/12/14 11:03, Russell King - ARM Linux wrote:
> >>> If all you want to do is to bypass the following check, what's wrong
> >>> with actually doing that:
> >>>
> >>> - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> >>> + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> >>> + type != IRQ_TYPE_EDGE_RISING)
> >>> return -EINVAL;
> >>>
> >>
> >> I think that will require some additional changes to gic_configure_irq
> >> (in irq-gic-common.c).
> >
> > I don't think so - gic_configure_irq() will treat it as a no-op as far
> > as trying to configure the IRQ settings.
>
> I agree. But that's following ARM's tradition of making PPIs
> non-configurable. I seem to remember that there is at least one
> occurrence of a GIC with configurable PPIs (Qualcomm, IIRC).
>
> With this use case in mind, Liviu's patch allows an active-low interrupt
> to be correctly configured as level, for example.
Liviu's patch is nothing more than a hack. It changes (eg) the active
low level to be an active high level with the explicitly stated reason to
bypass a test, and then hopes that the remaining functions do the right
thing.
It would be better to explicitly bypass the test, and then explicitly
handle other cases in gic_configure_irq().
It would be even better to make the code reflect reality right the way
through. If PPIs are non-configurable, then we should return -EINVAL if
trying to set them to a setting which is not supported. For example,
pass through all states to gic_configure_irq(), and have gic_configure_irq()
return whether the state is valid.
Then, gic_configure_irq() can read back the register after trying to set
the appropriate value, and see whether it was taken. If the bits remain
unchanged, then it can decide that the requested mode is not supported,
and return -EINVAL.
In any case, let's not hack the code in the way that Liviu is trying to
do.
--
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
2014-12-01 11:54 ` Russell King - ARM Linux
@ 2014-12-01 12:36 ` Liviu Dudau
-1 siblings, 0 replies; 27+ messages in thread
From: Liviu Dudau @ 2014-12-01 12:36 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 01, 2014 at 11:54:00AM +0000, Russell King - ARM Linux wrote:
> On Mon, Dec 01, 2014 at 11:31:05AM +0000, Marc Zyngier wrote:
> > On 01/12/14 11:23, Russell King - ARM Linux wrote:
> > > On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
> > >> Hi Russell,
> > >>
> > >> On 01/12/14 11:03, Russell King - ARM Linux wrote:
> > >>> If all you want to do is to bypass the following check, what's wrong
> > >>> with actually doing that:
> > >>>
> > >>> - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> > >>> + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> > >>> + type != IRQ_TYPE_EDGE_RISING)
> > >>> return -EINVAL;
> > >>>
> > >>
> > >> I think that will require some additional changes to gic_configure_irq
> > >> (in irq-gic-common.c).
> > >
> > > I don't think so - gic_configure_irq() will treat it as a no-op as far
> > > as trying to configure the IRQ settings.
> >
> > I agree. But that's following ARM's tradition of making PPIs
> > non-configurable. I seem to remember that there is at least one
> > occurrence of a GIC with configurable PPIs (Qualcomm, IIRC).
> >
> > With this use case in mind, Liviu's patch allows an active-low interrupt
> > to be correctly configured as level, for example.
>
> Liviu's patch is nothing more than a hack. It changes (eg) the active
> low level to be an active high level with the explicitly stated reason to
> bypass a test, and then hopes that the remaining functions do the right
> thing.
I was trying to make the smallest amount of changes possible. Given that
ARM's GICs don't distinguish between high/low or raising/falling all I wanted
was to get the level vs edge type being sticky.
>
> It would be better to explicitly bypass the test, and then explicitly
> handle other cases in gic_configure_irq().
>
> It would be even better to make the code reflect reality right the way
> through. If PPIs are non-configurable, then we should return -EINVAL if
> trying to set them to a setting which is not supported. For example,
> pass through all states to gic_configure_irq(), and have gic_configure_irq()
> return whether the state is valid.
>
> Then, gic_configure_irq() can read back the register after trying to set
> the appropriate value, and see whether it was taken. If the bits remain
> unchanged, then it can decide that the requested mode is not supported,
> and return -EINVAL.
>
> In any case, let's not hack the code in the way that Liviu is trying to
> do.
OK, I will send a v2 patch, doing the right thing.
Best regards,
Liviu
>
> --
> FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
> according to speedtest.net.
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
?\_(?)_/?
^ permalink raw reply [flat|nested] 27+ messages in thread* Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 12:36 ` Liviu Dudau
0 siblings, 0 replies; 27+ messages in thread
From: Liviu Dudau @ 2014-12-01 12:36 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Marc Zyngier, Rob Herring, Mark Rutland, Ian Campbell,
Thomas Gleixner, Jason Cooper, Haojian Zhuang,
devicetree@vger.kernel.org, LKML, LAKML
On Mon, Dec 01, 2014 at 11:54:00AM +0000, Russell King - ARM Linux wrote:
> On Mon, Dec 01, 2014 at 11:31:05AM +0000, Marc Zyngier wrote:
> > On 01/12/14 11:23, Russell King - ARM Linux wrote:
> > > On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
> > >> Hi Russell,
> > >>
> > >> On 01/12/14 11:03, Russell King - ARM Linux wrote:
> > >>> If all you want to do is to bypass the following check, what's wrong
> > >>> with actually doing that:
> > >>>
> > >>> - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> > >>> + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> > >>> + type != IRQ_TYPE_EDGE_RISING)
> > >>> return -EINVAL;
> > >>>
> > >>
> > >> I think that will require some additional changes to gic_configure_irq
> > >> (in irq-gic-common.c).
> > >
> > > I don't think so - gic_configure_irq() will treat it as a no-op as far
> > > as trying to configure the IRQ settings.
> >
> > I agree. But that's following ARM's tradition of making PPIs
> > non-configurable. I seem to remember that there is at least one
> > occurrence of a GIC with configurable PPIs (Qualcomm, IIRC).
> >
> > With this use case in mind, Liviu's patch allows an active-low interrupt
> > to be correctly configured as level, for example.
>
> Liviu's patch is nothing more than a hack. It changes (eg) the active
> low level to be an active high level with the explicitly stated reason to
> bypass a test, and then hopes that the remaining functions do the right
> thing.
I was trying to make the smallest amount of changes possible. Given that
ARM's GICs don't distinguish between high/low or raising/falling all I wanted
was to get the level vs edge type being sticky.
>
> It would be better to explicitly bypass the test, and then explicitly
> handle other cases in gic_configure_irq().
>
> It would be even better to make the code reflect reality right the way
> through. If PPIs are non-configurable, then we should return -EINVAL if
> trying to set them to a setting which is not supported. For example,
> pass through all states to gic_configure_irq(), and have gic_configure_irq()
> return whether the state is valid.
>
> Then, gic_configure_irq() can read back the register after trying to set
> the appropriate value, and see whether it was taken. If the bits remain
> unchanged, then it can decide that the requested mode is not supported,
> and return -EINVAL.
>
> In any case, let's not hack the code in the way that Liviu is trying to
> do.
OK, I will send a v2 patch, doing the right thing.
Best regards,
Liviu
>
> --
> FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
> according to speedtest.net.
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:44 ` Liviu Dudau
0 siblings, 0 replies; 27+ messages in thread
From: Liviu Dudau @ 2014-12-01 11:44 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Dec 01, 2014 at 11:23:02AM +0000, Russell King - ARM Linux wrote:
> On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
> > Hi Russell,
> >
> > On 01/12/14 11:03, Russell King - ARM Linux wrote:
> > > If all you want to do is to bypass the following check, what's wrong
> > > with actually doing that:
> > >
> > > - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> > > + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> > > + type != IRQ_TYPE_EDGE_RISING)
> > > return -EINVAL;
> > >
> >
> > I think that will require some additional changes to gic_configure_irq
> > (in irq-gic-common.c).
>
> I don't think so - gic_configure_irq() will treat it as a no-op as far
> as trying to configure the IRQ settings.
Doesn't that assume then that reset value is correct for the type that
we are trying to program the PPIs?
This is all very academic, as I don't have any real example of a GIC doing
this, but ...
- if the PPI is set at reset value to be level triggered
- and we want to set PPIx to be level LOW triggered
with your proposed patch the change will not happen, right?
Best regards,
Liviu
>
> --
> FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
> according to speedtest.net.
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
?\_(?)_/?
^ permalink raw reply [flat|nested] 27+ messages in thread* Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:44 ` Liviu Dudau
0 siblings, 0 replies; 27+ messages in thread
From: Liviu Dudau @ 2014-12-01 11:44 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Marc Zyngier, Rob Herring, Mark Rutland, Ian Campbell,
Thomas Gleixner, Jason Cooper, Haojian Zhuang,
devicetree@vger.kernel.org, LKML, LAKML
On Mon, Dec 01, 2014 at 11:23:02AM +0000, Russell King - ARM Linux wrote:
> On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
> > Hi Russell,
> >
> > On 01/12/14 11:03, Russell King - ARM Linux wrote:
> > > If all you want to do is to bypass the following check, what's wrong
> > > with actually doing that:
> > >
> > > - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> > > + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> > > + type != IRQ_TYPE_EDGE_RISING)
> > > return -EINVAL;
> > >
> >
> > I think that will require some additional changes to gic_configure_irq
> > (in irq-gic-common.c).
>
> I don't think so - gic_configure_irq() will treat it as a no-op as far
> as trying to configure the IRQ settings.
Doesn't that assume then that reset value is correct for the type that
we are trying to program the PPIs?
This is all very academic, as I don't have any real example of a GIC doing
this, but ...
- if the PPI is set at reset value to be level triggered
- and we want to set PPIx to be level LOW triggered
with your proposed patch the change will not happen, right?
Best regards,
Liviu
>
> --
> FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
> according to speedtest.net.
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 27+ messages in thread* Re: [PATCH] irqchip: gic: Allow interrupt level to be set for PPIs.
@ 2014-12-01 11:44 ` Liviu Dudau
0 siblings, 0 replies; 27+ messages in thread
From: Liviu Dudau @ 2014-12-01 11:44 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Marc Zyngier, Rob Herring, Mark Rutland, Ian Campbell,
Thomas Gleixner, Jason Cooper, Haojian Zhuang,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, LKML, LAKML
On Mon, Dec 01, 2014 at 11:23:02AM +0000, Russell King - ARM Linux wrote:
> On Mon, Dec 01, 2014 at 11:19:41AM +0000, Marc Zyngier wrote:
> > Hi Russell,
> >
> > On 01/12/14 11:03, Russell King - ARM Linux wrote:
> > > If all you want to do is to bypass the following check, what's wrong
> > > with actually doing that:
> > >
> > > - if (type != IRQ_TYPE_LEVEL_HIGH && type != IRQ_TYPE_EDGE_RISING)
> > > + if (gicirq >= 32 && type != IRQ_TYPE_LEVEL_HIGH &&
> > > + type != IRQ_TYPE_EDGE_RISING)
> > > return -EINVAL;
> > >
> >
> > I think that will require some additional changes to gic_configure_irq
> > (in irq-gic-common.c).
>
> I don't think so - gic_configure_irq() will treat it as a no-op as far
> as trying to configure the IRQ settings.
Doesn't that assume then that reset value is correct for the type that
we are trying to program the PPIs?
This is all very academic, as I don't have any real example of a GIC doing
this, but ...
- if the PPI is set at reset value to be level triggered
- and we want to set PPIx to be level LOW triggered
with your proposed patch the change will not happen, right?
Best regards,
Liviu
>
> --
> FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
> according to speedtest.net.
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
--
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
^ permalink raw reply [flat|nested] 27+ messages in thread