Can't load batman-module on 2.6.26
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_hrtimerhrtimer_interruptsmp_apic_timer_interruptapic_timer_interrupt
strnlen
stringbat_printkbat_printkbat_printkbat_printkbat_printkbat_printkktime_get_tsktime_getblk_rq_map_sg
getnstimeofdaybat_printkschedule_timer_interruptadd_wait_queueunix_pollbat_printkext3_getblkext3_getblkbat_printkhrtimer_starthrtick_setdo_notify_resumebat_printk
---
Cheers, Linus
Quoted 10 lines · Linus Lüssing
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
PATCH 1/1 batman-adv: use original printk in bat_printk
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.
---
batman-adv-kernelland/bat_printk.c +12 -0
@@ -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
Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use original printk in bat_printk
Quoted 4 lines · On Wednesday 10 February 2010 10:36:41 Linus Lüssing wrote:
bat_printkis calling a printk which got previously substituted because of the define incompat.h. This patch removes the define for the scope ofbat_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
Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use original printk in bat_printk
Quoted 10 lines · Marek Lindner
Quoted 4 lines · On Wednesday 10 February 2010 10:36:41 Linus L??ssing wrote:
bat_printkis calling a printk which got previously substituted because of the define incompat.h. This patch removes the define for the scope ofbat_printk.c.After seeing your patch I understand the issue. We redefine
printk()tobat_printk()which works fine for all functions except forbat_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
PATCH 1/2 batman-adv: use original printk in bat_printk
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.
--- bat_printk.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
bat_printk.c +6 -0
@@ -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 ;
Signature · 1 line
1.6.6.1
PATCH 2/2 batman-adv: remove "foo" from bat_printk strings
Some missed debug output, removing it.
--- bat_printk.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
bat_printk.c +1 -1
@@ -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); }
Signature · 1 line
1.6.6.1
Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: remove "foo" from bat_printk strings
Quoted 4 lines · On Wednesday 10 February 2010 23:08:27 Linus Lüssing wrote:
Some missed debug output, removing it.
Signed-off-by Linus Lüssing <[email protected]>Signed-off-by Andrew Lunn <[email protected]
I applied both patches.
Thanks,
Marek