20 Jul, 2016
1 commit
-
Since all time members of the alarm data is initialized to -1 the drivers
are responsible to set the tm_sec member to 0.Fixes: d68778b80dd7 ("rtc: initialize output parameter for read alarm to "uninitialized"")
Signed-off-by: Uwe Kleine-König
Signed-off-by: Alexandre Belloni
20 May, 2016
1 commit
-
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 DA9052 and DA9053 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 = da9052_request_irq()
comes before
rtc->rtc = devm_rtc_device_register();In this case, an interrupt exists before the device has been registered and
the IRQ handler can be called immediately: this can happen be before the
memory for rtc->rtc has been allocated. The IRQ handler da9052_rtc_irq()
contains the function call:rtc_update_irq(rtc->rtc, 1, RTC_IRQF | RTC_AF);
which in turn tries to access the unavailable rtc->rtc.
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
da9052_request_irq() is the last thing to happen.Signed-off-by: Steve Twiss
Signed-off-by: Alexandre Belloni
17 Apr, 2015
3 commits
-
Signed-off-by: Adam Ward
Tested-by: Adam Ward
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Adam Ward
Tested-by: Adam Ward
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The RTC is in a different clock domain so a quick read after write
can retrieve a mangled value of the old/new valuesSigned-off-by: Adam Ward
Tested-by: Adam Ward
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
20 Oct, 2014
1 commit
-
A platform_driver does not need to set an owner, it will be populated by the
driver core.Signed-off-by: Wolfram Sang
07 Jun, 2014
1 commit
-
Setting the alarm to a time not on a minute boundary results in repeated
interrupts being generated by the DA9052/3 PMIC device until the kernel
RTC core sees that the alarm has rung. Sometimes the number and frequency
of interrupts can cause the kernel to disable the IRQ line used by the
DA9052/3 PMIC with disasterous consequences. This patch fixes the
problem.Even though the DA9052/3 PMIC is capable generating periodic interrupts,
ie TICKS, the method used to distinguish RTC_AF from RTC_PF events was
flawed and can not work in conjunction with the regmap_irq kernel core.
Thus that flawed detection has also been removed by the DA9052/3 PMIC RTC
driver's irq handler, so that it no longer reports the wrong type of event
to the kernel RTC core.The internal static functions within the DA9052/3 PMIC RTC driver have
been changed to pass the 'da9052_rtc' structure instead of the 'da9052'
because there is no backwards pointer from the 'da9052' structure.This patch fixes the three issues described above. The first is serious
because usiing the RTC alarm set to a non minute boundary will eventually
cause all component drivers that depend on the interrupt line to fail.
The solution adopted is to round up to alarm time to the next highest
minute.The second bug, reporting a RTC_PF event instead of an RTC_AF event turns
out to not matter with the current implementation of the kernel RTC core
as it seems to ignore the event type. However, should that change in the
future it is better to fix the issue now and not have 'problems waiting to
happen'The third set of changes are to make the da9052_rtc structure available to
all the local internal functions in the driver. This was done during
testing so that diagnostic data could be stored there. Should the
solution to the first issue be found not acceptable, then the alternative
of using the TICKS interrupt at the fixed one second interval in order to
step to the exact second of the requested alarm requires an extra (alarm
time) piece of data to be stored. In devices that use the alarm function
to wake up from sleep, accuracy to the second will result in the device
being awake for up to nearly a minute longer than expected.Signed-off-by: Anthony Olech
Cc: David Dajun Chen
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Apr, 2014
1 commit
-
Remove redundant irq field in private rtc structure.
Signed-off-by: Anthony Olech
Acked-by: David Dajun Chen
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
16 Jul, 2013
1 commit
-
PTR_RET is now deprecated. Use PTR_ERR_OR_ZERO instead.
Signed-off-by: Sachin Kamat
Signed-off-by: Rusty Russell
04 Jul, 2013
3 commits
-
Use of PTR_RET() simplifies the code.
Signed-off-by: Sachin Kamat
Cc: David Dajun Chen
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
After the switch to devm_ functions and the removal of
rtc_device_unregister(), the 'remove' function does not do anything.
Delete it.Signed-off-by: Sachin Kamat
Cc: David Dajun Chen
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
The driver core clears the driver data to NULL after device_release or
on probe failure, since commit 0998d063100 ("device-core: Ensure drvdata
= NULL when no driver is bound"). Thus, it is not needed to manually
clear the device driver data to NULL.Signed-off-by: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
30 Apr, 2013
1 commit
-
devm_rtc_device_register() is device managed and makes cleanup
paths simpler.Signed-off-by: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
23 Mar, 2013
1 commit
-
Add support for the virtual irq since now MFD only handles virtual irq
Without this patch rtc device will fail in registration.(akpm: Ashish has a different version whcih will be needed for 3.8.x and
earlier kernels)Signed-off-by: Ashish
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
22 Feb, 2013
1 commit
-
Use devm_request_threaded_irq() to make cleanup paths more simple.
Signed-off-by: Jingoo Han
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Jan, 2013
1 commit
-
CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.Cc: Bill Pemberton
Cc: Alessandro Zummo
Cc: Srinidhi Kasagar
Cc: Linus Walleij
Cc: Mike Frysinger
Cc: Wan ZongShun
Cc: Guan Xuetao
Cc: Mark Brown
Signed-off-by: Greg Kroah-Hartman
31 Jul, 2012
1 commit
-
Freeing will trigger when driver unloads, so using devm_kfree() is not
needed.Signed-off-by: Devendra Naga
Cc: Alessandro Zummo
Cc: Ashish Jangam
Cc: David Dajun Chen
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
24 Mar, 2012
1 commit
-
RTC Driver for Dialog Semiconductor DA9052/53 PMICs.
This patch is functionally tested on Samsung SMDKV6410.
[akpm@linux-foundation.org: clean up file header layout, remove unneeded initialisation of local arrays]
Signed-off-by: David Dajun Chen
Signed-off-by: Ashish Jangam
Cc: Paul Gortmaker
Cc: David Dajun Chen
Cc: Samuel Ortiz
Cc: Alessandro Zummo
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds