* [PATCH] fix hostap registration order
@ 2010-12-09 23:19 Meelis Roos
2010-12-10 3:53 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Meelis Roos @ 2010-12-09 23:19 UTC (permalink / raw)
To: netdev-u79uwXL29TY76Z2rM5mHXA, Jouni Malinen,
linux-wireless-u79uwXL29TY76Z2rM5mHXA
In 2.6.37-rc4, hostap_pci init gives a WARNING with backtrace telling
that netif_stop_queue is called before register_netdev. Fix it by moving
this call after register_netdev. Removes the warning and seems to work,
but why is the call to netif_stop_queue needed at all after
register_netdev?
Signed-off-by: Meelis Roos <mroos-Y27EyoLml9s@public.gmane.org>
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index b7cb165..cc760c5 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -3253,6 +3253,8 @@ while (0)
}
printk(KERN_INFO "%s: Registered netdevice %s\n", dev_info, dev->name);
+ netif_stop_queue(dev);
+
hostap_init_data(local);
return dev;
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 25a2722..0f1b202 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -100,6 +100,7 @@ struct net_device * hostap_add_interface(struct local_info *local,
printk(KERN_DEBUG "%s: registered netdevice %s\n",
mdev->name, dev->name);
+ netif_stop_queue(dev);
return dev;
}
@@ -891,7 +892,6 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local,
SET_ETHTOOL_OPS(dev, &prism2_ethtool_ops);
- netif_stop_queue(dev);
}
static int hostap_enable_hostapd(local_info_t *local, int rtnl_locked)
--
Meelis Roos (mroos-Y27EyoLml9s@public.gmane.org)
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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 related [flat|nested] 6+ messages in thread
* Re: [PATCH] fix hostap registration order
2010-12-09 23:19 [PATCH] fix hostap registration order Meelis Roos
@ 2010-12-10 3:53 ` David Miller
2010-12-10 7:19 ` Meelis Roos
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2010-12-10 3:53 UTC (permalink / raw)
To: mroos; +Cc: netdev, j, linux-wireless
From: Meelis Roos <mroos@linux.ee>
Date: Fri, 10 Dec 2010 01:19:23 +0200 (EET)
> In 2.6.37-rc4, hostap_pci init gives a WARNING with backtrace telling
> that netif_stop_queue is called before register_netdev. Fix it by moving
> this call after register_netdev. Removes the warning and seems to work,
> but why is the call to netif_stop_queue needed at all after
> register_netdev?
>
> Signed-off-by: Meelis Roos <mroos@linux.ee>
It should simply not touch the queue state at all at this point.
Your change would add a race. At the moment the device is registered
it can be brought up, and then your code will eroneously modify
the queue state.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fix hostap registration order
2010-12-10 3:53 ` David Miller
@ 2010-12-10 7:19 ` Meelis Roos
2010-12-10 17:47 ` David Miller
0 siblings, 1 reply; 6+ messages in thread
From: Meelis Roos @ 2010-12-10 7:19 UTC (permalink / raw)
To: j; +Cc: David Miller, netdev, linux-wireless
> > In 2.6.37-rc4, hostap_pci init gives a WARNING with backtrace telling
> > that netif_stop_queue is called before register_netdev. Fix it by moving
> > this call after register_netdev. Removes the warning and seems to work,
> > but why is the call to netif_stop_queue needed at all after
> > register_netdev?
>
> It should simply not touch the queue state at all at this point.
>
> Your change would add a race. At the moment the device is registered
> it can be brought up, and then your code will eroneously modify
> the queue state.
OK, I can make a simpler patch for that but I would like to understand
the original reasons for having netif_stop_queue there. Just a relict or
still somehow important?
Jouni?
--
Meelis Roos (mroos@linux.ee)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] fix hostap registration order
2010-12-10 7:19 ` Meelis Roos
@ 2010-12-10 17:47 ` David Miller
2010-12-17 21:27 ` [PATCH] hostap: remove netif_stop_queue from init Meelis Roos
0 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2010-12-10 17:47 UTC (permalink / raw)
To: mroos; +Cc: j, netdev, linux-wireless
From: Meelis Roos <mroos@linux.ee>
Date: Fri, 10 Dec 2010 09:19:51 +0200 (EET)
>> > In 2.6.37-rc4, hostap_pci init gives a WARNING with backtrace telling
>> > that netif_stop_queue is called before register_netdev. Fix it by moving
>> > this call after register_netdev. Removes the warning and seems to work,
>> > but why is the call to netif_stop_queue needed at all after
>> > register_netdev?
>>
>> It should simply not touch the queue state at all at this point.
>>
>> Your change would add a race. At the moment the device is registered
>> it can be brought up, and then your code will eroneously modify
>> the queue state.
>
> OK, I can make a simpler patch for that but I would like to understand
> the original reasons for having netif_stop_queue there. Just a relict or
> still somehow important?
I think it was neither.
The queue state is "don't care" at this point, and always has been,
and a lot of drivers had this unnecessary netif_stop_queue() call
there.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] hostap: remove netif_stop_queue from init
2010-12-10 17:47 ` David Miller
@ 2010-12-17 21:27 ` Meelis Roos
[not found] ` <alpine.SOC.1.00.1012172324340.24976-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Meelis Roos @ 2010-12-17 21:27 UTC (permalink / raw)
To: David Miller; +Cc: j, netdev, linux-wireless
Fix runtime warning with backtrace from hostap by removing
netif_stop_queue() call before register_netdev. Tested to work fine on
hostap_pci Prism 2.5.
Signed-off-by: Meelis Roos <mroos@linux.ee>
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 25a2722..1d9aed6 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -891,7 +891,6 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local,
SET_ETHTOOL_OPS(dev, &prism2_ethtool_ops);
- netif_stop_queue(dev);
}
static int hostap_enable_hostapd(local_info_t *local, int rtnl_locked)
--
Meelis Roos (mroos@linux.ee)
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-12-17 21:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-09 23:19 [PATCH] fix hostap registration order Meelis Roos
2010-12-10 3:53 ` David Miller
2010-12-10 7:19 ` Meelis Roos
2010-12-10 17:47 ` David Miller
2010-12-17 21:27 ` [PATCH] hostap: remove netif_stop_queue from init Meelis Roos
[not found] ` <alpine.SOC.1.00.1012172324340.24976-ptEonEWSGqKptlylMvRsHA@public.gmane.org>
2010-12-17 21:32 ` 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).