Skip to contentSkip to conversation

fix hostap registration order

PATCH In review Meelis Roos 4 participants 6 messages Dec 9, 2010 – Dec 17, 2010 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix hostap registration order

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?

drivers/net/wireless/hostap/hostap_hw.c +2 -0
index b7cb165..cc760c5 100644
@@ -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;
 
drivers/net/wireless/hostap/hostap_main.c +1 -1
index 25a2722..0f1b202 100644
@@ -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)
Signature · 5 lines
Meelis Roos ([email protected])
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#1 lore raw

From: Meelis Roos <[email protected]>
Date: Fri, 10 Dec 2010 01:19:23 +0200 (EET)

Quoted 7 lines

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.

#2 lore raw
Quoted 11 lines
Quoted 5 lines

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?

Signature · 1 line
Meelis Roos ([email protected])
maintainer
#3 lore raw

From: Meelis Roos <[email protected]>
Date: Fri, 10 Dec 2010 09:19:51 +0200 (EET)

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

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.

Quoted 7 lines
Quoted 3 lines

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.

#4 lore raw

PATCH 1/1 hostap: remove netif_stop_queue from init

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.

drivers/net/wireless/hostap/hostap_main.c +0 -1
index 25a2722..1d9aed6 100644
@@ -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)
Signature · 1 line
Meelis Roos ([email protected])

A message that is not in the archive (sent off-list or not yet received): alpine.SOC.1.00.1012172324340.24976-ptEonEWSGqKptlylMvRsHA@public.gmane.org