Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: st-lpc: Use IRQF_NO_AUTOEN flag in request_irq()

If request_irq() fails in st_rtc_probe(), there is no need to enable
the irq, and if it succeeds, 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 when
request IRQ.

Fixes: b5b2bdfc2893 ("rtc: st: Add new driver for ST's LPC RTC")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20240912033727.3013951-1-ruanjinjie@huawei.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Jinjie Ruan and committed by
Alexandre Belloni
b6cd7ade 5127135f

+2 -3
+2 -3
drivers/rtc/rtc-st-lpc.c
··· 218 218 return -EINVAL; 219 219 } 220 220 221 - ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler, 0, 222 - pdev->name, rtc); 221 + ret = devm_request_irq(&pdev->dev, rtc->irq, st_rtc_handler, 222 + IRQF_NO_AUTOEN, pdev->name, rtc); 223 223 if (ret) { 224 224 dev_err(&pdev->dev, "Failed to request irq %i\n", rtc->irq); 225 225 return ret; 226 226 } 227 227 228 228 enable_irq_wake(rtc->irq); 229 - disable_irq(rtc->irq); 230 229 231 230 rtc->clk = devm_clk_get_enabled(&pdev->dev, NULL); 232 231 if (IS_ERR(rtc->clk))