<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/rtc/rtc-dev.c, branch v2.6.38</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.38</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.38'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2011-02-17T22:59:42Z</updated>
<entry>
<title>RTC: Re-enable UIE timer/polling emulation</title>
<updated>2011-02-17T22:59:42Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2011-02-12T02:15:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=456d66ecd09e3bc326b93174745faafb6ac378d6'/>
<id>urn:sha1:456d66ecd09e3bc326b93174745faafb6ac378d6</id>
<content type='text'>
This patch re-enables UIE timer/polling emulation for rtc devices
that do not support alarm irqs.

CC: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
CC: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reported-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Tested-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>RTC: Revert UIE emulation removal</title>
<updated>2011-02-17T22:59:41Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2011-02-12T01:45:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6e57b1d6a8d8ed1998229b71c102be1997e397c6'/>
<id>urn:sha1:6e57b1d6a8d8ed1998229b71c102be1997e397c6</id>
<content type='text'>
Uwe pointed out that my alarm based UIE emulation is not sufficient
to replace the older timer/polling based UIE emulation on devices
where there is no alarm irq. This causes rtc devices without alarms
to return -EINVAL to UIE ioctls. The fix is to re-instate the old
timer/polling method for devices without alarm irqs.

This patch reverts the following commits:
042620a018afcfba1d678062b62e46 - Remove UIE emulation
1daeddd5962acad1bea55e524fc0fa - Cleanup removed UIE emulation declaration
b5cc8ca1c9c3a37eaddf709b2fd3e1 - Remove Kconfig symbol for UIE emulation

The emulation mode will still need to be wired-in with a following
patch before it will work.

CC: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
CC: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reported-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>RTC: Fix rtc driver ioctl specific shortcutting</title>
<updated>2011-02-03T21:02:18Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2011-02-03T00:55:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ac54cd2bd5b4db4f1c03392d63daf355627ea180'/>
<id>urn:sha1:ac54cd2bd5b4db4f1c03392d63daf355627ea180</id>
<content type='text'>
Some RTC drivers enable functionality directly via their ioctl method
instead of using the generic ioctl handling code. With the recent
virtualization of the RTC layer, its now important that the generic
layer always be used.

This patch moved the rtc driver ioctl method call to after the generic
ioctl processing is done. This allows hardware specific features or
ioctls to still function, while relying on the generic code for handling
everything else.

This patch on its own may more obviously break rtc drivers that
implement the alarm irq enablement via their ioctl method instead of
implementing the alarm_irq_eanble method. Those drivers will be fixed
in a following patch. Additionaly, those drivers are already likely to
not be functioning reliably without this patch.

CC: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
CC: Marcelo Roberto Jimenez &lt;mroberto@cpti.cetuc.puc-rio.br&gt;
CC: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reported-by: Marcelo Roberto Jimenez &lt;mroberto@cpti.cetuc.puc-rio.br&gt;
Tested-by: Marcelo Roberto Jimenez &lt;mroberto@cpti.cetuc.puc-rio.br&gt;
Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
</content>
</entry>
<entry>
<title>RTC: Remove UIE emulation</title>
<updated>2010-12-11T06:24:25Z</updated>
<author>
<name>John Stultz</name>
<email>john.stultz@linaro.org</email>
</author>
<published>2010-10-14T23:22:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=042620a018afcfba1d678062b62e463b9e43a68d'/>
<id>urn:sha1:042620a018afcfba1d678062b62e463b9e43a68d</id>
<content type='text'>
Since we provide UIE interrupts via a rtc_timer, the old
emulation code can be removed.

Signed-off-by: John Stultz &lt;john.stultz@linaro.org&gt;
LKML Reference: &lt;1290136329-18291-5-git-send-email-john.stultz@linaro.org&gt;
Acked-by: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Reviewed-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
CC: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
CC: Thomas Gleixner &lt;tglx@linutronix.de&gt;
CC: Richard Cochran &lt;richardcochran@gmail.com&gt;
</content>
</entry>
<entry>
<title>headers: remove sched.h from interrupt.h</title>
<updated>2009-10-11T18:20:58Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2009-10-07T13:09:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d43c36dc6b357fa1806800f18aa30123c747a6d1'/>
<id>urn:sha1:d43c36dc6b357fa1806800f18aa30123c747a6d1</id>
<content type='text'>
After m68k's task_thread_info() doesn't refer to current,
it's possible to remove sched.h from interrupt.h and not break m68k!
Many thanks to Heiko Carstens for allowing this.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
</content>
</entry>
<entry>
<title>rtc: make rtc_update_irq callable with irqs enabled</title>
<updated>2009-06-19T23:46:05Z</updated>
<author>
<name>Atsushi Nemoto</name>
<email>anemo@mba.ocn.ne.jp</email>
</author>
<published>2009-06-18T23:49:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e6229bec25be4ba00f31dd26e25721cc96c22262'/>
<id>urn:sha1:e6229bec25be4ba00f31dd26e25721cc96c22262</id>
<content type='text'>
The rtc_update_irq() might be called with irqs enabled, if a interrupt
handler was registered without IRQF_DISABLED.  Use
spin_lock_irqsave/spin_unlock_irqrestore instead of spin_lock/spin_unlock.

Also update kerneldoc and drivers which do extra work to follow the
current interface spec, as suggestted by David Brownell.

Signed-off-by: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: David Brownell &lt;david-b@pacbell.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>rtc: add alarm/update irq interfaces</title>
<updated>2009-01-04T21:33:20Z</updated>
<author>
<name>Alessandro Zummo</name>
<email>a.zummo@towertech.it</email>
</author>
<published>2009-01-04T20:00:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=099e657625e801adf82054c8050dde5aceb68452'/>
<id>urn:sha1:099e657625e801adf82054c8050dde5aceb68452</id>
<content type='text'>
Add standard interfaces for alarm/update irqs enabling.  Drivers are no
more required to implement equivalent ioctl code as rtc-dev will provide
it.

UIE emulation should now be handled correctly and will work even for those
RTC drivers who cannot be configured to do both UIE and AIE.

Signed-off-by: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: David Brownell &lt;david-b@pacbell.net&gt;
Cc: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>saner FASYNC handling on file close</title>
<updated>2008-11-01T16:49:46Z</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2008-10-31T23:28:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=233e70f4228e78eb2f80dc6650f65d3ae3dbf17c'/>
<id>urn:sha1:233e70f4228e78eb2f80dc6650f65d3ae3dbf17c</id>
<content type='text'>
As it is, all instances of -&gt;release() for files that have -&gt;fasync()
need to remember to evict file from fasync lists; forgetting that
creates a hole and we actually have a bunch that *does* forget.

So let's keep our lives simple - let __fput() check FASYNC in
file-&gt;f_flags and call -&gt;fasync() there if it's been set.  And lose that
crap in -&gt;release() instances - leaving it there is still valid, but we
don't have to bother anymore.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>rtc: file close() consistently disables repeating irqs</title>
<updated>2008-10-16T18:21:40Z</updated>
<author>
<name>David Brownell</name>
<email>dbrownell@users.sourceforge.net</email>
</author>
<published>2008-10-16T05:03:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=743e6a504f81d1e2f086e726b69fb6631d11f820'/>
<id>urn:sha1:743e6a504f81d1e2f086e726b69fb6631d11f820</id>
<content type='text'>
Make the rtc framework consistent about disabling 1/second update IRQs
that may have been activated through the /dev interface, when that /dev
file is closed.  (It may have closed because of coredump, etc.) This was
previously done only for emulated update IRQs ...  now, do it always.

Also comment the current policy: repeating IRQs (periodic, update) that
userspace enabled will be cleanly disabled, but alarms are left alone.
Such repeating IRQs are a constant and pointless system load.

Update some RTC drivers to remove now-needless release() methods.  Most
such methods just enforce that policy.  The others all seem to be buggy,
and mistreat in-kernel clients of periodic or alarm IRQs.

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Acked-by: Andrew Sharp &lt;andy.sharp@onstor.com&gt;
Cc: Angelo Castello &lt;angelo.castello@st.com&gt;
Acked-by: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Acked-by: Paul Mundt &lt;lethal@linux-sh.org&gt;
Cc: Thomas Hommel &lt;thomas.hommel@gefanuc.com&gt;
Acked-by: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>rtc: fix kernel panic on second use of SIGIO nofitication</title>
<updated>2008-10-04T01:22:17Z</updated>
<author>
<name>Marcin Slusarz</name>
<email>marcin.slusarz@gmail.com</email>
</author>
<published>2008-10-03T22:23:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2e4a75cdcb89ff53bb182dda3a6dcdc14befe007'/>
<id>urn:sha1:2e4a75cdcb89ff53bb182dda3a6dcdc14befe007</id>
<content type='text'>
When userspace uses SIGIO notification and forgets to disable it before
closing file descriptor, rtc-&gt;async_queue contains stale pointer to struct
file.  When user space enables again SIGIO notification in different
process, kernel dereferences this (poisoned) pointer and crashes.

So disable SIGIO notification on close.

Kernel panic:
(second run of qemu (requires echo 1024 &gt; /sys/class/rtc/rtc0/max_user_freq))

general protection fault: 0000 [1] PREEMPT
CPU 0
Modules linked in: af_packet snd_pcm_oss snd_mixer_oss snd_seq_oss snd_seq_midi_event snd_seq usbhid tuner tea5767 tda8290 tuner_xc2028 xc5000 tda9887 tuner_simple tuner_types mt20xx tea5761 tda9875 uhci_hcd ehci_hcd usbcore bttv snd_via82xx snd_ac97_codec ac97_bus snd_pcm snd_timer ir_common compat_ioctl32 snd_page_alloc videodev v4l1_compat snd_mpu401_uart snd_rawmidi v4l2_common videobuf_dma_sg videobuf_core snd_seq_device snd btcx_risc soundcore tveeprom i2c_viapro
Pid: 5781, comm: qemu-system-x86 Not tainted 2.6.27-rc6 #363
RIP: 0010:[&lt;ffffffff8024f891&gt;]  [&lt;ffffffff8024f891&gt;] __lock_acquire+0x3db/0x73f
RSP: 0000:ffffffff80674cb8  EFLAGS: 00010002
RAX: ffff8800224c62f0 RBX: 0000000000000046 RCX: 0000000000000002
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8800224c62f0
RBP: ffffffff80674d08 R08: 0000000000000002 R09: 0000000000000001
R10: ffffffff80238941 R11: 0000000000000001 R12: 0000000000000000
R13: 6b6b6b6b6b6b6b6b R14: ffff88003a450080 R15: 0000000000000000
FS:  00007f98b69516f0(0000) GS:ffffffff80623200(0000) knlGS:00000000f7cc86d0
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000a87000 CR3: 0000000022598000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process qemu-system-x86 (pid: 5781, threadinfo ffff880028812000, task ffff88003a450080)
Stack:  ffffffff80674cf8 0000000180238440 0000000200000002 0000000000000000
 ffff8800224c62f0 0000000000000046 0000000000000000 0000000000000002
 0000000000000002 0000000000000000 ffffffff80674d68 ffffffff8024fc7a
Call Trace:
 &lt;IRQ&gt;  [&lt;ffffffff8024fc7a&gt;] lock_acquire+0x85/0xa9
 [&lt;ffffffff8029cb62&gt;] ? send_sigio+0x2a/0x184
 [&lt;ffffffff80491d1f&gt;] _read_lock+0x3e/0x4a
 [&lt;ffffffff8029cb62&gt;] ? send_sigio+0x2a/0x184
 [&lt;ffffffff8029cb62&gt;] send_sigio+0x2a/0x184
 [&lt;ffffffff8024fb97&gt;] ? __lock_acquire+0x6e1/0x73f
 [&lt;ffffffff8029cd4d&gt;] ? kill_fasync+0x2c/0x4e
 [&lt;ffffffff8029cd10&gt;] __kill_fasync+0x54/0x65
 [&lt;ffffffff8029cd5b&gt;] kill_fasync+0x3a/0x4e
 [&lt;ffffffff80402896&gt;] rtc_update_irq+0x9c/0xa5
 [&lt;ffffffff80404640&gt;] cmos_interrupt+0xae/0xc0
 [&lt;ffffffff8025d1c1&gt;] handle_IRQ_event+0x25/0x5a
 [&lt;ffffffff8025e5e4&gt;] handle_edge_irq+0xdd/0x123
 [&lt;ffffffff8020da34&gt;] do_IRQ+0xe4/0x144
 [&lt;ffffffff8020bad6&gt;] ret_from_intr+0x0/0xf
 &lt;EOI&gt;  [&lt;ffffffff8026fdc2&gt;] ? __alloc_pages_internal+0xe7/0x3ad
 [&lt;ffffffff8033fe67&gt;] ? clear_page_c+0x7/0x10
 [&lt;ffffffff8026fc10&gt;] ? get_page_from_freelist+0x385/0x450
 [&lt;ffffffff8026fdc2&gt;] ? __alloc_pages_internal+0xe7/0x3ad
 [&lt;ffffffff80280aac&gt;] ? anon_vma_prepare+0x2e/0xf6
 [&lt;ffffffff80279400&gt;] ? handle_mm_fault+0x227/0x6a5
 [&lt;ffffffff80494716&gt;] ? do_page_fault+0x494/0x83f
 [&lt;ffffffff8049251d&gt;] ? error_exit+0x0/0xa9

Code: cc 41 39 45 28 74 24 e8 5e 1d 0f 00 85 c0 0f 84 6a 03 00 00 83 3d 8f a9 aa 00 00 be 47 03 00 00 0f 84 6a 02 00 00 e9 53 03 00 00 &lt;41&gt; ff 85 38 01 00 00 45 8b be 90 06 00 00 41 83 ff 2f 76 24 e8
RIP  [&lt;ffffffff8024f891&gt;] __lock_acquire+0x3db/0x73f
 RSP &lt;ffffffff80674cb8&gt;
---[ end trace 431877d860448760 ]---
Kernel panic - not syncing: Aiee, killing interrupt handler!

Signed-off-by: Marcin Slusarz &lt;marcin.slusarz@gmail.com&gt;
Acked-by: Alessandro Zummo &lt;alessandro.zummo@towertech.it&gt;
Acked-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
