2012-07-03 13:28:33

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] compat-wireless: fix debugging in iwlwifi

From: Johannes Berg <[email protected]>

As compat includes linux/device.h well before iwlwifi, the
definitions from there are used without DEBUG, but iwlwifi
defines DEBUG to get debug output. Use dev_printk instead
of dev_dbg to get debugging back.

Signed-off-by: Johannes Berg <[email protected]>
---
patches/57-iwlwifi-debug-fix.patch | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
create mode 100644 patches/57-iwlwifi-debug-fix.patch

diff --git a/patches/57-iwlwifi-debug-fix.patch b/patches/57-iwlwifi-debug-fix.patch
new file mode 100644
index 0000000..4b2dfa9
--- /dev/null
+++ b/patches/57-iwlwifi-debug-fix.patch
@@ -0,0 +1,19 @@
+Due to compat including linux/device.h before we do,
+we don't get a chance to #define DEBUG to get our
+debugging prints. This patch replaces dev_dbg with
+dev_printk to make them show up again.
+
+--- a/drivers/net/wireless/iwlwifi/iwl-debug.c
++++ b/drivers/net/wireless/iwlwifi/iwl-debug.c
+@@ -138,8 +138,9 @@ void __iwl_dbg(struct device *dev,
+
+ va_copy(args2, args);
+ vaf.va = &args2;
+- dev_dbg(dev, "%c %s %pV", in_interrupt() ? 'I' : 'U',
+- function, &vaf);
++ dev_printk(KERN_DEBUG, dev, "%c %s %pV",
++ in_interrupt() ? 'I' : 'U',
++ function, &vaf);
+ va_end(args2);
+ }
+ #endif
--
1.7.10





2012-07-03 15:48:08

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] compat-wireless: fix debugging in iwlwifi

On Tue, Jul 3, 2012 at 6:28 AM, Johannes Berg <[email protected]> wrote:
> From: Johannes Berg <[email protected]>
>
> As compat includes linux/device.h well before iwlwifi, the
> definitions from there are used without DEBUG, but iwlwifi
> defines DEBUG to get debug output. Use dev_printk instead
> of dev_dbg to get debugging back.
>
> Signed-off-by: Johannes Berg <[email protected]>

Applied and pushed, thanks!

Luis

2012-07-03 16:21:28

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] compat-wireless: fix debugging in iwlwifi

On Tue, 2012-07-03 at 09:16 -0700, Luis R. Rodriguez wrote:
> On Tue, Jul 3, 2012 at 8:47 AM, Luis R. Rodriguez <[email protected]> wrote:
> > On Tue, Jul 3, 2012 at 6:28 AM, Johannes Berg <[email protected]> wrote:
> >> From: Johannes Berg <[email protected]>
> >>
> >> As compat includes linux/device.h well before iwlwifi, the
> >> definitions from there are used without DEBUG, but iwlwifi
> >> defines DEBUG to get debug output. Use dev_printk instead
> >> of dev_dbg to get debugging back.
> >>
> >> Signed-off-by: Johannes Berg <[email protected]>
> >
> > Applied and pushed, thanks!
>
> On today's linux-next.git the dev_dbg() changed to dev_err(), I've
> updated the patch to reflect this.

Huh, sorry. Please drop this for now -- the patch to change it *from*
dev_err *to* dev_dbg is only in my iwlwifi-next tree now.

johannes


2012-07-03 16:47:49

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] compat-wireless: fix debugging in iwlwifi

On Tue, 2012-07-03 at 09:28 -0700, Joe Perches wrote:
> On Tue, 2012-07-03 at 18:21 +0200, Johannes Berg wrote:
> > On Tue, 2012-07-03 at 09:16 -0700, Luis R. Rodriguez wrote:
> > > On Tue, Jul 3, 2012 at 8:47 AM, Luis R. Rodriguez <[email protected]> wrote:
> > > > On Tue, Jul 3, 2012 at 6:28 AM, Johannes Berg <[email protected]> wrote:
> > > >> From: Johannes Berg <[email protected]>
> > > >>
> > > >> As compat includes linux/device.h well before iwlwifi, the
> > > >> definitions from there are used without DEBUG, but iwlwifi
> > > >> defines DEBUG to get debug output. Use dev_printk instead
> > > >> of dev_dbg to get debugging back.
> > > >>
> > > >> Signed-off-by: Johannes Berg <[email protected]>
> > > >
> > > > Applied and pushed, thanks!
> > >
> > > On today's linux-next.git the dev_dbg() changed to dev_err(), I've
> > > updated the patch to reflect this.
> >
> > Huh, sorry. Please drop this for now -- the patch to change it *from*
> > dev_err *to* dev_dbg is only in my iwlwifi-next tree now.
>
> And besides, the concept is wrong.
>
> There's no reason to drop dynamic_debug support by
> forcing output to KERN_DEBUG.

Well, the thing is, "#define DEBUG" doesn't work in compat-wireless ...
We add it to the Makefile though I guess

johannes


2012-07-03 16:30:36

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] compat-wireless: fix debugging in iwlwifi

On Tue, Jul 3, 2012 at 9:21 AM, Johannes Berg <[email protected]> wrote:
> On Tue, 2012-07-03 at 09:16 -0700, Luis R. Rodriguez wrote:
>> On Tue, Jul 3, 2012 at 8:47 AM, Luis R. Rodriguez <[email protected]> wrote:
>> > On Tue, Jul 3, 2012 at 6:28 AM, Johannes Berg <[email protected]> wrote:
>> >> From: Johannes Berg <[email protected]>
>> >>
>> >> As compat includes linux/device.h well before iwlwifi, the
>> >> definitions from there are used without DEBUG, but iwlwifi
>> >> defines DEBUG to get debug output. Use dev_printk instead
>> >> of dev_dbg to get debugging back.
>> >>
>> >> Signed-off-by: Johannes Berg <[email protected]>
>> >
>> > Applied and pushed, thanks!
>>
>> On today's linux-next.git the dev_dbg() changed to dev_err(), I've
>> updated the patch to reflect this.
>
> Huh, sorry. Please drop this for now -- the patch to change it *from*
> dev_err *to* dev_dbg is only in my iwlwifi-next tree now.

Dropped patches/57-iwlwifi-debug-fix.patch

Luis

2012-07-09 22:28:18

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] compat-wireless: fix debugging in iwlwifi

On Tue, Jul 3, 2012 at 9:47 AM, Johannes Berg <[email protected]> wrote:
> On Tue, 2012-07-03 at 09:28 -0700, Joe Perches wrote:
>> On Tue, 2012-07-03 at 18:21 +0200, Johannes Berg wrote:
>> > On Tue, 2012-07-03 at 09:16 -0700, Luis R. Rodriguez wrote:
>> > > On Tue, Jul 3, 2012 at 8:47 AM, Luis R. Rodriguez <[email protected]> wrote:
>> > > > On Tue, Jul 3, 2012 at 6:28 AM, Johannes Berg <[email protected]> wrote:
>> > > >> From: Johannes Berg <[email protected]>
>> > > >>
>> > > >> As compat includes linux/device.h well before iwlwifi, the
>> > > >> definitions from there are used without DEBUG, but iwlwifi
>> > > >> defines DEBUG to get debug output. Use dev_printk instead
>> > > >> of dev_dbg to get debugging back.
>> > > >>
>> > > >> Signed-off-by: Johannes Berg <[email protected]>
>> > > >
>> > > > Applied and pushed, thanks!
>> > >
>> > > On today's linux-next.git the dev_dbg() changed to dev_err(), I've
>> > > updated the patch to reflect this.
>> >
>> > Huh, sorry. Please drop this for now -- the patch to change it *from*
>> > dev_err *to* dev_dbg is only in my iwlwifi-next tree now.
>>
>> And besides, the concept is wrong.
>>
>> There's no reason to drop dynamic_debug support by
>> forcing output to KERN_DEBUG.
>
> Well, the thing is, "#define DEBUG" doesn't work in compat-wireless ...
> We add it to the Makefile though I guess

What if we add a hunk to iwlwifi to undef DEBUG and redefine it ? Sort
of similar problem as with pr_fmt no? I've merged this patch now.

Luis

2012-07-03 16:17:12

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH] compat-wireless: fix debugging in iwlwifi

On Tue, Jul 3, 2012 at 8:47 AM, Luis R. Rodriguez <[email protected]> wrote:
> On Tue, Jul 3, 2012 at 6:28 AM, Johannes Berg <[email protected]> wrote:
>> From: Johannes Berg <[email protected]>
>>
>> As compat includes linux/device.h well before iwlwifi, the
>> definitions from there are used without DEBUG, but iwlwifi
>> defines DEBUG to get debug output. Use dev_printk instead
>> of dev_dbg to get debugging back.
>>
>> Signed-off-by: Johannes Berg <[email protected]>
>
> Applied and pushed, thanks!

On today's linux-next.git the dev_dbg() changed to dev_err(), I've
updated the patch to reflect this.

mcgrof@tux ~/devel/compat-wireless (git::master)$ git diff
diff --git a/patches/57-iwlwifi-debug-fix.patch
b/patches/57-iwlwifi-debug-fix.patch
index 4b2dfa9..1bfc88f 100644
--- a/patches/57-iwlwifi-debug-fix.patch
+++ b/patches/57-iwlwifi-debug-fix.patch
@@ -9,7 +9,7 @@ dev_printk to make them show up again.

va_copy(args2, args);
vaf.va = &args2;
-- dev_dbg(dev, "%c %s %pV", in_interrupt() ? 'I' : 'U',
+- dev_err(dev, "%c %s %pV", in_interrupt() ? 'I' : 'U',
- function, &vaf);
+ dev_printk(KERN_DEBUG, dev, "%c %s %pV",
+ in_interrupt() ? 'I' : 'U'

Luis

2012-07-03 16:28:55

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH] compat-wireless: fix debugging in iwlwifi

On Tue, 2012-07-03 at 18:21 +0200, Johannes Berg wrote:
> On Tue, 2012-07-03 at 09:16 -0700, Luis R. Rodriguez wrote:
> > On Tue, Jul 3, 2012 at 8:47 AM, Luis R. Rodriguez <[email protected]> wrote:
> > > On Tue, Jul 3, 2012 at 6:28 AM, Johannes Berg <[email protected]> wrote:
> > >> From: Johannes Berg <[email protected]>
> > >>
> > >> As compat includes linux/device.h well before iwlwifi, the
> > >> definitions from there are used without DEBUG, but iwlwifi
> > >> defines DEBUG to get debug output. Use dev_printk instead
> > >> of dev_dbg to get debugging back.
> > >>
> > >> Signed-off-by: Johannes Berg <[email protected]>
> > >
> > > Applied and pushed, thanks!
> >
> > On today's linux-next.git the dev_dbg() changed to dev_err(), I've
> > updated the patch to reflect this.
>
> Huh, sorry. Please drop this for now -- the patch to change it *from*
> dev_err *to* dev_dbg is only in my iwlwifi-next tree now.

And besides, the concept is wrong.

There's no reason to drop dynamic_debug support by
forcing output to KERN_DEBUG.