<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel/printk.c, branch v3.2.9-rt16</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>sysrq: Allow immediate Magic SysRq output for PREEMPT_RT_FULL</title>
<updated>2012-03-06T16:18:02+00:00</updated>
<author>
<name>Frank Rowand</name>
<email>frank.rowand@am.sony.com</email>
</author>
<published>2011-09-23T20:43:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=66e8b05dbead4926e9fea7039e7c8564c462b806'/>
<id>66e8b05dbead4926e9fea7039e7c8564c462b806</id>
<content type='text'>
Add a CONFIG option to allow the output from Magic SysRq to be output
immediately, even if this causes large latencies.

If PREEMPT_RT_FULL, printk() will not try to acquire the console lock
when interrupts or preemption are disabled.  If the console lock is
not acquired the printk() output will be buffered, but will not be
output immediately. Some drivers call into the Magic SysRq code
with interrupts or preemption disabled, so the output of Magic SysRq
will be buffered instead of printing immediately if this option is
not selected.

Even with this option selected, Magic SysRq output will be delayed
if the attempt to acquire the console lock fails.

Signed-off-by: Frank Rowand &lt;frank.rowand@am.sony.com&gt;
Link: http://lkml.kernel.org/r/4E7CEF60.5020508@am.sony.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a CONFIG option to allow the output from Magic SysRq to be output
immediately, even if this causes large latencies.

If PREEMPT_RT_FULL, printk() will not try to acquire the console lock
when interrupts or preemption are disabled.  If the console lock is
not acquired the printk() output will be buffered, but will not be
output immediately. Some drivers call into the Magic SysRq code
with interrupts or preemption disabled, so the output of Magic SysRq
will be buffered instead of printing immediately if this option is
not selected.

Even with this option selected, Magic SysRq output will be delayed
if the attempt to acquire the console lock fails.

Signed-off-by: Frank Rowand &lt;frank.rowand@am.sony.com&gt;
Link: http://lkml.kernel.org/r/4E7CEF60.5020508@am.sony.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>printk: Disable migration instead of preemption</title>
<updated>2012-03-06T16:18:00+00:00</updated>
<author>
<name>Richard Weinberger</name>
<email>rw@linutronix.de</email>
</author>
<published>2011-12-12T13:35:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2606b9f836fd9dddc50d125766e9678436f2fe7b'/>
<id>2606b9f836fd9dddc50d125766e9678436f2fe7b</id>
<content type='text'>
There is no need do disable preemption in vprintk(), disable_migrate()
is sufficient. This fixes the following bug in -rt:

[   14.759233] BUG: sleeping function called from invalid context
at /home/rw/linux-rt/kernel/rtmutex.c:645
[   14.759235] in_atomic(): 1, irqs_disabled(): 0, pid: 547, name: bash
[   14.759244] Pid: 547, comm: bash Not tainted 3.0.12-rt29+ #3
[   14.759246] Call Trace:
[   14.759301]  [&lt;ffffffff8106fade&gt;] __might_sleep+0xeb/0xf0
[   14.759318]  [&lt;ffffffff810ad784&gt;] rt_spin_lock_fastlock.constprop.9+0x21/0x43
[   14.759336]  [&lt;ffffffff8161fef0&gt;] rt_spin_lock+0xe/0x10
[   14.759354]  [&lt;ffffffff81347ad1&gt;] serial8250_console_write+0x81/0x121
[   14.759366]  [&lt;ffffffff8107ecd3&gt;] __call_console_drivers+0x7c/0x93
[   14.759369]  [&lt;ffffffff8107ef31&gt;] _call_console_drivers+0x5c/0x60
[   14.759372]  [&lt;ffffffff8107f7e5&gt;] console_unlock+0x147/0x1a2
[   14.759374]  [&lt;ffffffff8107fd33&gt;] vprintk+0x3ea/0x462
[   14.759383]  [&lt;ffffffff816160e0&gt;] printk+0x51/0x53
[   14.759399]  [&lt;ffffffff811974e4&gt;] ? proc_reg_poll+0x9a/0x9a
[   14.759403]  [&lt;ffffffff81335b42&gt;] __handle_sysrq+0x50/0x14d
[   14.759406]  [&lt;ffffffff81335c8a&gt;] write_sysrq_trigger+0x4b/0x53
[   14.759408]  [&lt;ffffffff81335c3f&gt;] ? __handle_sysrq+0x14d/0x14d
[   14.759410]  [&lt;ffffffff81197583&gt;] proc_reg_write+0x9f/0xbe
[   14.759426]  [&lt;ffffffff811497ec&gt;] vfs_write+0xac/0xf3
[   14.759429]  [&lt;ffffffff8114a9b3&gt;] ? fget_light+0x3a/0x9b
[   14.759431]  [&lt;ffffffff811499db&gt;] sys_write+0x4a/0x6e
[   14.759438]  [&lt;ffffffff81625d52&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Richard Weinberger &lt;rw@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1323696956-11445-1-git-send-email-rw@linutronix.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is no need do disable preemption in vprintk(), disable_migrate()
is sufficient. This fixes the following bug in -rt:

[   14.759233] BUG: sleeping function called from invalid context
at /home/rw/linux-rt/kernel/rtmutex.c:645
[   14.759235] in_atomic(): 1, irqs_disabled(): 0, pid: 547, name: bash
[   14.759244] Pid: 547, comm: bash Not tainted 3.0.12-rt29+ #3
[   14.759246] Call Trace:
[   14.759301]  [&lt;ffffffff8106fade&gt;] __might_sleep+0xeb/0xf0
[   14.759318]  [&lt;ffffffff810ad784&gt;] rt_spin_lock_fastlock.constprop.9+0x21/0x43
[   14.759336]  [&lt;ffffffff8161fef0&gt;] rt_spin_lock+0xe/0x10
[   14.759354]  [&lt;ffffffff81347ad1&gt;] serial8250_console_write+0x81/0x121
[   14.759366]  [&lt;ffffffff8107ecd3&gt;] __call_console_drivers+0x7c/0x93
[   14.759369]  [&lt;ffffffff8107ef31&gt;] _call_console_drivers+0x5c/0x60
[   14.759372]  [&lt;ffffffff8107f7e5&gt;] console_unlock+0x147/0x1a2
[   14.759374]  [&lt;ffffffff8107fd33&gt;] vprintk+0x3ea/0x462
[   14.759383]  [&lt;ffffffff816160e0&gt;] printk+0x51/0x53
[   14.759399]  [&lt;ffffffff811974e4&gt;] ? proc_reg_poll+0x9a/0x9a
[   14.759403]  [&lt;ffffffff81335b42&gt;] __handle_sysrq+0x50/0x14d
[   14.759406]  [&lt;ffffffff81335c8a&gt;] write_sysrq_trigger+0x4b/0x53
[   14.759408]  [&lt;ffffffff81335c3f&gt;] ? __handle_sysrq+0x14d/0x14d
[   14.759410]  [&lt;ffffffff81197583&gt;] proc_reg_write+0x9f/0xbe
[   14.759426]  [&lt;ffffffff811497ec&gt;] vfs_write+0xac/0xf3
[   14.759429]  [&lt;ffffffff8114a9b3&gt;] ? fget_light+0x3a/0x9b
[   14.759431]  [&lt;ffffffff811499db&gt;] sys_write+0x4a/0x6e
[   14.759438]  [&lt;ffffffff81625d52&gt;] system_call_fastpath+0x16/0x1b

Signed-off-by: Richard Weinberger &lt;rw@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1323696956-11445-1-git-send-email-rw@linutronix.de
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>console-make-rt-friendly.patch</title>
<updated>2012-03-06T16:18:00+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2011-07-17T20:43:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=416546ceb22b5517494b0f106da79e1b0e521a13'/>
<id>416546ceb22b5517494b0f106da79e1b0e521a13</id>
<content type='text'>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>printk: Don't call printk_tick in printk_needs_cpu() on RT</title>
<updated>2012-03-06T16:17:46+00:00</updated>
<author>
<name>Yong Zhang</name>
<email>yong.zhang0@gmail.com</email>
</author>
<published>2011-10-16T10:56:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=47e51286a58853660837977e8eb8cbac4f599bac'/>
<id>47e51286a58853660837977e8eb8cbac4f599bac</id>
<content type='text'>
printk_tick() can't be called in atomic context when RT is enabled,
otherwise below warning will show:

[  117.597095] BUG: sleeping function called from invalid context at kernel/rtmutex.c:645
[  117.597102] in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: kworker/0:0
[  117.597111] Pid: 0, comm: kworker/0:0 Not tainted 3.0.6-rt17-00284-gb76d419-dirty #7
[  117.597116] Call Trace:
[  117.597131]  [&lt;c06e3b61&gt;] ? printk+0x1d/0x24
[  117.597142]  [&lt;c01390b6&gt;] __might_sleep+0xe6/0x110
[  117.597151]  [&lt;c06e634c&gt;] rt_spin_lock+0x1c/0x30
[  117.597158]  [&lt;c0142f26&gt;] __wake_up+0x26/0x60
[  117.597166]  [&lt;c014c78e&gt;] printk_tick+0x3e/0x40
[  117.597173]  [&lt;c014c7b4&gt;] printk_needs_cpu+0x24/0x30
[  117.597181]  [&lt;c017ecc8&gt;] tick_nohz_stop_sched_tick+0x2e8/0x410
[  117.597191]  [&lt;c017305a&gt;] ? sched_clock_idle_wakeup_event+0x1a/0x20
[  117.597201]  [&lt;c010182a&gt;] cpu_idle+0x4a/0xb0
[  117.597209]  [&lt;c06e0b97&gt;] start_secondary+0xd3/0xd7

Now this is a really rare case and it's very unlikely that we starve
an logbuf waiter that way.

Signed-off-by: Yong Zhang &lt;yong.zhang0@gmail.com&gt;
Link: http://lkml.kernel.org/r/1318762607-2261-4-git-send-email-yong.zhang0@gmail.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
printk_tick() can't be called in atomic context when RT is enabled,
otherwise below warning will show:

[  117.597095] BUG: sleeping function called from invalid context at kernel/rtmutex.c:645
[  117.597102] in_atomic(): 1, irqs_disabled(): 1, pid: 0, name: kworker/0:0
[  117.597111] Pid: 0, comm: kworker/0:0 Not tainted 3.0.6-rt17-00284-gb76d419-dirty #7
[  117.597116] Call Trace:
[  117.597131]  [&lt;c06e3b61&gt;] ? printk+0x1d/0x24
[  117.597142]  [&lt;c01390b6&gt;] __might_sleep+0xe6/0x110
[  117.597151]  [&lt;c06e634c&gt;] rt_spin_lock+0x1c/0x30
[  117.597158]  [&lt;c0142f26&gt;] __wake_up+0x26/0x60
[  117.597166]  [&lt;c014c78e&gt;] printk_tick+0x3e/0x40
[  117.597173]  [&lt;c014c7b4&gt;] printk_needs_cpu+0x24/0x30
[  117.597181]  [&lt;c017ecc8&gt;] tick_nohz_stop_sched_tick+0x2e8/0x410
[  117.597191]  [&lt;c017305a&gt;] ? sched_clock_idle_wakeup_event+0x1a/0x20
[  117.597201]  [&lt;c010182a&gt;] cpu_idle+0x4a/0xb0
[  117.597209]  [&lt;c06e0b97&gt;] start_secondary+0xd3/0xd7

Now this is a really rare case and it's very unlikely that we starve
an logbuf waiter that way.

Signed-off-by: Yong Zhang &lt;yong.zhang0@gmail.com&gt;
Link: http://lkml.kernel.org/r/1318762607-2261-4-git-send-email-yong.zhang0@gmail.com
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>printk: 'force_early_printk' boot param to help with debugging</title>
<updated>2012-03-06T16:17:37+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>a.p.zijlstra@chello.nl</email>
</author>
<published>2011-09-02T12:29:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=75240cda315fb14fad4dfef11805632106dd58e3'/>
<id>75240cda315fb14fad4dfef11805632106dd58e3</id>
<content type='text'>
Gives me an option to screw printk and actually see what the machine
says.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/1314967289.1301.11.camel@twins
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/n/tip-ykb97nsfmobq44xketrxs977@git.kernel.org
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Gives me an option to screw printk and actually see what the machine
says.

Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/1314967289.1301.11.camel@twins
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/n/tip-ykb97nsfmobq44xketrxs977@git.kernel.org
</pre>
</div>
</content>
</entry>
<entry>
<title>printk-kill.patch</title>
<updated>2012-03-06T16:17:37+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2011-07-22T15:58:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0c3e0037257073aefd8c3efa130980830905daa6'/>
<id>0c3e0037257073aefd8c3efa130980830905daa6</id>
<content type='text'>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>early-printk-consolidate.patch</title>
<updated>2012-03-06T16:17:37+00:00</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2011-07-23T09:04:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=02d2c2ede6b5660b773906814deca8aab5f49467'/>
<id>02d2c2ede6b5660b773906814deca8aab5f49467</id>
<content type='text'>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>printk: avoid double lock acquire</title>
<updated>2011-12-09T15:50:28+00:00</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2011-12-08T22:34:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=09dc3cf93f7d16fdd37a0ad8486faebb5e2769ec'/>
<id>09dc3cf93f7d16fdd37a0ad8486faebb5e2769ec</id>
<content type='text'>
Commit 4f2a8d3cf5e ("printk: Fix console_sem vs logbuf_lock unlock race")
introduced another silly bug where we would want to acquire an already
held lock.  Avoid this.

Reported-by: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&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>
Commit 4f2a8d3cf5e ("printk: Fix console_sem vs logbuf_lock unlock race")
introduced another silly bug where we would want to acquire an already
held lock.  Avoid this.

Reported-by: Andrea Arcangeli &lt;aarcange@redhat.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&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>printk: remove bounds checking for log_prefix</title>
<updated>2011-11-01T00:30:53+00:00</updated>
<author>
<name>William Douglas</name>
<email>william.r.douglas@gmail.com</email>
</author>
<published>2011-11-01T00:11:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ae29bc92da01a2e9d278a9a58c3b307d41cc0254'/>
<id>ae29bc92da01a2e9d278a9a58c3b307d41cc0254</id>
<content type='text'>
Currently log_prefix is testing that the first character of the log level
and facility is less than '0' and greater than '9' (which is always
false).

Since the code being updated works because strtoul bombs out (endp isn't
updated) and 0 is returned anyway just remove the check and don't change
the behavior of the function.

Signed-off-by: William Douglas &lt;william.douglas@intel.com&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>
Currently log_prefix is testing that the first character of the log level
and facility is less than '0' and greater than '9' (which is always
false).

Since the code being updated works because strtoul bombs out (endp isn't
updated) and 0 is returned anyway just remove the check and don't change
the behavior of the function.

Signed-off-by: William Douglas &lt;william.douglas@intel.com&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>printk: fix bounds checking for log_prefix</title>
<updated>2011-11-01T00:30:53+00:00</updated>
<author>
<name>William Douglas</name>
<email>william.r.douglas@gmail.com</email>
</author>
<published>2011-11-01T00:11:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=48e41899e4a3592746e5263c14681bf5c1393563'/>
<id>48e41899e4a3592746e5263c14681bf5c1393563</id>
<content type='text'>
Currently log_prefix is testing that the first character of the log level
and facility is less than '0' and greater than '9' (which is always
false).  It should be testing to see if the character less than '0' or
greater than '9' instead.  This patch makes that change.

The code being changed worked because strtoul bombs out (endp isn't
updated) and 0 is returned anyway.

Signed-off-by: William Douglas &lt;william.douglas@intel.com&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>
Currently log_prefix is testing that the first character of the log level
and facility is less than '0' and greater than '9' (which is always
false).  It should be testing to see if the character less than '0' or
greater than '9' instead.  This patch makes that change.

The code being changed worked because strtoul bombs out (endp isn't
updated) and 0 is returned anyway.

Signed-off-by: William Douglas &lt;william.douglas@intel.com&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>
