netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sundeep.lkml@gmail.com
To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org
Cc: sgoutham@marvell.com, sbhatta@marvell.com
Subject: [PATCH net 1/3] octeontx2-pf: Fix reset_task bugs
Date: Tue, 21 Jul 2020 22:44:06 +0530	[thread overview]
Message-ID: <1595351648-10794-2-git-send-email-sundeep.lkml@gmail.com> (raw)
In-Reply-To: <1595351648-10794-1-git-send-email-sundeep.lkml@gmail.com>

From: Subbaraya Sundeep <sbhatta@marvell.com>

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: 4ff7d1488a84 ("octeontx2-pf: Error handling support")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
index 6478656..75a8c40 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c
@@ -1730,10 +1730,12 @@ static void otx2_reset_task(struct work_struct *work)
 	if (!netif_running(pf->netdev))
 		return;
 
+	rtnl_lock();
 	otx2_stop(pf->netdev);
 	pf->reset_count++;
 	otx2_open(pf->netdev);
 	netif_trans_update(pf->netdev);
+	rtnl_unlock();
 }
 
 static const struct net_device_ops otx2_netdev_ops = {
@@ -2111,6 +2113,7 @@ static void otx2_remove(struct pci_dev *pdev)
 
 	pf = netdev_priv(netdev);
 
+	cancel_work_sync(&pf->reset_task);
 	/* Disable link notifications */
 	otx2_cgx_config_linkevents(pf, false);
 
-- 
2.7.4


  reply	other threads:[~2020-07-21 17:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 17:14 [PATCH net 0/3] Fix bugs in Octeontx2 netdev driver sundeep.lkml
2020-07-21 17:14 ` sundeep.lkml [this message]
2020-07-21 17:14 ` [PATCH net 2/3] octeontx2-pf: cancel reset_task work sundeep.lkml
2020-07-21 17:14 ` [PATCH net 3/3] octeontx2-pf: Unregister netdev at driver remove sundeep.lkml
2020-07-21 23:17 ` [PATCH net 0/3] Fix bugs in Octeontx2 netdev driver David Miller
2020-07-22 14:04   ` sundeep subbaraya
2020-07-23 14:59     ` sundeep subbaraya
2020-07-23 19:13       ` David Miller
2020-07-24  3:10         ` sundeep subbaraya
2020-07-25  3:10           ` David Miller
2020-07-25  4:41             ` sundeep subbaraya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1595351648-10794-2-git-send-email-sundeep.lkml@gmail.com \
    --to=sundeep.lkml@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).