linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtc: st-lpc: move to use request_irq by IRQF_NO_AUTOEN flag
@ 2021-04-07  2:18 Tian Tao
  2021-04-08  8:04 ` Patrice CHOTARD
  2021-04-16 23:04 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Tian Tao @ 2021-04-07  2:18 UTC (permalink / raw)
  To: patrice.chotard, a.zummo, alexandre.belloni
  Cc: linux-arm-kernel, 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-st-lpc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c
index bdb20f6..2df2179 100644
--- a/drivers/rtc/rtc-st-lpc.c
+++ b/drivers/rtc/rtc-st-lpc.c
@@ -218,15 +218,14 @@ static int st_rtc_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler, 0,
-			       pdev->name, rtc);
+	ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler,
+			       IRQF_NO_AUTOEN, pdev->name, rtc);
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to request irq %i\n", rtc->irq);
 		return ret;
 	}
 
 	enable_irq_wake(rtc->irq);
-	disable_irq(rtc->irq);
 
 	rtc->clk = clk_get(&pdev->dev, NULL);
 	if (IS_ERR(rtc->clk)) {
-- 
2.7.4


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

* Re: [PATCH] rtc: st-lpc: move to use request_irq by IRQF_NO_AUTOEN flag
  2021-04-07  2:18 [PATCH] rtc: st-lpc: move to use request_irq by IRQF_NO_AUTOEN flag Tian Tao
@ 2021-04-08  8:04 ` Patrice CHOTARD
  2021-04-16 23:04 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Patrice CHOTARD @ 2021-04-08  8:04 UTC (permalink / raw)
  To: Tian Tao, a.zummo, alexandre.belloni; +Cc: linux-arm-kernel, linux-rtc

Hi Tian

On 4/7/21 4:18 AM, 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/
> 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
>  drivers/rtc/rtc-st-lpc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c
> index bdb20f6..2df2179 100644
> --- a/drivers/rtc/rtc-st-lpc.c
> +++ b/drivers/rtc/rtc-st-lpc.c
> @@ -218,15 +218,14 @@ static int st_rtc_probe(struct platform_device *pdev)
>  		return -EINVAL;
>  	}
>  
> -	ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler, 0,
> -			       pdev->name, rtc);
> +	ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler,
> +			       IRQF_NO_AUTOEN, pdev->name, rtc);
>  	if (ret) {
>  		dev_err(&pdev->dev, "Failed to request irq %i\n", rtc->irq);
>  		return ret;
>  	}
>  
>  	enable_irq_wake(rtc->irq);
> -	disable_irq(rtc->irq);
>  
>  	rtc->clk = clk_get(&pdev->dev, NULL);
>  	if (IS_ERR(rtc->clk)) {
> 

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

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

* Re: [PATCH] rtc: st-lpc: move to use request_irq by IRQF_NO_AUTOEN flag
  2021-04-07  2:18 [PATCH] rtc: st-lpc: move to use request_irq by IRQF_NO_AUTOEN flag Tian Tao
  2021-04-08  8:04 ` Patrice CHOTARD
@ 2021-04-16 23:04 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2021-04-16 23:04 UTC (permalink / raw)
  To: patrice.chotard, Tian Tao, a.zummo
  Cc: Alexandre Belloni, linux-rtc, linux-arm-kernel

On Wed, 7 Apr 2021 10:18:57 +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: st-lpc: move to use request_irq by IRQF_NO_AUTOEN flag
      commit: 81a0eaf28af6bcf925cee63ba5f6ab4d73c1d072

Best regards,
-- 
Alexandre Belloni <alexandre.belloni@bootlin.com>

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

end of thread, other threads:[~2021-04-16 23:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  2:18 [PATCH] rtc: st-lpc: move to use request_irq by IRQF_NO_AUTOEN flag Tian Tao
2021-04-08  8:04 ` Patrice CHOTARD
2021-04-16 23:04 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).