aboutsummaryrefslogtreecommitdiff
path: root/drivers/rtc
AgeCommit message (Collapse)AuthorFilesLines
2012-01-07Merge branch 'depends/rmk/for-linus' into samsung/dtArnd Bergmann2-0/+15
Conflicts: arch/arm/mach-exynos/Makefile arch/arm/mach-exynos/cpu.c -> common.c arch/arm/mach-exynos/include/mach/entry-macro.S arch/arm/mach-exynos/init.c -> common.c arch/arm/mach-s5p64x0/init.c -> common.c arch/arm/mach-s5pv210/init.c -> common.c Multiple files were moved into common.c files in the rmk/for-linus branch, so this moves over the samsung/dt changes to the new files. Signed-off-by: Arnd Bergmann <[email protected]>
2012-01-07Merge branch 'depends/rmk/restart' into next/cleanupArnd Bergmann2-0/+15
Conflicts: arch/arm/mach-at91/at91cap9.c arch/arm/mach-at91/at91sam9260.c arch/arm/mach-at91/at91sam9261.c arch/arm/mach-at91/at91sam9263.c arch/arm/mach-at91/at91sam9g45.c arch/arm/mach-at91/at91sam9rl.c arch/arm/mach-exynos/cpu.c arch/arm/mach-shmobile/board-kota2.c This resolves a bunch of conflicts between the arm-soc tree and changes from the arm tree that have gone upstream. Signed-off-by: Arnd Bergmann <[email protected]>
2012-01-06Merge branch 'amba-modalias' of ↵Linus Torvalds2-0/+4
git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm * 'amba-modalias' of git://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm: sound: aaci: Enable module alias autogeneration for AMBA drivers watchdog: sp805: Enable module alias autogeneration for AMBA drivers fbdev: amba: Enable module alias autogeneration for AMBA drivers serial: pl011: Enable module alias autogeneration for AMBA drivers serial: pl010: Enable module alias autogeneration for AMBA drivers spi: pl022: Enable module alias autogeneration for AMBA drivers rtc: pl031: Enable module alias autogeneration for AMBA drivers rtc: pl030: Enable module alias autogeneration for AMBA drivers mmc: mmci: Enable module alias autogeneration for AMBA drivers input: ambakmi: Enable module alias autogeneration for AMBA drivers gpio: pl061: Enable module alias autogeneration for AMBA drivers dmaengine: pl330: Enable module alias autogeneration for AMBA drivers dmaengine: pl08x: Enable module alias autogeneration for AMBA drivers hwrng: nomadik: Enable module alias autogeneration for AMBA drivers ARM: amba: Auto-generate AMBA driver module aliases during modpost ARM: amba: Move definition of struct amba_id to mod_devicetable.h
2012-01-04Revert "rtc: Expire alarms after the time is set."Linus Torvalds1-6/+0
This reverts commit 93b2ec0128c431148b216b8f7337c1a52131ef03. The call to "schedule_work()" in rtc_initialize_alarm() happens too early, and can cause oopses at bootup Neil Brown explains why we do it: "If you set an alarm in the future, then shutdown and boot again after that time, then you will end up with a timer_queue node which is in the past. When this happens the queue gets stuck. That entry-in-the-past won't get removed until and interrupt happens and an interrupt won't happen because the RTC only triggers an interrupt when the alarm is "now". So you'll find that e.g. "hwclock" will always tell you that 'select' timed out. So we force the interrupt work to happen at the start just in case." and has a patch that convert it to do things in-process rather than with the worker thread, but right now it's too late to play around with this, so we just revert the patch that caused problems for now. Reported-by: Sander Eikelenboom <[email protected]> Requested-by: Konrad Rzeszutek Wilk <[email protected]> Requested-by: John Stultz <[email protected]> Cc: Neil Brown <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2012-01-03Revert "rtc: Disable the alarm in the hardware"Linus Torvalds1-34/+10
This reverts commit c0afabd3d553c521e003779c127143ffde55a16f. It causes failures on Toshiba laptops - instead of disabling the alarm, it actually seems to enable it on the affected laptops, resulting in (for example) the laptop powering on automatically five minutes after shutdown. There's a patch for it that appears to work for at least some people, but it's too late to play around with this, so revert for now and try again in the next merge window. See for example http://bugs.debian.org/652869 Reported-and-bisected-by: Andreas Friedrich <[email protected]> (Toshiba Tecra) Reported-by: Antonio-M. Corbi Bellot <[email protected]> (Toshiba Portege R500) Reported-by: Marco Santos <[email protected]> (Toshiba Portege Z830) Reported-by: Christophe Vu-Brugier <[email protected]> (Toshiba Portege R830) Cc: Jonathan Nieder <[email protected]> Requested-by: John Stultz <[email protected]> Cc: [email protected] # for the versions that applied this Signed-off-by: Linus Torvalds <[email protected]>
2011-12-28Merge branch 'drivers/rtc-sa1100' into next/driversArnd Bergmann2-118/+184
* drivers/rtc-sa1100: ARM: sa1100: clean up of the clock support ARM: pxa: add dummy clock for sa1100-rtc RTC: sa1100: support sa1100, pxa and mmp soc families RTC: sa1100: remove redundant code of setting alarm RTC: sa1100: Clean out ost register Conflicts: arch/arm/mach-pxa/pxa25x.c arch/arm/mach-pxa/pxa27x.c
2011-12-28RTC: sa1100: support sa1100, pxa and mmp soc familiesJett.Zhou2-80/+178
Since the regmap of rtc on sa1100, pxa and mmp Marvell soc families are almost the same, so re-arch the rtc-sa1100 to support them. Signed-off-by: Jett.Zhou <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Acked-by: Robert Jarzmik <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
2011-12-28RTC: sa1100: remove redundant code of setting alarmJett.Zhou1-41/+12
In rtc generic interface of setting alarm, it will check the alarm time value valid or not, so rtc_periodic_alarm is redundant, remove it. Signed-off-by: Jett.Zhou <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
2011-12-28RTC: sa1100: Clean out ost registerJett.Zhou1-3/+0
These registers are used in old ioctl of UIE and PIE, now they are emulated by rtc generic code of hrtimer, so it can be removed. Signed-off-by: Jett.Zhou <[email protected]> Acked-by: Haojian Zhuang <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]>
2011-12-23rtc: rtc-s3c: Add device tree supportThomas Abraham1-1/+20
Add device tree based discovery support for Samsung's rtc controller. Cc: Ben Dooks <[email protected]> Signed-off-by: Thomas Abraham <[email protected]> Acked-by: Grant Likely <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>
2011-12-20Merge branch 'timers-urgent-for-linus' of ↵Linus Torvalds2-0/+15
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: time/clocksource: Fix kernel-doc warnings rtc: m41t80: Workaround broken alarm functionality rtc: Expire alarms after the time is set.
2011-12-18Merge commit 'v3.2-rc6' into x86/platformIngo Molnar3-16/+40
2011-12-18x86/intel config: Revamp configuration to allow for Moorestown and MedfieldAlan Cox1-3/+3
This sets all up the other bits that need to be INTEL_MID specific rather than Moorestown specific. Signed-off-by: Alan Cox <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
2011-12-15Merge branch 'at91/defconfig' into next/cleanupOlof Johansson3-16/+40
2011-12-13rtc: m41t80: Workaround broken alarm functionalityJohn Stultz1-0/+9
The m41t80 driver can read and set the alarm, but it doesn't seem to have a functional alarm irq. This causes failures when the generic core sees alarm functions, but then cannot use them properly for things like UIE mode. Disabling the alarm functions allows proper error reporting, and possible fallback to emulated modes. Once someone fixes the alarm irq functionality, this can be restored. CC: [email protected] CC: Matt Turner <[email protected]> CC: Nico Macrionitis <[email protected]> CC: Atsushi Nemoto <[email protected]> Reported-by: Matt Turner <[email protected]> Reported-by: Nico Macrionitis <[email protected]> Tested-by: Nico Macrionitis <[email protected]> Signed-off-by: John Stultz <[email protected]>
2011-12-13rtc: Expire alarms after the time is set.NeilBrown1-0/+6
If the alarm time programming in the rtc is ever in the past, it won't fire, and any other alarm will be queued after it so they won't fire either. So any time that the alarm might be in the past, we need to trigger the irq handler to ensure the old alarm is cleared and the timer queue is fully in the future. This can happen: - when we first initialise the alarm - when we set the time in the rtc. so follow both of these by scheduling the timer work function. CC: [email protected] Signed-off-by: NeilBrown <[email protected]> [Also catch set_mmss case -jstultz] Signed-off-by: John Stultz <[email protected]>
2011-12-09drivers/rtc/rtc-s3c.c: fix driver clock enable/disable balance issuesJonghwan Choi1-1/+1
If an error occurs after the clock is enabled, the enable/disable state can become unbalanced. Signed-off-by: Jonghwan Choi <[email protected]> Cc: Alessandro Zummo <[email protected]> Acked-by: Kukjin Kim <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-12-05Merge branch 'timers-urgent-for-linus' of ↵Linus Torvalds2-15/+39
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clockevents: Set noop handler in clockevents_exchange_device() tick-broadcast: Stop active broadcast device when replacing it clocksource: Fix bug with max_deferment margin calculation rtc: Fix some bugs that allowed accumulating time drift in suspend/resume rtc: Disable the alarm in the hardware
2011-11-28ARM: at91: make rm9200 rtc drivers soc independentJean-Christophe PLAGNIOL-VILLARD1-38/+63
switch the rtc drivers to resource and pass it via platform_device Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <[email protected]> Cc: Nicolas Ferre <[email protected]>
2011-11-22rtc: Fix some bugs that allowed accumulating time drift in suspend/resumeArve Hjønnevåg1-5/+5
The current code checks if abs(delta_delta.tv_sec) is greater or equal to two before it discards the old delta value, but this can trigger at close to -1 seconds since -1.000000001 seconds is stored as tv_sec -2 and tv_nsec 999999999 in a normalized timespec. rtc_resume had an early return check if the rtc value had not changed since rtc_suspend. This effectivly stops time for the duration of the short sleep. Check if sleep_time is positive after all the adjustments have been applied instead since this allows the old_system adjustment in rtc_suspend to have an effect even for short sleep cycles. CC: [email protected] Signed-off-by: Arve Hjønnevåg <[email protected]> Signed-off-by: John Stultz <[email protected]>
2011-11-22rtc: Disable the alarm in the hardwareRabin Vincent1-10/+34
Currently, the RTC code does not disable the alarm in the hardware. This means that after a sequence such as the one below (the files are in the RTC sysfs), the box will boot up after 2 minutes even though we've asked for the alarm to be turned off. # echo $((`cat since_epoch`)+120) > wakealarm # echo 0 > wakealarm # poweroff Fix this by disabling the alarm when there are no timers to run. Cc: [email protected] Cc: John Stultz <[email protected]> Signed-off-by: Rabin Vincent <[email protected]> Signed-off-by: John Stultz <[email protected]>
2011-11-22rtc: pl031: Enable module alias autogeneration for AMBA driversDave Martin1-0/+2
Signed-off-by: Dave Martin <[email protected]>
2011-11-22rtc: pl030: Enable module alias autogeneration for AMBA driversDave Martin1-0/+2
Signed-off-by: Dave Martin <[email protected]>
2011-11-15rtc: rtc-puv3: Add __devinit and __devexit markers for probe and removeAxel Lin1-2/+2
Signed-off-by: Axel Lin <[email protected]> Acked-by: Guan Xuetao <[email protected]>
2011-11-11vrtc: change its year offset from 1960 to 1972Feng Tang1-8/+11
Real world year equals the value in vrtc YEAR register plus an offset. We used 1960 as the offset to make leap year consistent, but for a device's first use, its YEAR register is 0 and the system year will be parsed as 1960 which is not a valid UNIX time and will cause many applications to fail mysteriously. So we use 1972 instead to fix this issue. Updated patch which adds a sanity check suggested by Mathias This isn't a change in behaviour for systems, because 1972 is the one we actually use. It's the old version in upstream which is out of sync with all devices. Signed-off-by: Feng Tang <[email protected]> Signed-off-by: Alan Cox <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-11-06Merge branch 'modsplit-Oct31_2011' of ↵Linus Torvalds17-0/+17
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits) Revert "tracing: Include module.h in define_trace.h" irq: don't put module.h into irq.h for tracking irqgen modules. bluetooth: macroize two small inlines to avoid module.h ip_vs.h: fix implicit use of module_get/module_put from module.h nf_conntrack.h: fix up fallout from implicit moduleparam.h presence include: replace linux/module.h with "struct module" wherever possible include: convert various register fcns to macros to avoid include chaining crypto.h: remove unused crypto_tfm_alg_modname() inline uwb.h: fix implicit use of asm/page.h for PAGE_SIZE pm_runtime.h: explicitly requires notifier.h linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h miscdevice.h: fix up implicit use of lists and types stop_machine.h: fix implicit use of smp.h for smp_processor_id of: fix implicit use of errno.h in include/linux/of.h of_platform.h: delete needless include <linux/module.h> acpi: remove module.h include from platform/aclinux.h miscdevice.h: delete unnecessary inclusion of module.h device_cgroup.h: delete needless include <linux/module.h> net: sch_generic remove redundant use of <linux/module.h> net: inet_timewait_sock doesnt need <linux/module.h> ... Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in - drivers/media/dvb/frontends/dibx000_common.c - drivers/media/video/{mt9m111.c,ov6650.c} - drivers/mfd/ab3550-core.c - include/linux/dmaengine.h
2011-11-02Merge branch 'akpm' (Andrew's incoming - part two)Linus Torvalds3-26/+39
Says Andrew: "60 patches. That's good enough for -rc1 I guess. I have quite a lot of detritus to be rechecked, work through maintainers, etc. - most of the remains of MM - rtc - various misc - cgroups - memcg - cpusets - procfs - ipc - rapidio - sysctl - pps - w1 - drivers/misc - aio" * akpm: (60 commits) memcg: replace ss->id_lock with a rwlock aio: allocate kiocbs in batches drivers/misc/vmw_balloon.c: fix typo in code comment drivers/misc/vmw_balloon.c: determine page allocation flag can_sleep outside loop w1: disable irqs in critical section drivers/w1/w1_int.c: multiple masters used same init_name drivers/power/ds2780_battery.c: fix deadlock upon insertion and removal drivers/power/ds2780_battery.c: add a nolock function to w1 interface drivers/power/ds2780_battery.c: create central point for calling w1 interface w1: ds2760 and ds2780, use ida for id and ida_simple_get() to get it pps gpio client: add missing dependency pps: new client driver using GPIO pps: default echo function include/linux/dma-mapping.h: add dma_zalloc_coherent() sysctl: make CONFIG_SYSCTL_SYSCALL default to n sysctl: add support for poll() RapidIO: documentation update drivers/net/rionet.c: fix ethernet address macros for LE platforms RapidIO: fix potential null deref in rio_setup_device() RapidIO: add mport driver for Tsi721 bridge ...
2011-11-02drivers/rtc/rtc-mc13xxx.c: move probe and remove callbacks to .init.text and ↵Uwe Kleine-König1-3/+3
.exit.text The driver is added using platform_driver_probe(), so the callbacks can be discarded more aggessively. Signed-off-by: Uwe Kleine-König <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-11-02rtc: add initial support for mcp7941x partsDavid Anders1-0/+27
Add initial support for the microchip mcp7941x series of real time clocks. The mcp7941x series is generally compatible with the ds1307 and ds1337 rtc devices from dallas semiconductor. minor differences include a backup battery enable bit, and the polarity of the oscillator enable bit. Signed-off-by: David Anders <[email protected]> Cc: Alessandro Zummo <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-11-02drivers/rtc/class.c: convert idr to ida and use ida_simple_get()Jonathan Cameron1-23/+9
This is the one use of an ida that doesn't retry on receiving -EAGAIN. I'm assuming do so will cause no harm and may help on a rare occasion. Signed-off-by: Jonathan Cameron <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-11-02um: switch to use of drivers/KconfigAl Viro1-1/+1
Signed-off-by: Al Viro <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
2011-10-31rtc: Add module.h to implicit users in drivers/rtcPaul Gortmaker17-0/+17
The module.h was implicitly everywhere, but when we clean that up, the implicit users will compile fail; fix them up in advance. Signed-off-by: Paul Gortmaker <[email protected]>
2011-09-14drivers/rtc/rtc-s3c.c: fix no occurrence of alarm interruptDonggeun Kim1-0/+26
The driver does not generate an alarm interrupt even though a time for an alarm is set. This results from disabling rtc_clk after setting the alarm time. To generate an alarm interrupt the driver should maintain its enabled state for rtc_clk the until alarm interrupt occurs. This patch permits generation of an alarm interrupt. [[email protected]: make s3c_rtc_alarm_clk_lock local to s3c_rtc_alarm_clk_enable()] Signed-off-by: Donggeun Kim <[email protected]> Signed-off-by: MyungJoo Ham <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-09-14drivers/rtc/rtc-imxdi.c needs linux/sched.hAxel Lin1-0/+1
Include linux/sched.h to fix below build error. CC drivers/rtc/rtc-imxdi.o drivers/rtc/rtc-imxdi.c: In function 'di_write_wait': drivers/rtc/rtc-imxdi.c:168: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function) drivers/rtc/rtc-imxdi.c:168: error: (Each undeclared identifier is reported only once drivers/rtc/rtc-imxdi.c:168: error: for each function it appears in.) drivers/rtc/rtc-imxdi.c:168: error: implicit declaration of function 'signal_pending' drivers/rtc/rtc-imxdi.c:168: error: implicit declaration of function 'schedule_timeout' drivers/rtc/rtc-imxdi.c: In function 'dryice_norm_irq': drivers/rtc/rtc-imxdi.c:329: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function) Signed-off-by: Axel Lin <[email protected]> Cc: Baruch Siach <[email protected]> Cc: Wan ZongShun <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-09-07Merge branch 'timers-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tipLinus Torvalds3-44/+34
* 'timers-fixes-for-linus' of git://tesla.tglx.de/git/linux-2.6-tip: rtc: twl: Fix registration vs. init order rtc: Initialized rtc_time->tm_isdst rtc: Fix RTC PIE frequency limit rtc: rtc-twl: Remove lockdep related local_irq_enable() rtc: rtc-twl: Switch to using threaded irq rtc: ep93xx: Fix 'rtc' may be used uninitialized warning alarmtimers: Avoid possible denial of service with high freq periodic timers alarmtimers: Memset itimerspec passed into alarm_timer_get alarmtimers: Avoid possible null pointer traversal
2011-08-26rtc: twl: Fix registration vs. init orderTodd Poynor1-28/+24
Only register as an RTC device after the hardware has been successfully initialized. The RTC class driver will call back to this driver to read a pending alarm, and other drivers watching for new devices on the RTC class may read the RTC time upon registration. Such access might occur while the RTC is stopped, prior to clearing pending alarms, etc. The new ordering also avoids leaving the platform device drvdata set to an unregistered struct rtc_device * on probe errors. Signed-off-by: Todd Poynor <[email protected]> Signed-off-by: John Stultz <[email protected]>
2011-08-26rtc: Initialized rtc_time->tm_isdstMike Waychison1-0/+2
Even though the Linux kernel does not use the tm_isdst field, it is exposed as part of the ABI. This field can accidentally be left initialized, which is why we currently memset buffers returned to userland in rtc_read_time. There is a case however where the field can return garbage from the stack though when using the RTC_ALM_READ ioctl on the rtc device. This ioctl invokes rtc_read_alarm, which is careful to memset the rtc_wkalrm buffer that is copied to userland, but it then uses a struct copy to assign to alarm->time given the return value from rtc_ktime_to_tm(). rtc_ktime_to_tm() is implemented by calling rtc_time_to_tm using a derivative seconds counds from ktime, but rtc_time_to_tm does not assign a value to ->tm_isdst. This results in garbage from rtc_ktime_to_tm()'s frame ending up being copied out to userland as part of the returned rtc_wkalrm. Fix this by initializing rtc_time->tm_isdst to 0 in rtc_time_to_tm. Signed-off-by: Mike Waychison <[email protected]> Signed-off-by: John Stultz <[email protected]>
2011-08-25drivers/rtc/rtc-s3c.c: allow multiple open / allow no-ioctl-open'ed rtc to ↵MyungJoo Ham1-42/+25
have irq. The previous rtc-s3c had two issues related with its IRQ. 1. Users cannot open rtc multiple times because an open operation calls request_irq on the same IRQ. (e.g., two user processes wants to open and read RTC time from rtc-s3c at the same time) 2. If alarm is set and no one has the rtc opened with filesystem (either the alarm is set by kernel/boot-loader or user set an alarm and closed rtc dev file), the pending bit is not cleared and no further interrupt is invoked. When the alarm is used by the system itself such as a resume from suspend-to-RAM or other Low-power modes/idle, this is a critical issue. This patch mitigates these issues by calling request_irq at probe and free_irq at remove. Signed-off-by: MyungJoo Ham <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Acked-by: Kukjin Kim <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: Changhwan Youn <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-08-25drivers/rtc/rtc-s3c.c: correct debug messagesMyungJoo Ham1-6/+6
RTC-S3C used to print out debug messages incorrectly. This patch corrects incorrect outputs. (undecoded bcd numbers, incorrectly decoded register values) This patch affects the pr-debug messages only. Signed-off-by: MyungJoo Ham <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Acked-by: Kukjin Kim <[email protected]> Cc: Alessandro Zummo <[email protected]> Cc: Changhwan Youn <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-08-17Merge branch 'timers-fixes-for-linus' of ↵Linus Torvalds1-2/+2
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip * 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: rtc: Limit RTC PIE frequency rtc: Fix hrtimer deadlock rtc: Handle errors correctly in rtc_irq_set_state() Fixup trivial conflicts in drivers/rtc/interface.c due to slightly trivially versions of the same patch coming in two different ways.
2011-08-10rtc: Fix RTC PIE frequency limitJohn Stultz1-1/+1
Thomas earlier submitted a fix to limit the RTC PIE freq, but picked 5000Hz out of the air. Willy noticed that we should instead use the 8192Hz max from the rtc man documentation. Cc: Willy Tarreau <[email protected]> Cc: [email protected] Cc: Thomas Gleixner <[email protected]> Signed-off-by: John Stultz <[email protected]>
2011-08-10rtc: rtc-twl: Remove lockdep related local_irq_enable()Sebastian Reichel1-8/+0
Now that the irq is properly threaded (due to it needing i2c access) we should also remove the local_irq_enable() call in twl_rtc_interrupt. Testing this with Pandaboard, the RTC is still working. [Reworked commit message -jstultz] Signed-off-by: John Stultz <[email protected]>
2011-08-10rtc: rtc-twl: Switch to using threaded irqIlkka Koskinen1-1/+1
The driver is accessing to i2c bus in interrupt handler. Therefore, it should use threaded irq. Signed-off-by: Ilkka Koskinen <[email protected]> Acked-by: Balaji T K <[email protected]> Signed-off-by: John Stultz <[email protected]>
2011-08-10rtc: ep93xx: Fix 'rtc' may be used uninitialized warningAxel Lin1-8/+8
commit 92d921c5d "rtc: ep93xx: Initialize drvdata before registering device" ensures the drvdata is initialized prior to registering the rtc device. But it set the drvdata to an uninitialized pointer. Thus calling platform_get_drvdata in ep93xx_rtc_remove does not get correct address. This patch fixes below warning by adding struct rtc_device *rtc to struct ep93xx_rtc. Then set platform drvdata to ep93xx_rtc instead of rtc. CC drivers/rtc/rtc-ep93xx.o drivers/rtc/rtc-ep93xx.c: In function 'ep93xx_rtc_probe': drivers/rtc/rtc-ep93xx.c:154: warning: 'rtc' may be used uninitialized in this function Signed-off-by: Axel Lin <[email protected]> Signed-off-by: John Stultz <[email protected]>
2011-08-03rtc-omap: fix initialization of control registerDaniel Glöckner1-1/+1
As the comment explains, the intention of the code is to clear the OMAP_RTC_CTRL_MODE_12_24 bit, but instead it only clears the OMAP_RTC_CTRL_SPLIT and OMAP_RTC_CTRL_AUTO_COMP bits, which should be kept. OMAP_RTC_CTRL_DISABLE, OMAP_RTC_CTRL_SET_32_COUNTER, OMAP_RTC_CTRL_TEST, and OMAP_RTC_CTRL_ROUND_30S are also better off being cleared. Signed-off-by: Daniel Glöckner <[email protected]> Cc: Alessandro Zummo <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-07-26rtc: fix hrtimer deadlockThomas Gleixner1-19/+37
Ben reported a lockup related to rtc. The lockup happens due to: CPU0 CPU1 rtc_irq_set_state() __run_hrtimer() spin_lock_irqsave(&rtc->irq_task_lock) rtc_handle_legacy_irq(); spin_lock(&rtc->irq_task_lock); hrtimer_cancel() while (callback_running); So the running callback never finishes as it's blocked on rtc->irq_task_lock. Use hrtimer_try_to_cancel() instead and drop rtc->irq_task_lock while waiting for the callback. Fix this for both rtc_irq_set_state() and rtc_irq_set_freq(). Signed-off-by: Thomas Gleixner <[email protected]> Reported-by: Ben Greear <[email protected]> Cc: John Stultz <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-07-26rtc: limit frequencyThomas Gleixner1-1/+1
Due to the hrtimer self rearming mode a user can DoS the machine simply because it's starved by hrtimer events. The RTC hrtimer is self rearming. We really need to limit the frequency to something sensible. Signed-off-by: Thomas Gleixner <[email protected]> Cc: John Stultz <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Ben Greear <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-07-26rtc: handle errors correctly in rtc_irq_set_state()Thomas Gleixner1-0/+3
The code checks the correctness of the parameters, but unconditionally arms/disarms the hrtimer. The result is that a random task might arm/disarm rtc timer and surprise the real owner by either generating events or by stopping them. Signed-off-by: Thomas Gleixner <[email protected]> Cc: John Stultz <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Ben Greear <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2011-07-26rtc: Limit RTC PIE frequencyThomas Gleixner1-1/+1
The RTC pie hrtimer is self rearming. We really need to limit the frequency to something sensible. Thus limit it to the 8192Hz max value from the rtc man documentation Cc: Willy Tarreau <[email protected]> Cc: [email protected] Signed-off-by: Thomas Gleixner <[email protected]> [jstultz: slightly reworked to use RTC_MAX_FREQ value] Signed-off-by: John Stultz <[email protected]>
2011-07-26rtc: Fix hrtimer deadlockThomas Gleixner1-19/+37
Ben reported a lockup related to rtc. The lockup happens due to: CPU0 CPU1 rtc_irq_set_state() __run_hrtimer() spin_lock_irqsave(&rtc->irq_task_lock) rtc_handle_legacy_irq(); spin_lock(&rtc->irq_task_lock); hrtimer_cancel() while (callback_running); So the running callback never finishes as it's blocked on rtc->irq_task_lock. Use hrtimer_try_to_cancel() instead and drop rtc->irq_task_lock while waiting for the callback. Fix this for both rtc_irq_set_state() and rtc_irq_set_freq(). Cc: [email protected] Reported-by: Ben Greear <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: John Stultz <[email protected]>