1 From 113328306dbdfd5f146f257e447364dc66d025d4 Mon Sep 17 00:00:00 2001
2 From: Jason Baron <jbaron@redhat.com>
3 Date: Mon, 27 Oct 2008 12:05:14 -0400
4 Subject: Driver core: fix 'dynamic_debug' cmd line parameter
7 From: Jason Baron <jbaron@redhat.com>
9 commit 113328306dbdfd5f146f257e447364dc66d025d4 upstream.
11 In testing 2.6.28-rc1, I found that passing 'dynamic_printk' on the command
12 line didn't activate the debug code. The problem is that dynamic_printk_setup()
13 (which activates the debugging) is being called before dynamic_printk_init() is
14 called (which initializes infrastructure). Fix this by setting setting the
15 state to 'DYNAMIC_ENABLED_ALL' in dynamic_printk_setup(), which will also
16 cause all subsequent modules to have debugging automatically started, which is
17 probably the behavior we want.
19 Signed-off-by: Jason Baron <jbaron@redhat.com>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
23 lib/dynamic_printk.c | 4 +++-
24 1 file changed, 3 insertions(+), 1 deletion(-)
26 --- a/lib/dynamic_printk.c
27 +++ b/lib/dynamic_printk.c
28 @@ -402,6 +402,8 @@ static int __init dynamic_printk_init(vo
29 iter->logical_modname,
30 iter->flag_names, iter->hash, iter->hash2);
32 + if (dynamic_enabled == DYNAMIC_ENABLED_ALL)
36 module_init(dynamic_printk_init);
37 @@ -411,7 +413,7 @@ static int __init dynamic_printk_setup(c
42 + dynamic_enabled = DYNAMIC_ENABLED_ALL;
45 /* Use early_param(), so we can get debug output as early as possible */