From db777e2ece9ebdd99ee9944d3d33a08beed0f96f Mon Sep 17 00:00:00 2001 From: Narayan Reddy Date: Sun, 30 Jun 2019 00:07:22 +0530 Subject: [PATCH] nvethernet: add MAC core deinit in remove 1. Call MAC de init incase of remove. 2. Fix ether_select_queue iteration count Bug 200512422 Change-Id: Ic0abc30c97efbab02dab1ae73ac39c96df36ac7c Signed-off-by: Narayan Reddy Reviewed-on: https://git-master.nvidia.com/r/2145731 GVS: Gerrit_Virtual_Submit Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Bhadram Varka Reviewed-by: Bitan Biswas Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/net/ethernet/nvidia/nvethernet/ether_linux.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c index 3ca8dd33..ca86e171 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c @@ -1321,8 +1321,8 @@ static int ether_close(struct net_device *dev) /* PTP de-init */ ether_ptp_remove(pdata); - /* Stop the MAC */ - osi_stop_mac(pdata->osi_core); + /* MAC deinit which inturn stop MAC Tx,Rx */ + osi_hw_core_deinit(pdata->osi_core); ether_napi_disable(pdata); @@ -1628,7 +1628,7 @@ static unsigned short ether_select_queue(struct net_device *dev, unsigned short txqueue_select = 0; unsigned int i, chan; - for (i = 0; i < OSI_EQOS_MAX_NUM_CHANS; i++) { + for (i = 0; i < osi_dma->num_dma_chans; i++) { chan = osi_dma->dma_chans[i]; if (pdata->txq_prio[chan] == skb->priority) { txqueue_select = (unsigned short)chan; @@ -3475,8 +3475,6 @@ static int ether_remove(struct platform_device *pdev) mdiobus_unregister(pdata->mii); } - ether_disable_clks(pdata); - ether_put_clks(pdata); /* Assert MAC RST gpio */