mbox series

[wireless,v2,0/3] wifi: Use IRQF_NO_AUTOEN flag in request_irq()

Message ID 20240910124314.698896-1-ruanjinjie@huawei.com
Headers show
Series wifi: Use IRQF_NO_AUTOEN flag in request_irq() | expand

Message

Jinjie Ruan Sept. 10, 2024, 12:43 p.m. UTC
As commit cbe16f35bee6 ("genirq: Add IRQF_NO_AUTOEN for request_irq/nmi()")
said, reqeust_irq() and then disable_irq() is unsafe.

And the code below is subobtimal:
	 irq_set_status_flags(irq, IRQ_NOAUTOEN);
	 request_irq(dev, irq...);

IRQF_NO_AUTOEN flag can be used by drivers to request_irq(). It prevents
the automatic enabling of the requested interrupt in the same safe way.
With that the usage can be simplified and corrected.

Only compile-tested.

Changes in v2:
- wireless prefixed subject and submit them in a separate patchset.
- Add fix tag.

Jinjie Ruan (3):
  wifi: p54: Use IRQF_NO_AUTOEN flag in request_irq()
  wifi: mwifiex: Use IRQF_NO_AUTOEN flag in request_irq()
  wifi: wl1251: Use IRQF_NO_AUTOEN flag in request_irq()

 drivers/net/wireless/intersil/p54/p54spi.c  | 4 +---
 drivers/net/wireless/marvell/mwifiex/main.c | 4 ++--
 drivers/net/wireless/ti/wl1251/sdio.c       | 4 ++--
 3 files changed, 5 insertions(+), 7 deletions(-)

Comments

Brian Norris Sept. 10, 2024, 5:17 p.m. UTC | #1
On Tue, Sep 10, 2024 at 08:43:13PM +0800, Jinjie Ruan wrote:
> disable_irq() after request_irq() still has a time gap in which
> interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
> disable IRQ auto-enable when request IRQ.
> 
> Fixes: 853402a00823 ("mwifiex: Enable WoWLAN for both sdio and pcie")
> Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
> ---
> v2:
> - Add fix tag.
> - Wireless patches go to wireless-next, submit them in a separate patchset.
> ---
>  drivers/net/wireless/marvell/mwifiex/main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Acked-by: Brian Norris <briannorris@chromium.org>