The patch titled rtc-at32ap700x: fix bug in at32_rtc_readalarm() has been removed from the -mm tree. Its filename was rtc-at32ap700x-fix-bug-in-at32_rtc_readalarm.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: rtc-at32ap700x: fix bug in at32_rtc_readalarm() From: Haavard Skinnemoen <haavard.skinnemoen@xxxxxxxxx> alarm->pending indicates whether there's an alarm that has actually been triggered, not whether we're waiting for it. alarm->enabled indicates that. Also add missing locking around reading the RTC registers. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@xxxxxxxxx> Signed-off-by: Alessandro Zummo <a.zummo@xxxxxxxxxxxx> Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@xxxxxxxxx> Cc: David Brownell <david-b@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/rtc/rtc-at32ap700x.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff -puN drivers/rtc/rtc-at32ap700x.c~rtc-at32ap700x-fix-bug-in-at32_rtc_readalarm drivers/rtc/rtc-at32ap700x.c --- a/drivers/rtc/rtc-at32ap700x.c~rtc-at32ap700x-fix-bug-in-at32_rtc_readalarm +++ a/drivers/rtc/rtc-at32ap700x.c @@ -94,8 +94,11 @@ static int at32_rtc_readalarm(struct dev { struct rtc_at32ap700x *rtc = dev_get_drvdata(dev); + spin_lock_irq(&rtc->lock); rtc_time_to_tm(rtc->alarm_time, &alrm->time); - alrm->pending = rtc_readl(rtc, IMR) & RTC_BIT(IMR_TOPI) ? 1 : 0; + alrm->enabled = rtc_readl(rtc, IMR) & RTC_BIT(IMR_TOPI) ? 1 : 0; + alrm->pending = rtc_readl(rtc, ISR) & RTC_BIT(ISR_TOPI) ? 1 : 0; + spin_unlock_irq(&rtc->lock); return 0; } @@ -119,7 +122,7 @@ static int at32_rtc_setalarm(struct devi spin_lock_irq(&rtc->lock); rtc->alarm_time = alarm_unix_time; rtc_writel(rtc, TOP, rtc->alarm_time); - if (alrm->pending) + if (alrm->enabled) rtc_writel(rtc, CTRL, rtc_readl(rtc, CTRL) | RTC_BIT(CTRL_TOPEN)); else _ Patches currently in -mm which might be from haavard.skinnemoen@xxxxxxxxx are origin.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html