<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel/printk.c, branch v2.6.18</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>[PATCH] vt: printk: Fix framebuffer console triggering might_sleep assertion</title>
<updated>2006-08-06T15:57:47+00:00</updated>
<author>
<name>Antonino A. Daplas</name>
<email>adaplas@gmail.com</email>
</author>
<published>2006-08-05T19:14:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=78944e549d36673eb6265a2411574e79c28e23dc'/>
<id>78944e549d36673eb6265a2411574e79c28e23dc</id>
<content type='text'>
Reported by: Dave Jones

Whilst printk'ing to both console and serial console, I got this...
(2.6.18rc1)

BUG: sleeping function called from invalid context at kernel/sched.c:4438
in_atomic():0, irqs_disabled():1

Call Trace:
 [&lt;ffffffff80271db8&gt;] show_trace+0xaa/0x23d
 [&lt;ffffffff80271f60&gt;] dump_stack+0x15/0x17
 [&lt;ffffffff8020b9f8&gt;] __might_sleep+0xb2/0xb4
 [&lt;ffffffff8029232e&gt;] __cond_resched+0x15/0x55
 [&lt;ffffffff80267eb8&gt;] cond_resched+0x3b/0x42
 [&lt;ffffffff80268c64&gt;] console_conditional_schedule+0x12/0x14
 [&lt;ffffffff80368159&gt;] fbcon_redraw+0xf6/0x160
 [&lt;ffffffff80369c58&gt;] fbcon_scroll+0x5d9/0xb52
 [&lt;ffffffff803a43c4&gt;] scrup+0x6b/0xd6
 [&lt;ffffffff803a4453&gt;] lf+0x24/0x44
 [&lt;ffffffff803a7ff8&gt;] vt_console_print+0x166/0x23d
 [&lt;ffffffff80295528&gt;] __call_console_drivers+0x65/0x76
 [&lt;ffffffff80295597&gt;] _call_console_drivers+0x5e/0x62
 [&lt;ffffffff80217e3f&gt;] release_console_sem+0x14b/0x232
 [&lt;ffffffff8036acd6&gt;] fb_flashcursor+0x279/0x2a6
 [&lt;ffffffff80251e3f&gt;] run_workqueue+0xa8/0xfb
 [&lt;ffffffff8024e5e0&gt;] worker_thread+0xef/0x122
 [&lt;ffffffff8023660f&gt;] kthread+0x100/0x136
 [&lt;ffffffff8026419e&gt;] child_rip+0x8/0x12

This can occur when release_console_sem() is called but the log
buffer still has contents that need to be flushed. The console drivers
are called while the console_may_schedule flag is still true. The
might_sleep() is triggered when fbcon calls console_conditional_schedule().

Fix by setting console_may_schedule to zero earlier, before the call to the
console drivers.

Signed-off-by: Antonino Daplas &lt;adaplas@pol.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reported by: Dave Jones

Whilst printk'ing to both console and serial console, I got this...
(2.6.18rc1)

BUG: sleeping function called from invalid context at kernel/sched.c:4438
in_atomic():0, irqs_disabled():1

Call Trace:
 [&lt;ffffffff80271db8&gt;] show_trace+0xaa/0x23d
 [&lt;ffffffff80271f60&gt;] dump_stack+0x15/0x17
 [&lt;ffffffff8020b9f8&gt;] __might_sleep+0xb2/0xb4
 [&lt;ffffffff8029232e&gt;] __cond_resched+0x15/0x55
 [&lt;ffffffff80267eb8&gt;] cond_resched+0x3b/0x42
 [&lt;ffffffff80268c64&gt;] console_conditional_schedule+0x12/0x14
 [&lt;ffffffff80368159&gt;] fbcon_redraw+0xf6/0x160
 [&lt;ffffffff80369c58&gt;] fbcon_scroll+0x5d9/0xb52
 [&lt;ffffffff803a43c4&gt;] scrup+0x6b/0xd6
 [&lt;ffffffff803a4453&gt;] lf+0x24/0x44
 [&lt;ffffffff803a7ff8&gt;] vt_console_print+0x166/0x23d
 [&lt;ffffffff80295528&gt;] __call_console_drivers+0x65/0x76
 [&lt;ffffffff80295597&gt;] _call_console_drivers+0x5e/0x62
 [&lt;ffffffff80217e3f&gt;] release_console_sem+0x14b/0x232
 [&lt;ffffffff8036acd6&gt;] fb_flashcursor+0x279/0x2a6
 [&lt;ffffffff80251e3f&gt;] run_workqueue+0xa8/0xfb
 [&lt;ffffffff8024e5e0&gt;] worker_thread+0xef/0x122
 [&lt;ffffffff8023660f&gt;] kthread+0x100/0x136
 [&lt;ffffffff8026419e&gt;] child_rip+0x8/0x12

This can occur when release_console_sem() is called but the log
buffer still has contents that need to be flushed. The console drivers
are called while the console_may_schedule flag is still true. The
might_sleep() is triggered when fbcon calls console_conditional_schedule().

Fix by setting console_may_schedule to zero earlier, before the call to the
console drivers.

Signed-off-by: Antonino Daplas &lt;adaplas@pol.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] kernel/printk.c: EXPORT_SYMBOL_UNUSED</title>
<updated>2006-07-10T20:24:17+00:00</updated>
<author>
<name>Adrian Bunk</name>
<email>bunk@stusta.de</email>
</author>
<published>2006-07-10T11:44:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c0fc84d2e5bb4a9e3ae470812a00cccba85a48b8'/>
<id>c0fc84d2e5bb4a9e3ae470812a00cccba85a48b8</id>
<content type='text'>
This patch marks unused exports as EXPORT_SYMBOL_UNUSED.

Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch marks unused exports as EXPORT_SYMBOL_UNUSED.

Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] lockdep: do not recurse in printk</title>
<updated>2006-07-03T22:27:05+00:00</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2006-07-03T07:24:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a0f1ccfd8d37457a6d8a9e01acebeefcdfcc306e'/>
<id>a0f1ccfd8d37457a6d8a9e01acebeefcdfcc306e</id>
<content type='text'>
Make printk()-ing from within the lock validation code safer by using the
lockdep-recursion counter.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make printk()-ing from within the lock validation code safer by using the
lockdep-recursion counter.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove obsolete #include &lt;linux/config.h&gt;</title>
<updated>2006-06-30T17:25:36+00:00</updated>
<author>
<name>Jörn Engel</name>
<email>joern@wohnheim.fh-wedel.de</email>
</author>
<published>2006-06-30T17:25:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6ab3d5624e172c553004ecc862bfeac16d9d68b7'/>
<id>6ab3d5624e172c553004ecc862bfeac16d9d68b7</id>
<content type='text'>
Signed-off-by: Jörn Engel &lt;joern@wohnheim.fh-wedel.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Jörn Engel &lt;joern@wohnheim.fh-wedel.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] printk time parameter</title>
<updated>2006-06-25T17:01:13+00:00</updated>
<author>
<name>Jan Engelhardt</name>
<email>jengelh@linux01.gwdg.de</email>
</author>
<published>2006-06-25T12:48:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3b9c04106b70e46803c69d13d5da32f6129fa76d'/>
<id>3b9c04106b70e46803c69d13d5da32f6129fa76d</id>
<content type='text'>
Currently, enabling/disabling printk timestamps is only possible through
reboot (bootparam) or recompile.  I normally do not run with timestamps
(since syslog handles that in a good manner), but for measuring small
kernel delays (e.g.  irq probing - see parport thread) I needed subsecond
precision, but then again, just for some minutes rather than all kernel
messages to come.  The following patch adds a module_param() with which the
timestamps can be en-/disabled in a live system through
/sys/modules/printk/parameters/printk_time.

Signed-off-by: Jan Engelhardt &lt;jengelh@gmx.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, enabling/disabling printk timestamps is only possible through
reboot (bootparam) or recompile.  I normally do not run with timestamps
(since syslog handles that in a good manner), but for measuring small
kernel delays (e.g.  irq probing - see parport thread) I needed subsecond
precision, but then again, just for some minutes rather than all kernel
messages to come.  The following patch adds a module_param() with which the
timestamps can be en-/disabled in a live system through
/sys/modules/printk/parameters/printk_time.

Signed-off-by: Jan Engelhardt &lt;jengelh@gmx.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] Make printk work for really early debugging</title>
<updated>2006-06-25T17:01:05+00:00</updated>
<author>
<name>Michael Ellerman</name>
<email>michael@ellerman.id.au</email>
</author>
<published>2006-06-25T12:47:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=76a8ad293912cd2f01eca075d80cd0ddec30c627'/>
<id>76a8ad293912cd2f01eca075d80cd0ddec30c627</id>
<content type='text'>
Currently printk is no use for early debugging because it refuses to
actually print anything to the console unless
cpu_online(smp_processor_id()) is true.

The stated explanation is that console drivers may require per-cpu
resources, or otherwise barf, because the system is not yet setup
correctly.  Fair enough.

However some console drivers might be quite happy running early during
boot, in fact we have one, and so it'd be nice if printk understood that.

So I added a flag (which I would have called CON_BOOT, but that's taken)
called CON_ANYTIME, which indicates that a console is happy to be called
anytime, even if the cpu is not yet online.

Tested on a Power 5 machine, with both a CON_ANYTIME driver and a bogus
console driver that BUG()s if called while offline.  No problems AFAICT.
Built for i386 UP &amp; SMP.

Signed-off-by: Michael Ellerman &lt;michael@ellerman.id.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently printk is no use for early debugging because it refuses to
actually print anything to the console unless
cpu_online(smp_processor_id()) is true.

The stated explanation is that console drivers may require per-cpu
resources, or otherwise barf, because the system is not yet setup
correctly.  Fair enough.

However some console drivers might be quite happy running early during
boot, in fact we have one, and so it'd be nice if printk understood that.

So I added a flag (which I would have called CON_BOOT, but that's taken)
called CON_ANYTIME, which indicates that a console is happy to be called
anytime, even if the cpu is not yet online.

Tested on a Power 5 machine, with both a CON_ANYTIME driver and a bogus
console driver that BUG()s if called while offline.  No problems AFAICT.
Built for i386 UP &amp; SMP.

Signed-off-by: Michael Ellerman &lt;michael@ellerman.id.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add support for suspending and resuming the whole console subsystem</title>
<updated>2006-06-20T01:16:01+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@g5.osdl.org</email>
</author>
<published>2006-06-20T01:16:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=557240b48e2dc4f6fa878afc3fc767ad745ca7ed'/>
<id>557240b48e2dc4f6fa878afc3fc767ad745ca7ed</id>
<content type='text'>
Trying to suspend/resume with console messages flying all around is
doomed to failure, when the devices that the messages are trying to
go to are being shut down.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Trying to suspend/resume with console messages flying all around is
doomed to failure, when the devices that the messages are trying to
go to are being shut down.

Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>BUG_ON() Conversion in kernel/printk.c</title>
<updated>2006-03-31T23:21:17+00:00</updated>
<author>
<name>Eric Sesterhenn</name>
<email>snakebyte@gmx.de</email>
</author>
<published>2006-03-31T23:21:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8abd8e298eb15e2c1b993df0634daf29e43e0aab'/>
<id>8abd8e298eb15e2c1b993df0634daf29e43e0aab</id>
<content type='text'>
this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.

Signed-off-by: Eric Sesterhenn &lt;snakebyte@gmx.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
this changes if() BUG(); constructs to BUG_ON() which is
cleaner, contains unlikely() and can better optimized away.

Signed-off-by: Eric Sesterhenn &lt;snakebyte@gmx.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] console_setup() depends (wrongly?) on CONFIG_PRINTK</title>
<updated>2006-03-24T15:33:27+00:00</updated>
<author>
<name>John Z. Bohach</name>
<email>jzb@aexorsyst.com</email>
</author>
<published>2006-03-24T11:18:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2ea1c5392cc8ce249fb661db4f4cdfbbae373a89'/>
<id>2ea1c5392cc8ce249fb661db4f4cdfbbae373a89</id>
<content type='text'>
It appears that console_setup() code only gets compiled into the kernel if
CONFIG_PRINTK is enabled.  One detrimental side-effect of this is that
serial8250_console_setup() never gets invoked when CONFIG_PRINTK is not
set, resulting in baud rate not being read/parsed from command line (i.e.
console=ttyS0,115200n8 is ignored, at least the baud rate part...)

Attached patch moves console_setup() code from inside

#ifdef CONFIG_PRINTK

to outside (in printk.c), removing dependence on said config. option.

Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It appears that console_setup() code only gets compiled into the kernel if
CONFIG_PRINTK is enabled.  One detrimental side-effect of this is that
serial8250_console_setup() never gets invoked when CONFIG_PRINTK is not
set, resulting in baud rate not being read/parsed from command line (i.e.
console=ttyS0,115200n8 is ignored, at least the baud rate part...)

Attached patch moves console_setup() code from inside

#ifdef CONFIG_PRINTK

to outside (in printk.c), removing dependence on said config. option.

Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>correct email address of Manfred Spraul</title>
<updated>2006-01-15T01:43:54+00:00</updated>
<author>
<name>Christian Kujau</name>
<email>evil@g-house.de</email>
</author>
<published>2006-01-15T01:43:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=624dffcbcf87b9c501b13256416a82487be962bc'/>
<id>624dffcbcf87b9c501b13256416a82487be962bc</id>
<content type='text'>
I  tried to send the forcedeth maintainer an email, but it came back with:

"The mail address manfreds@colorfullife.com is not read anymore.
Please resent your mail to manfred@ instead of manfreds@."

This patch fixes this.

Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I  tried to send the forcedeth maintainer an email, but it came back with:

"The mail address manfreds@colorfullife.com is not read anymore.
Please resent your mail to manfred@ instead of manfreds@."

This patch fixes this.

Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</pre>
</div>
</content>
</entry>
</feed>
