Linux-RTC Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] rtc: cpcap: move to use request_irq by IRQF_NO_AUTOEN flag
@ 2021-04-07  0:57 Tian Tao
  2021-04-16 23:03 ` Alexandre Belloni
  0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2021-04-07  0:57 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-cpcap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/rtc/rtc-cpcap.c b/drivers/rtc/rtc-cpcap.c
index afc8fcb..c14b838 100644
--- a/drivers/rtc/rtc-cpcap.c
+++ b/drivers/rtc/rtc-cpcap.c
@@ -270,13 +270,13 @@ static int cpcap_rtc_probe(struct platform_device *pdev)
 	rtc->alarm_irq = platform_get_irq(pdev, 0);
 	err = devm_request_threaded_irq(dev, rtc->alarm_irq, NULL,
 					cpcap_rtc_alarm_irq,
-					IRQF_TRIGGER_NONE | IRQF_ONESHOT,
+					IRQF_TRIGGER_NONE | IRQF_ONESHOT |
+					IRQF_NO_AUTOEN,
 					"rtc_alarm", rtc);
 	if (err) {
 		dev_err(dev, "Could not request alarm irq: %d\n", err);
 		return err;
 	}
-	disable_irq(rtc->alarm_irq);
 
 	/* Stock Android uses the 1 Hz interrupt for "secure clock daemon",
 	 * which is not supported by the mainline kernel. The mainline kernel
-- 
2.7.4


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

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

On Wed, 7 Apr 2021 08:57:51 +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: cpcap: move to use request_irq by IRQF_NO_AUTOEN flag
      commit: 1663e293700c4aeff6f06eb1c6529bc07ed0523d

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-07  0:57 [PATCH] rtc: cpcap: move to use request_irq by IRQF_NO_AUTOEN flag Tian Tao
2021-04-16 23:03 ` 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