<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/rtc/rtc-dev.c, branch v2.6.33.12</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>headers: remove sched.h from interrupt.h</title>
<updated>2009-10-11T18:20:58+00:00</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2009-10-07T13:09:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d43c36dc6b357fa1806800f18aa30123c747a6d1'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: make rtc_update_irq callable with irqs enabled</title>
<updated>2009-06-19T23:46:05+00:00</updated>
<author>
<name>Atsushi Nemoto</name>
<email>anemo@mba.ocn.ne.jp</email>
</author>
<published>2009-06-18T23:49:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e6229bec25be4ba00f31dd26e25721cc96c22262'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: add alarm/update irq interfaces</title>
<updated>2009-01-04T21:33:20+00:00</updated>
<author>
<name>Alessandro Zummo</name>
<email>a.zummo@towertech.it</email>
</author>
<published>2009-01-04T20:00:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=099e657625e801adf82054c8050dde5aceb68452'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>saner FASYNC handling on file close</title>
<updated>2008-11-01T16:49:46+00:00</updated>
<author>
<name>Al Viro</name>
<email>viro@ZenIV.linux.org.uk</email>
</author>
<published>2008-10-31T23:28:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=233e70f4228e78eb2f80dc6650f65d3ae3dbf17c'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: file close() consistently disables repeating irqs</title>
<updated>2008-10-16T18:21:40+00:00</updated>
<author>
<name>David Brownell</name>
<email>dbrownell@users.sourceforge.net</email>
</author>
<published>2008-10-16T05:03:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=743e6a504f81d1e2f086e726b69fb6631d11f820'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: fix kernel panic on second use of SIGIO nofitication</title>
<updated>2008-10-04T01:22:17+00:00</updated>
<author>
<name>Marcin Slusarz</name>
<email>marcin.slusarz@gmail.com</email>
</author>
<published>2008-10-03T22:23:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2e4a75cdcb89ff53bb182dda3a6dcdc14befe007'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: fix double lock on UIE emulation</title>
<updated>2008-08-20T22:40:31+00:00</updated>
<author>
<name>Atsushi Nemoto</name>
<email>anemo@mba.ocn.ne.jp</email>
</author>
<published>2008-08-20T21:09:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1d96469a34781340b2cc9bdf97d5913eecdaa038'/>
<id>1d96469a34781340b2cc9bdf97d5913eecdaa038</id>
<content type='text'>
With commit 5ad31a575157147b43fa84ef1e21471661653878 ("rtc: remove BKL
for ioctl()"), RTC_UIE_ON ioctl cause double lock on rtc-&gt;ops_lock.
The ops_lock must not be held while set_uie() calls rtc_read_time()
which takes the lock.  Also clear_uie() does not need ops_lock.  This
patch fixes return value of RTC_UIE_OFF ioctl too.

Signed-off-by: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Cc: David Brownell &lt;david-b@pacbell.net&gt;
Cc: Russell King &lt;rmk@arm.linux.org.uk&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With commit 5ad31a575157147b43fa84ef1e21471661653878 ("rtc: remove BKL
for ioctl()"), RTC_UIE_ON ioctl cause double lock on rtc-&gt;ops_lock.
The ops_lock must not be held while set_uie() calls rtc_read_time()
which takes the lock.  Also clear_uie() does not need ops_lock.  This
patch fixes return value of RTC_UIE_OFF ioctl too.

Signed-off-by: Atsushi Nemoto &lt;anemo@mba.ocn.ne.jp&gt;
Cc: David Brownell &lt;david-b@pacbell.net&gt;
Cc: Russell King &lt;rmk@arm.linux.org.uk&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: "Rafael J. Wysocki" &lt;rjw@sisk.pl&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>revert "rtc: cdev lock_kernel() pushdown"</title>
<updated>2008-08-12T23:07:28+00:00</updated>
<author>
<name>David Brownell</name>
<email>dbrownell@users.sourceforge.net</email>
</author>
<published>2008-08-12T22:08:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b1c3c898274334a9255445ba0636d13eda8399d7'/>
<id>b1c3c898274334a9255445ba0636d13eda8399d7</id>
<content type='text'>
Revert commit 51a776fa7a7997e726d4a478eda0854c6f9143bd ("rtc: cdev
lock_kernel() pushdown").  The RTC framework does not need BKL
protection.

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Alessandro Zummo &lt;alessandro.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Revert commit 51a776fa7a7997e726d4a478eda0854c6f9143bd ("rtc: cdev
lock_kernel() pushdown").  The RTC framework does not need BKL
protection.

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Cc: Jonathan Corbet &lt;corbet@lwn.net&gt;
Cc: Alessandro Zummo &lt;alessandro.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;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc-dev: stop periodic interrupts on device release</title>
<updated>2008-07-30T16:41:47+00:00</updated>
<author>
<name>Tomas Janousek</name>
<email>tomi@nomi.cz</email>
</author>
<published>2008-07-30T05:33:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5cdc98b8f51310f7cca05ad780f18f80dd9571de'/>
<id>5cdc98b8f51310f7cca05ad780f18f80dd9571de</id>
<content type='text'>
Solves http://bugzilla.kernel.org/show_bug.cgi?id=11127

The old rtc.c driver did it and some drivers (like rtc-sh) do it in their
release function, though they should not -- because they should provide
the irq_set_state op and the rtc framework itself should care about it.
This patch makes it do so.

I am aware that some drivers, like rtc-sh, handle userspace PIE sets in
their ioctl op (instead of having the framework call the op), exporting
the irq_set_state op at the same time.  The logic in rtc_irq_set_state
should make sure it doesn't matter and the driver should not need to care
stopping periodic interrupts in its release routine any more.

The correct way, in my opinion, should be this:
1) The driver provides the irq_set_state op and does not care closing the
   interrupts in its release op.
2) If the driver does not provide the op and handles PIE in the ioctl op, it's
   reponsible for closing them in its release op.
3) Something similar for other IRQs, like UIE -- if there's no in-kernel API
   like irq_set_state, handle it in ioctl and release ops. The framework will
   be responsible either for everything or for nothing. (This will probably
   change later.)

Signed-off-by: Tomas Janousek &lt;tomi@nomi.cz&gt;
Acked-by: David Brownell &lt;dbrownell@users.sourceforge.net&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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Solves http://bugzilla.kernel.org/show_bug.cgi?id=11127

The old rtc.c driver did it and some drivers (like rtc-sh) do it in their
release function, though they should not -- because they should provide
the irq_set_state op and the rtc framework itself should care about it.
This patch makes it do so.

I am aware that some drivers, like rtc-sh, handle userspace PIE sets in
their ioctl op (instead of having the framework call the op), exporting
the irq_set_state op at the same time.  The logic in rtc_irq_set_state
should make sure it doesn't matter and the driver should not need to care
stopping periodic interrupts in its release routine any more.

The correct way, in my opinion, should be this:
1) The driver provides the irq_set_state op and does not care closing the
   interrupts in its release op.
2) If the driver does not provide the op and handles PIE in the ioctl op, it's
   reponsible for closing them in its release op.
3) Something similar for other IRQs, like UIE -- if there's no in-kernel API
   like irq_set_state, handle it in ioctl and release ops. The framework will
   be responsible either for everything or for nothing. (This will probably
   change later.)

Signed-off-by: Tomas Janousek &lt;tomi@nomi.cz&gt;
Acked-by: David Brownell &lt;dbrownell@users.sourceforge.net&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;
</pre>
</div>
</content>
</entry>
<entry>
<title>rtc: don't return -EBUSY when mutex_lock_interruptible() fails</title>
<updated>2008-07-30T16:41:45+00:00</updated>
<author>
<name>David Brownell</name>
<email>dbrownell@users.sourceforge.net</email>
</author>
<published>2008-07-30T05:33:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b68bb2632453a9ca7d10a00d79adf60968cb4c05'/>
<id>b68bb2632453a9ca7d10a00d79adf60968cb4c05</id>
<content type='text'>
It was pointed out that the RTC framework handles its mutex locks oddly
...  returning -EBUSY when interrupted.  This fixes that by returning the
value of mutex_lock_interruptible() (i.e.  -EINTR).

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It was pointed out that the RTC framework handles its mutex locks oddly
...  returning -EBUSY when interrupted.  This fixes that by returning the
value of mutex_lock_interruptible() (i.e.  -EINTR).

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&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;
</pre>
</div>
</content>
</entry>
</feed>
