path: root/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
diff options
authorIyappan Subramanian <isubramanian@apm.com>2016-07-25 17:12:38 -0700
committerDavid S. Miller <davem@davemloft.net>2016-07-25 21:51:43 -0700
commitcb0366b7c16427a25923350b69f53a5b1345a34b (patch)
treec93ab599633af77b5264be54b57f091937117dc9 /drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
parentdrivers: net: xgene: Fix module unload crash - hw resource cleanup (diff)
drivers: net: xgene: Fix module unload crash - change sw sequence
When the driver is configured as kernel module and when it gets unloaded and reloaded, kernel crash was observed. This patch addresses the software cleanup by doing the following, - Moved register_netdev call after hardware is ready - Since ndev is not ready, added set_irq_name to set irq name - Since ndev is not ready, changed mdio_bus->parent to pdev->dev - Replaced netif_start(stop)_queue by netif_tx_start(stop)_queues - Removed napi_del call since it's called by free_netdev - Added dev_close call, within remove - Added shutdown callback - Changed to use dmam_ APIs Signed-off-by: Iyappan Subramanian <isubramanian@apm.com> Tested-by: Fushen Chen <fchen@apm.com> Tested-by: Toan Le <toanle@apm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
index 009fb8e401d1..4f98749d3a24 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_hw.c
@@ -901,7 +901,7 @@ int xgene_enet_mdio_config(struct xgene_enet_pdata *pdata)
mdio_bus->priv = pdata;
- mdio_bus->parent = &ndev->dev;
+ mdio_bus->parent = &pdata->pdev->dev;
ret = xgene_mdiobus_register(pdata, mdio_bus);
if (ret) {