netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Broken rndis_host with #define DEBUG (by a475f603d23392f386e45cf377b17c30ed3bbb80)
@ 2010-06-12 20:39 Jussi Kivilinna
  2010-06-12 21:10 ` Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Jussi Kivilinna @ 2010-06-12 20:39 UTC (permalink / raw)
  To: Joe Perches; +Cc: David S. Miller, netdev, David Brownell

Hello!

Commit a475f603d23392f386e45cf377b17c30ed3bbb80 "drivers/net/usb: Use  
netif_<level> logging facilities" causes problems with rndis_host.

rndis_host oopses with #define DEBUG, in generic_rndis_bind() when  
calling netif_dbg(). Problem is that (netdev)->dev.parent is NULL  
(used in netdev_printk) while generic_rndis_bind is called.

-Jussi


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

* Re: Broken rndis_host with #define DEBUG (by a475f603d23392f386e45cf377b17c30ed3bbb80)
  2010-06-12 20:39 Broken rndis_host with #define DEBUG (by a475f603d23392f386e45cf377b17c30ed3bbb80) Jussi Kivilinna
@ 2010-06-12 21:10 ` Joe Perches
  2010-06-13  2:49   ` David Brownell
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2010-06-12 21:10 UTC (permalink / raw)
  To: Jussi Kivilinna; +Cc: David S.Miller, netdev, David Brownell

On Sat, 2010-06-12 at 23:39 +0300, Jussi Kivilinna wrote:
> Commit a475f603d23392f386e45cf377b17c30ed3bbb80 "drivers/net/usb: Use  
> netif_<level> logging facilities" causes problems with rndis_host.
> 
> rndis_host oopses with #define DEBUG, in generic_rndis_bind() when  
> calling netif_dbg(). Problem is that (netdev)->dev.parent is NULL  
> (used in netdev_printk) while generic_rndis_bind is called.

Thanks.

Here's a revert until these macros get converted to functions.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/net/usb/rndis_host.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index 28d3ee1..49c3044 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -342,8 +342,8 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
 
 	dev->maxpacket = usb_maxpacket(dev->udev, dev->out, 1);
 	if (dev->maxpacket == 0) {
-		netif_dbg(dev, probe, dev->net,
-			  "dev->maxpacket can't be 0\n");
+		if (netif_msg_probe(dev))
+			dev_dbg(&intf->dev, "dev->maxpacket can't be 0\n");
 		retval = -EINVAL;
 		goto fail_and_release;
 	}
@@ -401,15 +401,17 @@ generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags)
 	}
 	if ((flags & FLAG_RNDIS_PHYM_WIRELESS) &&
 			*phym != RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) {
-		netif_dbg(dev, probe, dev->net,
-			  "driver requires wireless physical medium, but device is not\n");
+		if (netif_msg_probe(dev))
+			dev_dbg(&intf->dev, "driver requires wireless "
+				"physical medium, but device is not.\n");
 		retval = -ENODEV;
 		goto halt_fail_and_release;
 	}
 	if ((flags & FLAG_RNDIS_PHYM_NOT_WIRELESS) &&
 			*phym == RNDIS_PHYSICAL_MEDIUM_WIRELESS_LAN) {
-		netif_dbg(dev, probe, dev->net,
-			  "driver requires non-wireless physical medium, but device is wireless.\n");
+		if (netif_msg_probe(dev))
+			dev_dbg(&intf->dev, "driver requires non-wireless "
+				"physical medium, but device is wireless.\n");
 		retval = -ENODEV;
 		goto halt_fail_and_release;
 	}



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

* Re: Broken rndis_host with #define DEBUG (by a475f603d23392f386e45cf377b17c30ed3bbb80)
  2010-06-12 21:10 ` Joe Perches
@ 2010-06-13  2:49   ` David Brownell
  2010-06-17  1:11     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: David Brownell @ 2010-06-13  2:49 UTC (permalink / raw)
  To: Jussi Kivilinna, Joe Perches; +Cc: David S.Miller, netdev, David Brownell



--- On Sat, 6/12/10, Joe Perches <joe@perches.com> wrote:

> > rndis_host oopses with #define DEBUG, in
> generic_rndis_bind() when  
> > calling netif_dbg(). Problem is that
> (netdev)->dev.parent is NULL

> > (used in netdev_printk) while generic_rndis_bind is
> called.Thanks.

Should have been assigned by SET_NETDEV_DEV()
in usbnet_probe() ... before calling the
bind() routine


Maybe just moving that SET_NETDEV_DEV earlier
would suffice.


> 



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

* Re: Broken rndis_host with #define DEBUG (by a475f603d23392f386e45cf377b17c30ed3bbb80)
  2010-06-13  2:49   ` David Brownell
@ 2010-06-17  1:11     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-06-17  1:11 UTC (permalink / raw)
  To: david-b; +Cc: jussi.kivilinna, joe, netdev, dbrownell

From: David Brownell <david-b@pacbell.net>
Date: Sat, 12 Jun 2010 19:49:27 -0700 (PDT)

> --- On Sat, 6/12/10, Joe Perches <joe@perches.com> wrote:
> 
>> > rndis_host oopses with #define DEBUG, in
>> generic_rndis_bind() when  
>> > calling netif_dbg(). Problem is that
>> (netdev)->dev.parent is NULL
> 
>> > (used in netdev_printk) while generic_rndis_bind is
>> called.Thanks.
> 
> Should have been assigned by SET_NETDEV_DEV()
> in usbnet_probe() ... before calling the
> bind() routine
> 
> Maybe just moving that SET_NETDEV_DEV earlier
> would suffice.

Can someone please submit a patch which does this?

Thanks!

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

end of thread, other threads:[~2010-06-17  1:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-12 20:39 Broken rndis_host with #define DEBUG (by a475f603d23392f386e45cf377b17c30ed3bbb80) Jussi Kivilinna
2010-06-12 21:10 ` Joe Perches
2010-06-13  2:49   ` David Brownell
2010-06-17  1:11     ` David Miller

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).