Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1295812 > unrolled thread

Re: [PATCH V1] rtc: da9063: access ordering error during RTC interrupt system power on

Started byAlexandre Belloni <alexandre.belloni@free-electrons.com>
First post2015-12-21 09:20 +0100
Last post2015-12-21 09:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH V1] rtc: da9063: access ordering error during RTC  interrupt system power on Alexandre Belloni <alexandre.belloni@free-electrons.com> - 2015-12-21 09:20 +0100

#1295812 — Re: [PATCH V1] rtc: da9063: access ordering error during RTC interrupt system power on

FromAlexandre Belloni <alexandre.belloni@free-electrons.com>
Date2015-12-21 09:20 +0100
SubjectRe: [PATCH V1] rtc: da9063: access ordering error during RTC interrupt system power on
Message-ID<qI3Rf-40k-1@gated-at.bofh.it>
On 08/12/2015 at 16:28:39 +0000, Steve Twiss wrote :
> From: Steve Twiss <stwiss.opensource@diasemi.com>
> 
> This fix alters the ordering of the IRQ and device registrations in the RTC
> driver probe function. This change will apply to the RTC driver that supports
> both DA9063 and DA9062 PMICs.
> 
> A problem could occur with the existing RTC driver if:
> 
> A system is started from a cold boot using the PMIC RTC IRQ to initiate a
> power on operation. For instance, if an RTC alarm is used to start a
> platform from power off.
> The existing driver IRQ is requested before the device has been properly
> registered.
> i.e.
>     ret = devm_request_threaded_irq() 
> comes before
>     rtc->rtc_dev = devm_rtc_device_register();
> 
> In this case, the interrupt can be called before the device has been
> registered and the handler can be called immediately. The IRQ handler
> da9063_alarm_event() contains the function call
> 
>     rtc_update_irq(rtc->rtc_dev, 1, RTC_IRQF | RTC_AF);
> 
> which in turn tries to access the unavailable rtc->rtc_dev.
> 
> The fix is to reorder the functions inside the RTC probe. The IRQ is
> requested after the RTC device resource has been registered so that
> get_irq_byname is the last thing to happen.
> 
> Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com>

This patch has been applied and landed in v4.4-rc6


-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web