Skip to content

Commit

Permalink
ldmvsw: unregistering netdev before disable hardware
Browse files Browse the repository at this point in the history
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: 25980913, 25925306

Signed-off-by: Thomas Tai <thomas.tai@oracle.com>
Signed-off-by: Shannon Nelson <shannon.nelson@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Thomas Tai authored and David S. Miller committed May 15, 2017
1 parent ca9df7e commit b18e5e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/sun/ldmvsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,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);

Expand All @@ -427,7 +428,6 @@ static int vsw_port_remove(struct vio_dev *vdev)

dev_set_drvdata(&vdev->dev, NULL);

unregister_netdev(port->dev);
free_netdev(port->dev);
}

Expand Down

0 comments on commit b18e5e8

Please sign in to comment.