Skip to content

Commit 4b424a3

Browse files
committed
Merge tag 'rtc-6.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux
Pull RTC fixes from Alexandre Belloni: "Some fixes for 6.16. The cmos one is important for PREEMPT_RT. I've also added the s5m changes as they had a dependency on the MFD pull request that was included in 6.16-rc1 and we didn't synchronize before the merge window and they won't hurt. - cmos: use spin_lock_irqsave in cmos_interrupt - pcf2127: fix SPI command byte for PCF2131 - s5m: add S2MPG10 support" * tag 'rtc-6.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: rtc: pcf2127: add missing semicolon after statement rtc: pcf2127: fix SPI command byte for PCF2131 rtc: cmos: use spin_lock_irqsave in cmos_interrupt rtc: s5m: replace open-coded read/modify/write registers with regmap helpers rtc: s5m: replace regmap_update_bits with regmap_clear/set_bits rtc: s5m: switch to devm_device_init_wakeup rtc: s5m: fix a typo: peding -> pending rtc: s5m: add support for S2MPG10 RTC rtc: s5m: prepare for external regmap rtc: s5m: cache device type during probe
2 parents d0b3b7b + 08d82d0 commit 4b424a3

File tree

3 files changed

+140
-74
lines changed

3 files changed

+140
-74
lines changed

drivers/rtc/rtc-cmos.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -692,8 +692,12 @@ static irqreturn_t cmos_interrupt(int irq, void *p)
692692
{
693693
u8 irqstat;
694694
u8 rtc_control;
695+
unsigned long flags;
695696

696-
spin_lock(&rtc_lock);
697+
/* We cannot use spin_lock() here, as cmos_interrupt() is also called
698+
* in a non-irq context.
699+
*/
700+
spin_lock_irqsave(&rtc_lock, flags);
697701

698702
/* When the HPET interrupt handler calls us, the interrupt
699703
* status is passed as arg1 instead of the irq number. But
@@ -727,7 +731,7 @@ static irqreturn_t cmos_interrupt(int irq, void *p)
727731
hpet_mask_rtc_irq_bit(RTC_AIE);
728732
CMOS_READ(RTC_INTR_FLAGS);
729733
}
730-
spin_unlock(&rtc_lock);
734+
spin_unlock_irqrestore(&rtc_lock, flags);
731735

732736
if (is_intr(irqstat)) {
733737
rtc_update_irq(p, 1, irqstat);
@@ -1295,9 +1299,7 @@ static void cmos_check_wkalrm(struct device *dev)
12951299
* ACK the rtc irq here
12961300
*/
12971301
if (t_now >= cmos->alarm_expires && cmos_use_acpi_alarm()) {
1298-
local_irq_disable();
12991302
cmos_interrupt(0, (void *)cmos->rtc);
1300-
local_irq_enable();
13011303
return;
13021304
}
13031305

drivers/rtc/rtc-pcf2127.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,12 @@ static int pcf2127_spi_probe(struct spi_device *spi)
15381538
variant = &pcf21xx_cfg[type];
15391539
}
15401540

1541-
config.max_register = variant->max_register,
1541+
if (variant->type == PCF2131) {
1542+
config.read_flag_mask = 0x0;
1543+
config.write_flag_mask = 0x0;
1544+
}
1545+
1546+
config.max_register = variant->max_register;
15421547

15431548
regmap = devm_regmap_init_spi(spi, &config);
15441549
if (IS_ERR(regmap)) {

0 commit comments

Comments
 (0)