Linux-RTC Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] rtc: as3722: move to use request_irq by IRQF_NO_AUTOEN flag
@ 2021-04-06 12:34 Tian Tao
  2021-04-16 22:56 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2021-04-06 12:34 UTC (permalink / raw)
  To: a.zummo, alexandre.belloni; +Cc: linux-rtc, Tian Tao

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(-)

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;
 }
 
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] rtc: as3722: move to use request_irq by IRQF_NO_AUTOEN flag
  2021-04-06 12:34 [PATCH] rtc: as3722: move to use request_irq by IRQF_NO_AUTOEN flag Tian Tao
@ 2021-04-16 22:56 ` Alexandre Belloni
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Belloni @ 2021-04-16 22:56 UTC (permalink / raw)
  To: a.zummo, Tian Tao; +Cc: Alexandre Belloni, linux-rtc

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,
-- 
Alexandre Belloni <alexandre.belloni@bootlin.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 12:34 [PATCH] rtc: as3722: move to use request_irq by IRQF_NO_AUTOEN flag Tian Tao
2021-04-16 22:56 ` Alexandre Belloni

Linux-RTC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rtc/0 linux-rtc/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rtc linux-rtc/ https://lore.kernel.org/linux-rtc \
		linux-rtc@vger.kernel.org
	public-inbox-index linux-rtc

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rtc


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git