Skip to contentSkip to conversation

rtc: bd70528: Fix hour register mask

PATCH Applied Matti Vaittinen 3 participants 8 messages Oct 23, 2019 – Nov 7, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 rtc: bd70528: Fix hour register mask

When RTC is used in 24H mode (and it is by this driver) the maximum hour value is 24 in BCD. This occupies bits [5:0] - which means correct mask for HOUR register is 0x3f not 0x1f. Fix the mask

Fixes 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM bd70528 RTC")
---
 include/linux/mfd/rohm-bd70528.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mfd/rohm-bd70528.h +1 -1
index 1013e60c5b25..b0109ee6dae2 100644
@@ -317,7 +317,7 @@ enum {
 #define BD70528_MASK_RTC_MINUTE		0x7f
 #define BD70528_MASK_RTC_HOUR_24H	0x80
 #define BD70528_MASK_RTC_HOUR_PM	0x20
-#define BD70528_MASK_RTC_HOUR		0x1f
+#define BD70528_MASK_RTC_HOUR		0x3f
 #define BD70528_MASK_RTC_DAY		0x3f
 #define BD70528_MASK_RTC_WEEK		0x07
 #define BD70528_MASK_RTC_MONTH		0x1f
Signature · 14 lines
2.21.0


-- 
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =] 
maintainer Applied
#1 lore raw
Quoted 10 lines · Matti Vaittinen

When RTC is used in 24H mode (and it is by this driver) the maximum hour value is 24 in BCD. This occupies bits [5:0] - which means correct mask for HOUR register is 0x3f not 0x1f. Fix the mask

Fixes 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM bd70528 RTC")
---
 include/linux/mfd/rohm-bd70528.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
Quoted 5 lines · Alexandre Belloni
Quoted 4 lines · Matti Vaittinen

When RTC is used in 24H mode (and it is by this driver) the maximum hour value is 24 in BCD. This occupies bits [5:0] - which means correct mask for HOUR register is 0x3f not 0x1f. Fix the mask

Quoted 8 lines
Quoted 6 lines
Fixes 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM bd70528 RTC")
---
 include/linux/mfd/rohm-bd70528.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Actually, is there any point in doing that since "rtc: bd70528 add BD71828 support" will conflict with it and correct the issue anyway?

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

Hello Alexandre,

I'd expect the BD71828 support to still take a while. I don't expect it to land in next kernel release. I'd prefer getting this fix in now (and I hope it might also get merged to earlier releases by the 'fixes' tag). So if it's not a problem for you then please apply this fix now - I can rebase the BD71828 support when this fix is out :)

Br,
Matti Vaittinen

Quoted 21 lines · Alexandre Belloni
Quoted 10 lines · Alexandre Belloni
Quoted 9 lines · Matti Vaittinen

When RTC is used in 24H mode (and it is by this driver) the maximum
hour value is 24 in BCD. This occupies bits [5:0] - which means correct mask for HOUR register is 0x3f not 0x1f. Fix the mask

Fixes 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM

bd70528 RTC")

Quoted 1 line
Quoted 6 lines
Quoted 4 lines
---
 include/linux/mfd/rohm-bd70528.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Actually, is there any point in doing that since "rtc: bd70528 add BD71828 support" will conflict with it and correct the issue anyway?

#4 lore raw
In reply to Alexandre Belloni
Quoted 5 lines · Alexandre Belloni
Quoted 4 lines · Matti Vaittinen

When RTC is used in 24H mode (and it is by this driver) the maximum hour value is 24 in BCD. This occupies bits [5:0] - which means correct mask for HOUR register is 0x3f not 0x1f. Fix the mask

Quoted 7 lines
Quoted 6 lines
Fixes 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM bd70528 RTC")
---
 include/linux/mfd/rohm-bd70528.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

You have been duped. This is clearly not an RTC patch.

Signature · 4 lines
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#5 lore raw
Quoted 13 lines · Lee Jones
Quoted 11 lines · Alexandre Belloni
Quoted 10 lines · Matti Vaittinen

When RTC is used in 24H mode (and it is by this driver) the maximum hour value is 24 in BCD. This occupies bits [5:0] - which means correct mask for HOUR register is 0x3f not 0x1f. Fix the mask

Fixes 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM bd70528 RTC")
---
 include/linux/mfd/rohm-bd70528.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 4 lines
Quoted 1 line

Applied, thanks.

You have been duped. This is clearly not an RTC patch.

Well, it only affects the RTC driver. Do you want to take it?

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#7 lore raw
In reply to Lee Jones
Quoted 12 lines · Lee Jones
Quoted 10 lines · Alexandre Belloni
Quoted 9 lines · Matti Vaittinen

When RTC is used in 24H mode (and it is by this driver) the maximum
hour value is 24 in BCD. This occupies bits [5:0] - which means correct mask for HOUR register is 0x3f not 0x1f. Fix the mask

Fixes 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM

bd70528 RTC")

Quoted 1 line
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines
---
 include/linux/mfd/rohm-bd70528.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

You have been duped. This is clearly not an RTC patch.

Sorry. My bad. I used the rtc: prefix as this clearly is RTC fix - although the header may be MFD territory. I should have known that maintaining is done per file basis. I try to be more careful in the future.

Br,
Matti Vaittinen

#6 lore raw
In reply to Alexandre Belloni
Quoted 14 lines · Alexandre Belloni
Quoted 13 lines · Lee Jones
Quoted 11 lines · Alexandre Belloni
Quoted 10 lines · Matti Vaittinen

When RTC is used in 24H mode (and it is by this driver) the maximum hour value is 24 in BCD. This occupies bits [5:0] - which means correct mask for HOUR register is 0x3f not 0x1f. Fix the mask

Fixes 32a4a4ebf768 ("rtc: bd70528: Initial support for ROHM bd70528 RTC")
---
 include/linux/mfd/rohm-bd70528.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Applied, thanks.

You have been duped. This is clearly not an RTC patch.

Well, it only affects the RTC driver. Do you want to take it?

I've removed it from rtc-next, up to you to take it.

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com