]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ldmvsw: unregistering netdev before disable hardware
authorThomas Tai <thomas.tai@oracle.com>
Mon, 8 May 2017 20:37:40 +0000 (13:37 -0700)
committerShannon Nelson <shannon.nelson@oracle.com>
Wed, 31 May 2017 23:43:48 +0000 (16:43 -0700)
When running LDom binding/unbinding test, kernel may panic
in ldmvsw_open(). It is more likely that because we're removing
the ldc connection before unregistering the netdev in vsw_port_remove(),
we set up a window of time where one process could be removing the
device while another trying to UP the device. This also sometimes causes
vio handshake error due to opening a device without closing it completely.
We should unregister the netdev before we disable the "hardware".

orabug: 2598091325925306

Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: Allen Pais <allen.pais@oracle.com>
drivers/net/ethernet/sun/ldmvsw.c

index 5f1047403fe507a68b547a60d5b47ab4756a5fc5..080604c5ef3dd67bf20942238c3c6bf90abd7821 100644 (file)
@@ -420,6 +420,7 @@ static int vsw_port_remove(struct vio_dev *vdev)
                del_timer_sync(&port->vio.timer);
 
                napi_disable(&port->napi);
+               unregister_netdev(port->dev);
 
                list_del_rcu(&port->list);
 
@@ -434,7 +435,6 @@ static int vsw_port_remove(struct vio_dev *vdev)
 
                dev_set_drvdata(&vdev->dev, NULL);
 
-               unregister_netdev(port->dev);
                free_netdev(port->dev);
        }