mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Esben Haabendal" <esbenhaabendal@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add support for IRQ_NOAUTOEN in __set_irq_handler
Date: Fri, 20 Jun 2008 10:19:55 +0200	[thread overview]
Message-ID: <d2b9ea600806200119h665dd355u9122a09ce3b91045@mail.gmail.com> (raw)
In-Reply-To: <485AB581.9070509@doredevelopment.dk>

Currently, IRQ_NOAUTOEN is only supported with request_irq, and not fx.
set_irq_chained_handler(). As the IRQ_NOAUTOEN flag is silently ignored by
__set_irq_handler, you risk writing faulty code that start with irq enabled
although the developer expects irq disabled.

If the flag is not handled, wouldn't it make sense to return an error?

/Esben

On Thu, Jun 19, 2008 at 9:37 PM, Esben Haabendal <eha@doredevelopment.dk> wrote:
>
> Any reason for __set_irq_handler not supporting the IRQ_NOAUTOEN flag?
>
> /Esben
>
>  kernel/irq/chip.c |   11 ++++++++---
>  1 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
> index 964964b..42bb163 100644
> --- a/kernel/irq/chip.c
> +++ b/kernel/irq/chip.c
> @@ -584,10 +584,15 @@ __set_irq_handler(unsigned int irq,
> irq_flow_handler_t handle, int is_chained,
>        desc->name = name;
>
>        if (handle != handle_bad_irq && is_chained) {
> -               desc->status &= ~IRQ_DISABLED;
>                desc->status |= IRQ_NOREQUEST | IRQ_NOPROBE;
> -               desc->depth = 0;
> -               desc->chip->unmask(irq);
> +               if (!(desc->status & IRQ_NOAUTOEN)) {
> +                       desc->depth = 0;
> +                       desc->status &= ~IRQ_DISABLED;
> +                       desc->chip->unmask(irq);
> +               } else {
> +                       /* Undo nested disables: */
> +                       desc->depth = 1;
> +               }
>        }
>        spin_unlock_irqrestore(&desc->lock, flags);
>  }

      reply	other threads:[~2008-06-20  8:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-19 19:37 Esben Haabendal
2008-06-20  8:19 ` Esben Haabendal [this message]

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=d2b9ea600806200119h665dd355u9122a09ce3b91045@mail.gmail.com \
    --to=esbenhaabendal@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

Powered by JetHome