From: Greg KH <gregkh@linuxfoundation.org>
To: Barry Song <song.bao.hua@hisilicon.com>
Cc: tglx@linutronix.de, maz@kernel.org, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, linuxarm@openeuler.org,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: Re: [PATCH v2] genirq: add IRQF_NO_AUTOEN for request_irq
Date: Thu, 7 Jan 2021 19:58:15 +0100 [thread overview]
Message-ID: <X/dZxzz5PA37Ie3B@kroah.com> (raw)
In-Reply-To: <20210105021411.34020-1-song.bao.hua@hisilicon.com>
On Tue, Jan 05, 2021 at 03:14:11PM +1300, Barry Song wrote:
> Many drivers don't want interrupts enabled automatically due to
> request_irq(). So they are handling this issue by either way of
> the below two:
> (1)
> irq_set_status_flags(irq, IRQ_NOAUTOEN);
> request_irq(dev, irq...);
> (2)
> request_irq(dev, irq...);
> disable_irq(irq);
>
> The code in the second way is silly and unsafe. In the small time
> gap between request_irq() and disable_irq(), interrupts can still
> come.
> The code in the first way is safe though we might be able to do it
> in the generic irq code.
>
> With this patch, drivers can request_irq with IRQF_NO_AUTOEN flag.
> They will need neither irq_set_status_flags() nor disable_irq().
> Hundreds of drivers with this problem will be handled afterwards.
>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Signed-off-by: Barry Song <song.bao.hua@hisilicon.com>
Can you also convert some in-kernel drivers to this new api so that we
can see how this works?
thanks,
greg k-h
next prev parent reply other threads:[~2021-01-07 18:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 2:14 [PATCH v2] genirq: add IRQF_NO_AUTOEN for request_irq Barry Song
2021-01-07 18:58 ` Greg KH [this message]
2021-01-07 20:40 ` Song Bao Hua (Barry Song)
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=X/dZxzz5PA37Ie3B@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@openeuler.org \
--cc=maz@kernel.org \
--cc=song.bao.hua@hisilicon.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox