nvethernet: remove spin locks and re-initialize private variable

Issue:
1) Spin locks are used for code path which is already serialized
by network stack
2) On interface down/up, MAC registers are getting reset and
re-initialized but private structure variables are not updated

Fix:
1) Remove spinlocks
2) Re-initialize private structure variables

Bug 200548252
Bug 200547544

Change-Id: Ifb0ce27ba96f8657eebde21e5d02d8b36fb1778b
Signed-off-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2189974
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Rakesh Goyal
2019-09-04 18:11:12 +05:30
committed by Revanth Kumar Uppala
parent 8708cf6e98
commit c080c796e2
3 changed files with 8 additions and 20 deletions

View File

@@ -1160,7 +1160,8 @@ static int ether_therm_init(struct ether_priv_data *pdata)
* 1) PHY initialization
* 2) request tx/rx/common irqs
* 3) HW initialization
* 4) Starting the PHY
* 4) OSD private data structure initialization
* 5) Starting the PHY
*
* @param[in] dev: Net device data structure.
*
@@ -1258,6 +1259,12 @@ static int ether_open(struct net_device *dev)
goto err_hw_init;
}
/* As all registers reset as part of ether_close(), reset private
* structure variable as well */
pdata->vlan_hash_filtering = OSI_PERFECT_FILTER_MODE;
pdata->l3_l4_filter = OSI_DISABLE;
pdata->l2_filtering_mode = OSI_PERFECT_FILTER_MODE;
/* Start the MAC */
osi_start_mac(pdata->osi_core);
@@ -1870,7 +1877,6 @@ static int ether_prepare_uc_list(struct net_device *dev)
* @param[in] dev - pointer to net_device structure.
*
* @note MAC and PHY need to be initialized.
* Spinlock is used for protection.
*/
static void ether_set_rx_mode(struct net_device *dev)
{
@@ -1879,8 +1885,6 @@ static void ether_set_rx_mode(struct net_device *dev)
struct osi_filter filter = {0};
int mode, ret;
spin_lock_bh(&pdata->lock);
if ((dev->flags & IFF_PROMISC) == IFF_PROMISC) {
dev_dbg(pdata->dev, "enabling Promiscuous mode\n");
filter.pr_mode = OSI_ENABLE;
@@ -1929,8 +1933,6 @@ static void ether_set_rx_mode(struct net_device *dev)
if (ret != 0) {
dev_err(pdata->dev, "osi_config_mac_pkt_filter_reg failed\n");
}
spin_unlock_bh(&pdata->lock);
}
/**
@@ -3476,8 +3478,6 @@ static int ether_probe(struct platform_device *pdev)
goto err_netdev;
}
spin_lock_init(&pdata->lock);
spin_lock_init(&pdata->ioctl_lock);
spin_lock_init(&pdata->rlock);
init_filter_values(pdata);
/* Disable Clocks */