[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPrCYkcwG62tE6g5p79mYbiCgJoFz_GkqUc0VA97_M1jKwS84g@mail.gmail.com>
Date: Fri, 18 Oct 2013 19:42:44 +0530
From: Vinayak Kale <vkale@....com>
To: Will Deacon <will.deacon@....com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"tglx@...utronix.de" <tglx@...utronix.de>
Subject: Re: [PATCH] genirq: error reporting for non-percpu interrupt in request_percpu_irq()
On Fri, Oct 18, 2013 at 4:33 PM, Vinayak Kale <vkale@....com> wrote:
> Hi Will,
>
>
> On Fri, Oct 18, 2013 at 4:01 PM, Will Deacon <will.deacon@....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@....com>
>>> Signed-off-by: Vinayak Kale <vkale@....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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists