diff mbox series

rtc: as3722: move to use request_irq by IRQF_NO_AUTOEN flag

Message ID 1617712475-32543-1-git-send-email-tiantao6@hisilicon.com
State Accepted
Headers show
Series rtc: as3722: move to use request_irq by IRQF_NO_AUTOEN flag | expand

Commit Message

tiantao \(H\) April 6, 2021, 12:34 p.m. UTC
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 because of requesting.

this patch is made base on "add IRQF_NO_AUTOEN for request_irq" which
is being merged: https://lore.kernel.org/patchwork/patch/1388765/

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/rtc/rtc-as3722.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Alexandre Belloni April 16, 2021, 10:56 p.m. UTC | #1
On Tue, 6 Apr 2021 20:34:35 +0800, Tian Tao 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 because of requesting.
> 
> this patch is made base on "add IRQF_NO_AUTOEN for request_irq" which
> is being merged: https://lore.kernel.org/patchwork/patch/1388765/

Applied, thanks!

[1/1] rtc: as3722: move to use request_irq by IRQF_NO_AUTOEN flag
      commit: 0ecab791d3fdc90ab35cd0f2c0625e11cecf0a83

Best regards,
diff mbox series

Patch

diff --git a/drivers/rtc/rtc-as3722.c b/drivers/rtc/rtc-as3722.c
index 0f21af2..3a0db97 100644
--- a/drivers/rtc/rtc-as3722.c
+++ b/drivers/rtc/rtc-as3722.c
@@ -201,14 +201,13 @@  static int as3722_rtc_probe(struct platform_device *pdev)
 	dev_info(&pdev->dev, "RTC interrupt %d\n", as3722_rtc->alarm_irq);
 
 	ret = devm_request_threaded_irq(&pdev->dev, as3722_rtc->alarm_irq, NULL,
-			as3722_alarm_irq, IRQF_ONESHOT,
+			as3722_alarm_irq, IRQF_ONESHOT | IRQF_NO_AUTOEN,
 			"rtc-alarm", as3722_rtc);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to request alarm IRQ %d: %d\n",
 				as3722_rtc->alarm_irq, ret);
 		return ret;
 	}
-	disable_irq(as3722_rtc->alarm_irq);
 	return 0;
 }