rtc: rzn1: clear interrupts on remove
Subsystems (2)
PATCH v2 1/1 rtc: rzn1: clear interrupts on remove
It is good practice to clear running interrupts before removing the driver. This is not really a bugfix because on current systems RuntimePM will disable the module clock, so interrupts won't be initiated. The dependency on that behaviour is subtle, though. Better be self-contained and clean up when removing.
---
Change since v1: fix build failure by adding the 'rtc' variable. Build and tested on Renesas RZ/N1D.
drivers/rtc/rtc-rzn1.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/rtc/rtc-rzn1.c +5 -0
@@ -444,6 +444,11 @@ static int rzn1_rtc_probe(struct platform_device *pdev)static void rzn1_rtc_remove (struct platform_device *pdev) { +struct rzn1_rtc *rtc =platform_get_drvdata (pdev); + +/* Disable all interrupts */ +writel (0 , rtc->base +RZN1_RTC_CTL1 ); +pm_runtime_put (&pdev->dev); }
Signature · 1 line
2.47.2
Quoted 8 lines · Wolfram Sang
It is good practice to clear running interrupts before removing the driver. This is not really a bugfix because on current systems RuntimePM will disable the module clock, so interrupts won't be initiated. The dependency on that behaviour is subtle, though. Better be self-contained and clean up when removing.
[...]
Applied, thanks!
[1/1] rtc: rzn1: clear interrupts on remove
https://git.kernel.org/abelloni/c/0bddd060a6a3
Best regards,
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Alexandre Belloni
maintainerQuoted 2 lines · Wolfram Sang
It is good practice to clear running interrupts before removing the driver. This is not really a bugfix because on current systems RuntimePM
This is not completely true, most of the drivers would leave the interrupt enabled after removing the driver because it can still power on a device.
Quoted 32 lines
will disable the module clock, so interrupts won't be initiated. The dependency on that behaviour is subtle, though. Better be self-contained and clean up when removing.
Signed-off-by Wolfram Sang <[email protected]>---
Change since v1: fix build failure by adding the 'rtc' variable. Build and tested on Renesas RZ/N1D.
drivers/rtc/rtc-rzn1.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/rtc/rtc-rzn1.c +5
-0@@ -444,6 +444,11 @@ static int rzn1_rtc_probe(struct platform_device *pdev)static void rzn1_rtc_remove (struct platform_device *pdev) { +struct rzn1_rtc *rtc =platform_get_drvdata (pdev); + +/* Disable all interrupts */ +writel (0 , rtc->base +RZN1_RTC_CTL1 ); +pm_runtime_put (&pdev->dev); }Signature · 1 line
2.47.2
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
Quoted 7 lines · Alexandre Belloni
Quoted 2 lines · Wolfram Sang
It is good practice to clear running interrupts before removing the driver. This is not really a bugfix because on current systems RuntimePM
This is not completely true, most of the drivers would leave the interrupt enabled after removing the driver because it can still power on a device.
Ah, okay. Good to know that scenario as well. Thanks.