Commit 948a6633 authored by Subbaraya Sundeep's avatar Subbaraya Sundeep Committed by David S. Miller

octeontx2-pf: Fix reset_task bugs

Two bugs exist in the code related to reset_task
in PF driver one is the missing protection
against network stack ndo_open and ndo_close.
Other one is the missing cancel_work.
This patch fixes those problems.

Fixes: 4ff7d148 ("octeontx2-pf: Error handling support")
Signed-off-by: default avatarSubbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: default avatarSunil Goutham <sgoutham@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3cab8c65
...@@ -1730,10 +1730,12 @@ static void otx2_reset_task(struct work_struct *work) ...@@ -1730,10 +1730,12 @@ static void otx2_reset_task(struct work_struct *work)
if (!netif_running(pf->netdev)) if (!netif_running(pf->netdev))
return; return;
rtnl_lock();
otx2_stop(pf->netdev); otx2_stop(pf->netdev);
pf->reset_count++; pf->reset_count++;
otx2_open(pf->netdev); otx2_open(pf->netdev);
netif_trans_update(pf->netdev); netif_trans_update(pf->netdev);
rtnl_unlock();
} }
static const struct net_device_ops otx2_netdev_ops = { static const struct net_device_ops otx2_netdev_ops = {
...@@ -2111,6 +2113,7 @@ static void otx2_remove(struct pci_dev *pdev) ...@@ -2111,6 +2113,7 @@ static void otx2_remove(struct pci_dev *pdev)
pf = netdev_priv(netdev); pf = netdev_priv(netdev);
cancel_work_sync(&pf->reset_task);
/* Disable link notifications */ /* Disable link notifications */
otx2_cgx_config_linkevents(pf, false); otx2_cgx_config_linkevents(pf, false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment