Netdev List
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: netdev@vger.kernel.org
Cc: oss-drivers@netronome.com, Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH net-next 1/5] nfp: make sure to cancel port refresh on the error path
Date: Thu,  8 Jun 2017 20:56:10 -0700	[thread overview]
Message-ID: <20170609035614.12691-2-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20170609035614.12691-1-jakub.kicinski@netronome.com>

If very last stages of netdev registering and init fail some
other netdevs and devlink ports may have been visible to user
space before we torn them back down.  In this case there is a
slight chance user may have triggered port refresh.  We need
to make sure the async work is cancelled.

We have to cancel after releasing pf->lock, so we will always
try to cancel, regardless of which part of probe has failed.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
 drivers/net/ethernet/netronome/nfp/nfp_net_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
index 5f27703060c2..cdd25dc5988d 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c
@@ -813,6 +813,7 @@ int nfp_net_pci_probe(struct nfp_pf *pf)
 	nfp_cpp_area_release_free(pf->data_vnic_bar);
 err_unlock:
 	mutex_unlock(&pf->lock);
+	cancel_work_sync(&pf->port_refresh_work);
 	return err;
 }
 
-- 
2.11.0

  reply	other threads:[~2017-06-09  3:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-09  3:56 [PATCH net-next 0/5] nfp: FW app build name reporting Jakub Kicinski
2017-06-09  3:56 ` Jakub Kicinski [this message]
2017-06-09  3:56 ` [PATCH net-next 2/5] nfp: remove automatic caching of RTsym table Jakub Kicinski
2017-06-09  3:56 ` [PATCH net-next 3/5] nfp: remove automatic caching of HWInfo Jakub Kicinski
2017-06-09  3:56 ` [PATCH net-next 4/5] nfp: keep MIP object around Jakub Kicinski
2017-06-09  3:56 ` [PATCH net-next 5/5] nfp: report application FW build name in ethtool -i Jakub Kicinski
2017-06-09 16:53 ` [PATCH net-next 0/5] nfp: FW app build name reporting David Miller

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=20170609035614.12691-2-jakub.kicinski@netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.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