diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c index 4e3e4734..f89e3f36 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.c @@ -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 */ diff --git a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h index 3ac4f218..f654ec62 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h +++ b/drivers/net/ethernet/nvidia/nvethernet/ether_linux.h @@ -273,12 +273,8 @@ struct ether_priv_data { * whcih has triggered */ atomic_t therm_state; #endif /* THERMAL_CAL */ - /** Spin lock for filter code */ - spinlock_t lock; /** Spin lock for Tx/Rx interrupt enable registers */ spinlock_t rlock; - /** spin lock for filter code ioctl path */ - spinlock_t ioctl_lock; /** max address register count, 2*mac_addr64_sel */ int num_mac_addr_regs; /** Last Multicast address reg filter index, If 0,no MC address added */ diff --git a/drivers/net/ethernet/nvidia/nvethernet/ioctl.c b/drivers/net/ethernet/nvidia/nvethernet/ioctl.c index 0b081276..2010ca27 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/ioctl.c +++ b/drivers/net/ethernet/nvidia/nvethernet/ioctl.c @@ -192,9 +192,7 @@ static int ether_config_l3_l4_filtering(struct net_device *dev, ret = osi_config_l3_l4_filter_enable(osi_core, filter_flags); if (ret == 0) { - spin_lock_bh(&pdata->ioctl_lock); pdata->l3_l4_filter = filter_flags; - spin_unlock_bh(&pdata->ioctl_lock); } return ret; @@ -253,14 +251,12 @@ static int ether_config_ip4_filters(struct net_device *dev, } /* enable IPFE bit in MAC_Packet_Filter for L3/L4 if already not */ - spin_lock_bh(&pdata->ioctl_lock); if (pdata->l3_l4_filter == OSI_DISABLE) { ret = osi_config_l3_l4_filter_enable(osi_core, OSI_ENABLE); if (ret == 0) { pdata->l3_l4_filter = OSI_ENABLE; } } - spin_unlock_bh(&pdata->ioctl_lock); /* configure the L3 filters */ ret = osi_config_l3_filters(osi_core, l_l3_filter.filter_no, @@ -333,14 +329,12 @@ static int ether_config_ip6_filters(struct net_device *dev, } /* enable IPFE bit in MAC_Packet_Filter for L3/L4 if already not */ - spin_lock_bh(&pdata->ioctl_lock); if (pdata->l3_l4_filter == OSI_DISABLE) { ret = osi_config_l3_l4_filter_enable(osi_core, OSI_ENABLE); if (ret == 0) { pdata->l3_l4_filter = OSI_ENABLE; } } - spin_unlock_bh(&pdata->ioctl_lock); /* configure the L3 filters */ ret = osi_config_l3_filters(osi_core, l_l3_filter.filter_no, @@ -414,14 +408,12 @@ static int ether_config_tcp_udp_filters(struct net_device *dev, } /* enable IPFE bit in MAC_Packet_Filter for L3/L4 if already not */ - spin_lock_bh(&pdata->ioctl_lock); if (pdata->l3_l4_filter == OSI_DISABLE) { ret = osi_config_l3_l4_filter_enable(osi_core, OSI_ENABLE); if (ret == 0) { pdata->l3_l4_filter = OSI_ENABLE; } } - spin_unlock_bh(&pdata->ioctl_lock); /* configure the L4 filters */ ret = osi_config_l4_filters(osi_core, l_l4_filter.filter_no,