* [PATCH] genirq: error reporting for non-percpu interrupt in request_percpu_irq()
@ 2013-10-18 10:06 Vinayak Kale
2013-10-18 10:09 ` Vinayak Kale
2013-10-18 10:31 ` Will Deacon
0 siblings, 2 replies; 7+ messages in thread
From: Vinayak Kale @ 2013-10-18 10:06 UTC (permalink / raw)
To: linux-arm-kernel
Return a separate error code when a non-percpu interrupt is passed to
request_percpu_irq().
Suggested-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Vinayak Kale <vkale@apm.com>
---
kernel/irq/manage.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 514bcfd..c2713ae 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1671,10 +1671,12 @@ int request_percpu_irq(unsigned int irq, irq_handler_t handler,
return -EINVAL;
desc = irq_to_desc(irq);
- if (!desc || !irq_settings_can_request(desc) ||
- !irq_settings_is_per_cpu_devid(desc))
+ if (!desc || !irq_settings_can_request(desc))
return -EINVAL;
+ if (!irq_settings_is_per_cpu_devid(desc))
+ return -EPERM;
+
action = kzalloc(sizeof(struct irqaction), GFP_KERNEL);
if (!action)
return -ENOMEM;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] genirq: error reporting for non-percpu interrupt in request_percpu_irq()
2013-10-18 10:06 [PATCH] genirq: error reporting for non-percpu interrupt in request_percpu_irq() Vinayak Kale
@ 2013-10-18 10:09 ` Vinayak Kale
2013-10-29 12:59 ` Thomas Gleixner
2013-10-18 10:31 ` Will Deacon
1 sibling, 1 reply; 7+ messages in thread
From: Vinayak Kale @ 2013-10-18 10:09 UTC (permalink / raw)
To: linux-arm-kernel
Need for this patch is discussed in mail-thread [1].
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-October/204414.html
Thanks
-Vinayak
On Fri, Oct 18, 2013 at 3:36 PM, Vinayak Kale <vkale@apm.com> wrote:
> Return a separate error code when a non-percpu interrupt is passed to
> request_percpu_irq().
>
> Suggested-by: Will Deacon <will.deacon@arm.com>
> Signed-off-by: Vinayak Kale <vkale@apm.com>
> ---
> kernel/irq/manage.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index 514bcfd..c2713ae 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -1671,10 +1671,12 @@ int request_percpu_irq(unsigned int irq, irq_handler_t handler,
> return -EINVAL;
>
> desc = irq_to_desc(irq);
> - if (!desc || !irq_settings_can_request(desc) ||
> - !irq_settings_is_per_cpu_devid(desc))
> + if (!desc || !irq_settings_can_request(desc))
> return -EINVAL;
>
> + if (!irq_settings_is_per_cpu_devid(desc))
> + return -EPERM;
> +
> action = kzalloc(sizeof(struct irqaction), GFP_KERNEL);
> if (!action)
> return -ENOMEM;
> --
> 1.7.9.5
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] genirq: error reporting for non-percpu interrupt in request_percpu_irq()
2013-10-18 10:09 ` Vinayak Kale
@ 2013-10-29 12:59 ` Thomas Gleixner
2013-10-29 16:15 ` Vinayak Kale
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Gleixner @ 2013-10-29 12:59 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 18 Oct 2013, Vinayak Kale wrote:
> Need for this patch is discussed in mail-thread [1].
>
> [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2013-October/204414.html
>
I can't see anything which makes use of the separate error code in
that patch.
Thanks,
tglx
> On Fri, Oct 18, 2013 at 3:36 PM, Vinayak Kale <vkale@apm.com> wrote:
> > Return a separate error code when a non-percpu interrupt is passed to
> > request_percpu_irq().
> >
> > Suggested-by: Will Deacon <will.deacon@arm.com>
> > Signed-off-by: Vinayak Kale <vkale@apm.com>
> > ---
> > kernel/irq/manage.c | 6 ++++--
> > 1 file changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> > index 514bcfd..c2713ae 100644
> > --- a/kernel/irq/manage.c
> > +++ b/kernel/irq/manage.c
> > @@ -1671,10 +1671,12 @@ int request_percpu_irq(unsigned int irq, irq_handler_t handler,
> > return -EINVAL;
> >
> > desc = irq_to_desc(irq);
> > - if (!desc || !irq_settings_can_request(desc) ||
> > - !irq_settings_is_per_cpu_devid(desc))
> > + if (!desc || !irq_settings_can_request(desc))
> > return -EINVAL;
> >
> > + if (!irq_settings_is_per_cpu_devid(desc))
> > + return -EPERM;
> > +
> > action = kzalloc(sizeof(struct irqaction), GFP_KERNEL);
> > if (!action)
> > return -ENOMEM;
> > --
> > 1.7.9.5
> >
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] genirq: error reporting for non-percpu interrupt in request_percpu_irq()
2013-10-18 10:06 [PATCH] genirq: error reporting for non-percpu interrupt in request_percpu_irq() Vinayak Kale
2013-10-18 10:09 ` Vinayak Kale
@ 2013-10-18 10:31 ` Will Deacon
2013-10-18 11:03 ` Vinayak Kale
1 sibling, 1 reply; 7+ messages in thread
From: Will Deacon @ 2013-10-18 10:31 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Oct 18, 2013 at 11:06:29AM +0100, Vinayak Kale wrote:
> Return a separate error code when a non-percpu interrupt is passed to
> request_percpu_irq().
>
> Suggested-by: Will Deacon <will.deacon@arm.com>
> Signed-off-by: Vinayak Kale <vkale@apm.com>
> ---
> kernel/irq/manage.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
> index 514bcfd..c2713ae 100644
> --- a/kernel/irq/manage.c
> +++ b/kernel/irq/manage.c
> @@ -1671,10 +1671,12 @@ int request_percpu_irq(unsigned int irq, irq_handler_t handler,
> return -EINVAL;
>
> desc = irq_to_desc(irq);
> - if (!desc || !irq_settings_can_request(desc) ||
> - !irq_settings_is_per_cpu_devid(desc))
> + if (!desc || !irq_settings_can_request(desc))
> return -EINVAL;
>
> + if (!irq_settings_is_per_cpu_devid(desc))
> + return -EPERM;
<bikeshedding> I reckon -ENODEV is clearer here. </bikeshedding>
Also, there's a counterpart to this code in request_threaded_irq, where I
think we should do something similar.
Will
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] genirq: error reporting for non-percpu interrupt in request_percpu_irq()
2013-10-18 10:31 ` Will Deacon
@ 2013-10-18 11:03 ` Vinayak Kale
2013-10-18 14:12 ` Vinayak Kale
0 siblings, 1 reply; 7+ messages in thread
From: Vinayak Kale @ 2013-10-18 11:03 UTC (permalink / raw)
To: linux-arm-kernel
Hi Will,
On Fri, Oct 18, 2013 at 4:01 PM, Will Deacon <will.deacon@arm.com> wrote:
> On Fri, Oct 18, 2013 at 11:06:29AM +0100, Vinayak Kale wrote:
>> Return a separate error code when a non-percpu interrupt is passed to
>> request_percpu_irq().
>>
>> Suggested-by: Will Deacon <will.deacon@arm.com>
>> Signed-off-by: Vinayak Kale <vkale@apm.com>
>> ---
>> kernel/irq/manage.c | 6 ++++--
>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
>> index 514bcfd..c2713ae 100644
>> --- a/kernel/irq/manage.c
>> +++ b/kernel/irq/manage.c
>> @@ -1671,10 +1671,12 @@ int request_percpu_irq(unsigned int irq, irq_handler_t handler,
>> return -EINVAL;
>>
>> desc = irq_to_desc(irq);
>> - if (!desc || !irq_settings_can_request(desc) ||
>> - !irq_settings_is_per_cpu_devid(desc))
>> + if (!desc || !irq_settings_can_request(desc))
>> return -EINVAL;
>>
>> + if (!irq_settings_is_per_cpu_devid(desc))
>> + return -EPERM;
>
> <bikeshedding> I reckon -ENODEV is clearer here. </bikeshedding>
I looked at the issue as "operation not allowed since interrupt is
non-percpu" and I found below comment for EPERM in
'include/uapi/asm-generic/errno-base.h' . So thought this error code
could be more fitting.
#define EPERM 1 /* Operation not permitted */
>
> Also, there's a counterpart to this code in request_threaded_irq, where I
> think we should do something similar.
So in request_threaded_irq, we would still keep the WARN_ON for percpu
interrupt and return a different error code. Is my understanding
correct?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] genirq: error reporting for non-percpu interrupt in request_percpu_irq()
2013-10-18 11:03 ` Vinayak Kale
@ 2013-10-18 14:12 ` Vinayak Kale
0 siblings, 0 replies; 7+ messages in thread
From: Vinayak Kale @ 2013-10-18 14:12 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Oct 18, 2013 at 4:33 PM, Vinayak Kale <vkale@apm.com> wrote:
> Hi Will,
>
>
> On Fri, Oct 18, 2013 at 4:01 PM, Will Deacon <will.deacon@arm.com> wrote:
>> On Fri, Oct 18, 2013 at 11:06:29AM +0100, Vinayak Kale wrote:
>>> Return a separate error code when a non-percpu interrupt is passed to
>>> request_percpu_irq().
>>>
>>> Suggested-by: Will Deacon <will.deacon@arm.com>
>>> Signed-off-by: Vinayak Kale <vkale@apm.com>
>>> ---
>>> kernel/irq/manage.c | 6 ++++--
>>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
>>> index 514bcfd..c2713ae 100644
>>> --- a/kernel/irq/manage.c
>>> +++ b/kernel/irq/manage.c
>>> @@ -1671,10 +1671,12 @@ int request_percpu_irq(unsigned int irq, irq_handler_t handler,
>>> return -EINVAL;
>>>
>>> desc = irq_to_desc(irq);
>>> - if (!desc || !irq_settings_can_request(desc) ||
>>> - !irq_settings_is_per_cpu_devid(desc))
>>> + if (!desc || !irq_settings_can_request(desc))
>>> return -EINVAL;
>>>
>>> + if (!irq_settings_is_per_cpu_devid(desc))
>>> + return -EPERM;
>>
>> <bikeshedding> I reckon -ENODEV is clearer here. </bikeshedding>
>
> I looked at the issue as "operation not allowed since interrupt is
> non-percpu" and I found below comment for EPERM in
> 'include/uapi/asm-generic/errno-base.h' . So thought this error code
> could be more fitting.
>
> #define EPERM 1 /* Operation not permitted */
>
>>
>> Also, there's a counterpart to this code in request_threaded_irq, where I
>> think we should do something similar.
>
> So in request_threaded_irq, we would still keep the WARN_ON for percpu
> interrupt and return a different error code. Is my understanding
> correct?
Please ignore my this comment.
If we do something similar in request_threaded_irq then we will have
to remove WARN_ON for percpu interrupt.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2013-10-29 16:15 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-18 10:06 [PATCH] genirq: error reporting for non-percpu interrupt in request_percpu_irq() Vinayak Kale
2013-10-18 10:09 ` Vinayak Kale
2013-10-29 12:59 ` Thomas Gleixner
2013-10-29 16:15 ` Vinayak Kale
2013-10-18 10:31 ` Will Deacon
2013-10-18 11:03 ` Vinayak Kale
2013-10-18 14:12 ` Vinayak Kale
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox