]> err.no Git - linux-2.6/blobdiff - drivers/net/iseries_veth.c
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
[linux-2.6] / drivers / net / iseries_veth.c
index 1edecb10993de2612860242e069f03fa40e11afd..55af32e9bf082ad7f8d88b96b2e068eb0e35304f 100644 (file)
@@ -802,13 +802,14 @@ static void veth_tx_timeout(struct net_device *dev)
 
        spin_lock_irqsave(&port->pending_gate, flags);
 
+       if (!port->pending_lpmask) {
+               spin_unlock_irqrestore(&port->pending_gate, flags);
+               return;
+       }
+
        printk(KERN_WARNING "%s: Tx timeout!  Resetting lp connections: %08x\n",
               dev->name, port->pending_lpmask);
 
-       /* If we've timed out the queue must be stopped, which should
-        * only ever happen when there is a pending packet. */
-       WARN_ON(! port->pending_lpmask);
-
        for (i = 0; i < HVMAXARCHITECTEDLPS; i++) {
                struct veth_lpar_connection *cnx = veth_cnx[i];
 
@@ -1388,18 +1389,25 @@ void __exit veth_module_cleanup(void)
 {
        int i;
 
-       vio_unregister_driver(&veth_driver);
+       /* Stop the queues first to stop any new packets being sent. */
+       for (i = 0; i < HVMAXARCHITECTEDVIRTUALLANS; i++)
+               if (veth_dev[i])
+                       netif_stop_queue(veth_dev[i]);
 
+       /* Stop the connections before we unregister the driver. This
+        * ensures there's no skbs lying around holding the device open. */
        for (i = 0; i < HVMAXARCHITECTEDLPS; ++i)
                veth_stop_connection(i);
 
        HvLpEvent_unregisterHandler(HvLpEvent_Type_VirtualLan);
 
        /* Hypervisor callbacks may have scheduled more work while we
-        * were destroying connections. Now that we've disconnected from
+        * were stoping connections. Now that we've disconnected from
         * the hypervisor make sure everything's finished. */
        flush_scheduled_work();
 
+       vio_unregister_driver(&veth_driver);
+
        for (i = 0; i < HVMAXARCHITECTEDLPS; ++i)
                veth_destroy_connection(i);