diff mbox series

rtc: vr41xx: move to use request_irq by IRQF_NO_AUTOEN flag

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

Commit Message

tiantao \(H\) April 7, 2021, 1:10 a.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-vr41xx.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

Comments

Alexandre Belloni April 16, 2021, 11:04 p.m. UTC | #1
On Wed, 7 Apr 2021 09:10:03 +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: vr41xx: move to use request_irq by IRQF_NO_AUTOEN flag
      commit: 5634f76f6e987e5d5a06cbdc388ca29deda5293d

Best regards,
diff mbox series

Patch

diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c
index 5a9f9ad..1a02b52 100644
--- a/drivers/rtc/rtc-vr41xx.c
+++ b/drivers/rtc/rtc-vr41xx.c
@@ -312,8 +312,8 @@  static int rtc_probe(struct platform_device *pdev)
 		goto err_iounmap_all;
 	}
 
-	retval = devm_request_irq(&pdev->dev, aie_irq, elapsedtime_interrupt, 0,
-				"elapsed_time", pdev);
+	retval = devm_request_irq(&pdev->dev, aie_irq, elapsedtime_interrupt,
+				  IRQF_NO_AUTOEN, "elapsed_time", pdev);
 	if (retval < 0)
 		goto err_iounmap_all;
 
@@ -323,16 +323,13 @@  static int rtc_probe(struct platform_device *pdev)
 		goto err_iounmap_all;
 	}
 
-	retval = devm_request_irq(&pdev->dev, pie_irq, rtclong1_interrupt, 0,
-				"rtclong1", pdev);
+	retval = devm_request_irq(&pdev->dev, pie_irq, rtclong1_interrupt,
+				  IRQF_NO_AUTOEN, "rtclong1", pdev);
 	if (retval < 0)
 		goto err_iounmap_all;
 
 	platform_set_drvdata(pdev, rtc);
 
-	disable_irq(aie_irq);
-	disable_irq(pie_irq);
-
 	dev_info(&pdev->dev, "Real Time Clock of NEC VR4100 series\n");
 
 	retval = devm_rtc_register_device(rtc);