All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
@ 2010-10-28  8:18 Dmitry Artamonow
  2010-10-28 17:32 ` David Miller
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Dmitry Artamonow @ 2010-10-28  8:18 UTC (permalink / raw)
  To: linux-usb
  Cc: David Brownell, Greg Kroah-Hartman, netdev, linux-kernel,
	Tom Herbert, David S. Miller

Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
register_netdevice"), which moved tx netqueue creation into register_netdev.
So now calling netif_stop_queue() before register_netdev causes an oops.
Move netif_stop_queue() after net device registration to fix crash.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
---
 drivers/usb/gadget/u_ether.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index 6bb876d..cb23355 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
 	 *  - iff DATA transfer is active, carrier is "on"
 	 *  - tx queueing enabled if open *and* carrier is "on"
 	 */
-	netif_stop_queue(net);
 	netif_carrier_off(net);
 
 	dev->gadget = g;
@@ -812,6 +811,7 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
 		INFO(dev, "MAC %pM\n", net->dev_addr);
 		INFO(dev, "HOST MAC %pM\n", dev->host_mac);
 
+		netif_stop_queue(net);
 		the_dev = dev;
 	}
 
-- 
1.7.0.4


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

* Re: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
  2010-10-28  8:18 [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup Dmitry Artamonow
@ 2010-10-28 17:32 ` David Miller
  2010-11-01 16:16   ` Michał Mirosław
       [not found] ` <AANLkTi=B93UqfiBFMFryLk1wxus6LwHsSo+8+Ff5D0Ne@mail.gmail.com>
  2 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2010-10-28 17:32 UTC (permalink / raw)
  To: mad_soft; +Cc: linux-usb, dbrownell, gregkh, netdev, linux-kernel, therbert

From: Dmitry Artamonow <mad_soft@inbox.ru>
Date: Thu, 28 Oct 2010 12:18:29 +0400

> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
> register_netdevice"), which moved tx netqueue creation into register_netdev.
> So now calling netif_stop_queue() before register_netdev causes an oops.
> Move netif_stop_queue() after net device registration to fix crash.
> 
> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>

Applied, thank you.

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

* Re: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
@ 2010-11-01 16:16   ` Michał Mirosław
  0 siblings, 0 replies; 8+ messages in thread
From: Michał Mirosław @ 2010-11-01 16:16 UTC (permalink / raw)
  To: Dmitry Artamonow
  Cc: linux-usb, David Brownell, Greg Kroah-Hartman, netdev,
	linux-kernel, Tom Herbert, David S. Miller

2010/10/28 Dmitry Artamonow <mad_soft@inbox.ru>:
> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
> register_netdevice"), which moved tx netqueue creation into register_netdev.
> So now calling netif_stop_queue() before register_netdev causes an oops.
> Move netif_stop_queue() after net device registration to fix crash.
>
> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
> ---
>  drivers/usb/gadget/u_ether.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
> index 6bb876d..cb23355 100644
> --- a/drivers/usb/gadget/u_ether.c
> +++ b/drivers/usb/gadget/u_ether.c
> @@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>         *  - iff DATA transfer is active, carrier is "on"
>         *  - tx queueing enabled if open *and* carrier is "on"
>         */
> -       netif_stop_queue(net);
>        netif_carrier_off(net);
>
>        dev->gadget = g;
> @@ -812,6 +811,7 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>                INFO(dev, "MAC %pM\n", net->dev_addr);
>                INFO(dev, "HOST MAC %pM\n", dev->host_mac);
>
> +               netif_stop_queue(net);
>                the_dev = dev;
>        }
>

What about a race between register_netdev() -> open() -> rest of
gether_setup() ? What is this netif_stop_queue() here needed for?

Best Regards,
Michał Mirosław

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

* Re: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
@ 2010-11-01 16:16   ` Michał Mirosław
  0 siblings, 0 replies; 8+ messages in thread
From: Michał Mirosław @ 2010-11-01 16:16 UTC (permalink / raw)
  To: Dmitry Artamonow
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA, David Brownell,
	Greg Kroah-Hartman, netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Tom Herbert,
	David S. Miller

2010/10/28 Dmitry Artamonow <mad_soft-aPYA7nAdAYY@public.gmane.org>:
> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
> register_netdevice"), which moved tx netqueue creation into register_netdev.
> So now calling netif_stop_queue() before register_netdev causes an oops.
> Move netif_stop_queue() after net device registration to fix crash.
>
> Signed-off-by: Dmitry Artamonow <mad_soft-aPYA7nAdAYY@public.gmane.org>
> ---
>  drivers/usb/gadget/u_ether.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
> index 6bb876d..cb23355 100644
> --- a/drivers/usb/gadget/u_ether.c
> +++ b/drivers/usb/gadget/u_ether.c
> @@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>         *  - iff DATA transfer is active, carrier is "on"
>         *  - tx queueing enabled if open *and* carrier is "on"
>         */
> -       netif_stop_queue(net);
>        netif_carrier_off(net);
>
>        dev->gadget = g;
> @@ -812,6 +811,7 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>                INFO(dev, "MAC %pM\n", net->dev_addr);
>                INFO(dev, "HOST MAC %pM\n", dev->host_mac);
>
> +               netif_stop_queue(net);
>                the_dev = dev;
>        }
>

What about a race between register_netdev() -> open() -> rest of
gether_setup() ? What is this netif_stop_queue() here needed for?

Best Regards,
Michał Mirosław
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
@ 2010-11-01 16:22     ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2010-11-01 16:22 UTC (permalink / raw)
  To: mirqus
  Cc: mad_soft, linux-usb, dbrownell, gregkh, netdev, linux-kernel, therbert

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=utf-8, Size: 1804 bytes --]

From: Michał Mirosław <mirqus@gmail.com>
Date: Mon, 1 Nov 2010 17:16:39 +0100

> 2010/10/28 Dmitry Artamonow <mad_soft@inbox.ru>:
>> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
>> register_netdevice"), which moved tx netqueue creation into register_netdev.
>> So now calling netif_stop_queue() before register_netdev causes an oops.
>> Move netif_stop_queue() after net device registration to fix crash.
>>
>> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
>> ---
>>  drivers/usb/gadget/u_ether.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
>> index 6bb876d..cb23355 100644
>> --- a/drivers/usb/gadget/u_ether.c
>> +++ b/drivers/usb/gadget/u_ether.c
>> @@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>>         *  - iff DATA transfer is active, carrier is "on"
>>         *  - tx queueing enabled if open *and* carrier is "on"
>>         */
>> -       netif_stop_queue(net);
>>        netif_carrier_off(net);
>>
>>        dev->gadget = g;
>> @@ -812,6 +811,7 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>>                INFO(dev, "MAC %pM\n", net->dev_addr);
>>                INFO(dev, "HOST MAC %pM\n", dev->host_mac);
>>
>> +               netif_stop_queue(net);
>>                the_dev = dev;
>>        }
>>
> 
> What about a race between register_netdev() -> open() -> rest of
> gether_setup() ? What is this netif_stop_queue() here needed for?

Nothing, it should be completely removed.
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
@ 2010-11-01 16:22     ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2010-11-01 16:22 UTC (permalink / raw)
  To: mirqus-Re5JQEeQqe8AvxtiuMwx3w
  Cc: mad_soft-aPYA7nAdAYY, linux-usb-u79uwXL29TY76Z2rM5mHXA,
	dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f, gregkh-l3A5Bk7waGM,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	therbert-hpIqsD4AKlfQT0dZR+AlfA

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=utf-8, Size: 1815 bytes --]

From: Michał Mirosław <mirqus@gmail.com>
Date: Mon, 1 Nov 2010 17:16:39 +0100

> 2010/10/28 Dmitry Artamonow <mad_soft@inbox.ru>:
>> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
>> register_netdevice"), which moved tx netqueue creation into register_netdev.
>> So now calling netif_stop_queue() before register_netdev causes an oops.
>> Move netif_stop_queue() after net device registration to fix crash.
>>
>> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
>> ---
>>  drivers/usb/gadget/u_ether.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
>> index 6bb876d..cb23355 100644
>> --- a/drivers/usb/gadget/u_ether.c
>> +++ b/drivers/usb/gadget/u_ether.c
>> @@ -797,7 +797,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>>         *  - iff DATA transfer is active, carrier is "on"
>>         *  - tx queueing enabled if open *and* carrier is "on"
>>         */
>> -       netif_stop_queue(net);
>>        netif_carrier_off(net);
>>
>>        dev->gadget = g;
>> @@ -812,6 +811,7 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
>>                INFO(dev, "MAC %pM\n", net->dev_addr);
>>                INFO(dev, "HOST MAC %pM\n", dev->host_mac);
>>
>> +               netif_stop_queue(net);
>>                the_dev = dev;
>>        }
>>
> 
> What about a race between register_netdev() -> open() -> rest of
> gether_setup() ? What is this netif_stop_queue() here needed for?

Nothing, it should be completely removed.
N‹§²æìr¸›yúèšØb²X¬¶Ç§vØ^–)Þº{.nÇ+‰·¥Š{±ºÆâžØ^n‡r¡ö¦zË\x1aëh™¨è­Ú&¢îý»\x05ËÛÔØï¦v¬Îf\x1dp)¹¹br	šê+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹\x1e®w¥¢¸?™¨è­Ú&¢)ߢ^[f

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

* Re: Fwd: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
       [not found] ` <AANLkTi=B93UqfiBFMFryLk1wxus6LwHsSo+8+Ff5D0Ne@mail.gmail.com>
@ 2010-11-01 16:29   ` Denis Kirjanov
  2010-11-01 16:34     ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Denis Kirjanov @ 2010-11-01 16:29 UTC (permalink / raw)
  To: mad_soft
  Cc: David Brownell, Greg Kroah-Hartman, netdev, linux-kernel,
	Tom Herbert, David S. Miller

On 11/01/2010 07:12 PM, Denis Kirjanov wrote:
> ---------- Forwarded message ----------
> From: Dmitry Artamonow <mad_soft@inbox.ru>
> Date: Thu, Oct 28, 2010 at 12:18 PM
> Subject: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
> To: linux-usb@vger.kernel.org
> Cc: David Brownell <dbrownell@users.sourceforge.net>, Greg
> Kroah-Hartman <gregkh@suse.de>, netdev@vger.kernel.org,
> linux-kernel@vger.kernel.org, Tom Herbert <therbert@google.com>,
> "David S. Miller" <davem@davemloft.net>
> 
> 
> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
> register_netdevice"), which moved tx netqueue creation into register_netdev.
> So now calling netif_stop_queue() before register_netdev causes an oops.
> Move netif_stop_queue() after net device registration to fix crash.
> 
> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
> ---

Doesn't this is racy with the ->open? eth_open invokes netif_wake_queue() inside eth_start


[PATCH] USB: gadget: fix ethernet gadget crash in gether_setup

Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
register_netdevice"), which moved tx netqueue creation into register_netdev.
So now calling netif_stop_queue() before register_netdev causes an oops.
Move netif_stop_queue() after net device registration to fix crash.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
---
 drivers/usb/gadget/u_ether.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index cb23355..fbe86ca 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -811,7 +811,6 @@ int gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
 		INFO(dev, "MAC %pM\n", net->dev_addr);
 		INFO(dev, "HOST MAC %pM\n", dev->host_mac);
 
-		netif_stop_queue(net);
 		the_dev = dev;
 	}
 
-- 
1.7.1


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

* Re: [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
  2010-11-01 16:29   ` Fwd: " Denis Kirjanov
@ 2010-11-01 16:34     ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2010-11-01 16:34 UTC (permalink / raw)
  To: dkirjanov; +Cc: mad_soft, dbrownell, gregkh, netdev, linux-kernel, therbert

From: Denis Kirjanov <dkirjanov@kernel.org>
Date: Mon, 01 Nov 2010 19:29:30 +0300

> [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup
> 
> Crash is triggered by commit e6484930d7 ("net: allocate tx queues in
> register_netdevice"), which moved tx netqueue creation into register_netdev.
> So now calling netif_stop_queue() before register_netdev causes an oops.
> Move netif_stop_queue() after net device registration to fix crash.
> 
> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
> Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>

Applied, thanks.

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

end of thread, other threads:[~2010-11-01 16:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-28  8:18 [PATCH] USB: gadget: fix ethernet gadget crash in gether_setup Dmitry Artamonow
2010-10-28 17:32 ` David Miller
2010-11-01 16:16 ` Michał Mirosław
2010-11-01 16:16   ` Michał Mirosław
2010-11-01 16:22   ` David Miller
2010-11-01 16:22     ` David Miller
     [not found] ` <AANLkTi=B93UqfiBFMFryLk1wxus6LwHsSo+8+Ff5D0Ne@mail.gmail.com>
2010-11-01 16:29   ` Fwd: " Denis Kirjanov
2010-11-01 16:34     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.