And next thing, batman-adv is crashing on Debian stable with a 2.6.26 kernel. The call trace is showing bat_printk() right after insmodding the batman-adv kernel module from the current maintenance branch.
(And also thanks to Chris/|x|, I guess you've been experiencing the same problem on your router with the maintenance branch.)
Cheers, Linus
And here are a couple of manual call traces :) (don't have a device with a 2.6.26 + seriel console at the moment, hehe):
--- __run_hrtimer hrtimer_interrupt smp_apic_timer_interrupt apic_timer_interrupt strnlen string bat_printk bat_printk bat_printk bat_printk bat_printk bat_printk ktime_get_ts ktime_get blk_rq_map_sg getnstimeofday bat_printk schedule_timer_interrupt add_wait_queue unix_poll bat_printk ext3_getblk ext3_getblk bat_printk hrtimer_start hrtick_set do_notify_resume bat_printk ---
Cheers, Linus
On Mon, Feb 08, 2010 at 09:56:02PM +0100, Linus Lüssing wrote:
And next thing, batman-adv is crashing on Debian stable with a 2.6.26 kernel. The call trace is showing bat_printk() right after insmodding the batman-adv kernel module from the current maintenance branch.
(And also thanks to Chris/|x|, I guess you've been experiencing the same problem on your router with the maintenance branch.)
Cheers, Linus
bat_printk is calling a printk which got previously substituted because of the define in compat.h. This patch removes the define for the scope of bat_printk.c.
Signed-off-by: Linus Lüssing linus.luessing@web.de --- diff --git a/batman-adv-kernelland/bat_printk.c b/batman-adv-kernelland/bat_printk.c index a55eff3..556620a 100644 --- a/batman-adv-kernelland/bat_printk.c +++ b/batman-adv-kernelland/bat_printk.c @@ -35,6 +35,13 @@ /* Works only for digits and letters, but small and fast */ #define TOLOWER(x) ((x) | 0x20)
+/* We don't want to recursively call bat_printk here + because of the previous define in compat.h */ +#ifdef printk +#define ___printk printk +#undef printk +#endif + static int skip_atoi(const char **s) { int i = 0; @@ -853,3 +860,8 @@ asmlinkage int bat_printk(const char *fmt, ...)
return printk("foo:%s", buf); } + +#ifdef ___printk +#define printk ___printk +#undef ___printk +#endif
On Wednesday 10 February 2010 10:36:41 Linus Lüssing wrote:
bat_printk is calling a printk which got previously substituted because of the define in compat.h. This patch removes the define for the scope of bat_printk.c.
After seeing your patch I understand the issue. We redefine printk() to bat_printk() which works fine for all functions except for bat_printk() itself. I think your approach seems to be a solution although we don't need to define printk at the end again, do we ?
Regards, Marek
On Wed, Feb 10, 2010 at 06:47:49PM +0800, Marek Lindner wrote:
On Wednesday 10 February 2010 10:36:41 Linus L??ssing wrote:
bat_printk is calling a printk which got previously substituted because of the define in compat.h. This patch removes the define for the scope of bat_printk.c.
After seeing your patch I understand the issue. We redefine printk() to bat_printk() which works fine for all functions except for bat_printk() itself. I think your approach seems to be a solution although we don't need to define printk at the end again, do we ?
I think Simon added compat.h when he reworked the patch. My original version did not use it to avoid this recursion problem. Linus's solution looks O.K, but as you said it is not necessary to redefine it at the end. I also don't see why the ___printk is needed.
While we are at it, please also remove the "foo:". That i do claim responsibility for. I developed the patch on a kernel which is %pM capable and i wanted to be sure it was using bat_printk and not the native printk when testing. So i put in the foo. It never got removed :-(
Andrew
bat_printk is calling a printk which got previously substituted because of the define in compat.h. This patch removes the define for the scope of bat_printk.c.
Signed-off-by: Linus Lüssing linus.luessing@web.de Signed-off-by: Andrew Lunn andrew@lunn.ch --- bat_printk.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/bat_printk.c b/bat_printk.c index a55eff3..845391d 100644 --- a/bat_printk.c +++ b/bat_printk.c @@ -35,6 +35,12 @@ /* Works only for digits and letters, but small and fast */ #define TOLOWER(x) ((x) | 0x20)
+/* We don't want to recursively call bat_printk here + because of the previous define in compat.h */ +#ifdef printk +#undef printk +#endif + static int skip_atoi(const char **s) { int i = 0;
Some missed debug output, removing it.
Signed-off-by: Linus Lüssing linus.luessing@web.de Signed-off-by: Andrew Lunn andrew@lunn.ch --- bat_printk.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/bat_printk.c b/bat_printk.c index 845391d..55c351a 100644 --- a/bat_printk.c +++ b/bat_printk.c @@ -857,5 +857,5 @@ asmlinkage int bat_printk(const char *fmt, ...) r = bat_vsnprintf(buf, sizeof(buf), fmt, args); va_end(args);
- return printk("foo:%s", buf); + return printk("%s", buf); }
On Wednesday 10 February 2010 23:08:27 Linus Lüssing wrote:
Some missed debug output, removing it.
Signed-off-by: Linus Lüssing linus.luessing@web.de Signed-off-by: Andrew Lunn <andrew@lunn.c
I applied both patches.
Thanks, Marek
b.a.t.m.a.n@lists.open-mesh.org