b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] Can't load batman-module on 2.6.26
@ 2010-02-08 20:56 Linus Lüssing
  2010-02-08 21:32 ` Linus Lüssing
  0 siblings, 1 reply; 8+ messages in thread
From: Linus Lüssing @ 2010-02-08 20:56 UTC (permalink / raw)
  To: b.a.t.m.a.n

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [B.A.T.M.A.N.] Can't load batman-module on 2.6.26
  2010-02-08 20:56 [B.A.T.M.A.N.] Can't load batman-module on 2.6.26 Linus Lüssing
@ 2010-02-08 21:32 ` Linus Lüssing
  2010-02-10  2:36   ` [B.A.T.M.A.N.] [PATCH] batman-adv: use original printk in bat_printk Linus Lüssing
  0 siblings, 1 reply; 8+ messages in thread
From: Linus Lüssing @ 2010-02-08 21:32 UTC (permalink / raw)
  To: b.a.t.m.a.n

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
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [B.A.T.M.A.N.] [PATCH] batman-adv: use original printk in bat_printk
  2010-02-08 21:32 ` Linus Lüssing
@ 2010-02-10  2:36   ` Linus Lüssing
  2010-02-10 10:47     ` Marek Lindner
  0 siblings, 1 reply; 8+ messages in thread
From: Linus Lüssing @ 2010-02-10  2:36 UTC (permalink / raw)
  To: b.a.t.m.a.n

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use original printk in bat_printk
  2010-02-10  2:36   ` [B.A.T.M.A.N.] [PATCH] batman-adv: use original printk in bat_printk Linus Lüssing
@ 2010-02-10 10:47     ` Marek Lindner
  2010-02-10 13:11       ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: Marek Lindner @ 2010-02-10 10:47 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use original printk in bat_printk
  2010-02-10 10:47     ` Marek Lindner
@ 2010-02-10 13:11       ` Andrew Lunn
  2010-02-10 15:08         ` [B.A.T.M.A.N.] [PATCH 1/2] " Linus Lüssing
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2010-02-10 13:11 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: use original printk in bat_printk
  2010-02-10 13:11       ` Andrew Lunn
@ 2010-02-10 15:08         ` Linus Lüssing
  2010-02-10 15:08           ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: remove "foo" from bat_printk strings Linus Lüssing
  0 siblings, 1 reply; 8+ messages in thread
From: Linus Lüssing @ 2010-02-10 15:08 UTC (permalink / raw)
  To: b.a.t.m.a.n

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;
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: remove "foo" from bat_printk strings
  2010-02-10 15:08         ` [B.A.T.M.A.N.] [PATCH 1/2] " Linus Lüssing
@ 2010-02-10 15:08           ` Linus Lüssing
  2010-02-13 16:02             ` Marek Lindner
  0 siblings, 1 reply; 8+ messages in thread
From: Linus Lüssing @ 2010-02-10 15:08 UTC (permalink / raw)
  To: b.a.t.m.a.n

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);
 }
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: remove "foo" from bat_printk strings
  2010-02-10 15:08           ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: remove "foo" from bat_printk strings Linus Lüssing
@ 2010-02-13 16:02             ` Marek Lindner
  0 siblings, 0 replies; 8+ messages in thread
From: Marek Lindner @ 2010-02-13 16:02 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-02-13 16:02 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-08 20:56 [B.A.T.M.A.N.] Can't load batman-module on 2.6.26 Linus Lüssing
2010-02-08 21:32 ` Linus Lüssing
2010-02-10  2:36   ` [B.A.T.M.A.N.] [PATCH] batman-adv: use original printk in bat_printk Linus Lüssing
2010-02-10 10:47     ` Marek Lindner
2010-02-10 13:11       ` Andrew Lunn
2010-02-10 15:08         ` [B.A.T.M.A.N.] [PATCH 1/2] " Linus Lüssing
2010-02-10 15:08           ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: remove "foo" from bat_printk strings Linus Lüssing
2010-02-13 16:02             ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).