Skip to contentSkip to conversation

rtc: pcf8523: fix alarm interrupt disabling

PATCH In review Vincent Whitchurch 2 participants 3 messages Nov 3, 2021 – Dec 1, 2021 Real time clock (RTC)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtc: pcf8523: fix alarm interrupt disabling

Fix the driver to actually disable the IRQ and not overwrite other bits in the CONTROL_1 register when it is asked to disable the alarm interrupt.

Compile-tested only.

Fixes 13e37b7fb75dfaeb4 ("rtc: pcf8523: add alarm support")
---
 drivers/rtc/rtc-pcf8523.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-pcf8523.c +1 -1
index 8b6fb20774bf..e26477267451 100644
@@ -347,7 +347,7 @@ static int pcf8523_irq_enable(struct device *dev, unsigned int enabled)
 	if (err < 0)
 		return err;
 
-	value &= PCF8523_CONTROL1_AIE;
+	value &= ~PCF8523_CONTROL1_AIE;
 
 	if (enabled)
 		value |= PCF8523_CONTROL1_AIE;
Signature · 1 line
2.28.0
#1 lore raw

Hello,

Quoted 17 lines · Vincent Whitchurch

Fix the driver to actually disable the IRQ and not overwrite other bits in the CONTROL_1 register when it is asked to disable the alarm interrupt.

Compile-tested only.

Fixes 13e37b7fb75dfaeb4 ("rtc: pcf8523: add alarm support")
---
 drivers/rtc/rtc-pcf8523.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-pcf8523.c +0 -0
index 8b6fb20774bf..e26477267451 100644

drivers/rtc/rtc-pcf8523.c static int pcf8523_irq_enable(struct device *dev, unsigned int enabled) · line 351

Quoted 6 lines
drivers/rtc/rtc-pcf8523.c +1 -1
@@ -347,7 +347,7 @@ static int pcf8523_irq_enable(struct device *dev, unsigned int enabled)
 	if (err < 0)
 		return err;
 
-	value &= PCF8523_CONTROL1_AIE;
+	value &= ~PCF8523_CONTROL1_AIE;
 

I was going to apply that but it seems this was fixed by:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=91f3849d956d58073ef55e01f2e8871dc30847a5

Quoted 5 lines
drivers/rtc/rtc-pcf8523.c +0 -0
 	if (enabled)
 		value |= PCF8523_CONTROL1_AIE;
Signature · 1 line
2.28.0
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
Quoted 21 lines · Alexandre Belloni
Quoted 20 lines · Vincent Whitchurch

Fix the driver to actually disable the IRQ and not overwrite other bits in the CONTROL_1 register when it is asked to disable the alarm interrupt.

Compile-tested only.

Fixes 13e37b7fb75dfaeb4 ("rtc: pcf8523: add alarm support")
---
 drivers/rtc/rtc-pcf8523.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-pcf8523.c +0 -0
index 8b6fb20774bf..e26477267451 100644
@@ -347,7 +347,7 @@ static int pcf8523_irq_enable(struct device *dev, unsigned int enabled)
 	if (err < 0)
 		return err;
 
Quoted 6 lines

drivers/rtc/rtc-pcf8523.c static int pcf8523_irq_enable(struct device *dev, unsigned int enabled) · line 351

Quoted 3 lines
drivers/rtc/rtc-pcf8523.c +1 -1
-	value &= PCF8523_CONTROL1_AIE;
+	value &= ~PCF8523_CONTROL1_AIE;
 

I was going to apply that but it seems this was fixed by:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=91f3849d956d58073ef55e01f2e8871dc30847a5

Yes, you're right, sorry. I had only checked mainline at the time I wrote the patch and not what was queued up in linux-next.