From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
Dave Ertman <david.m.ertman@intel.com>,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net 02/14] ice: Check for reset in progress during remove
Date: Wed, 7 Nov 2018 11:16:19 -0800 [thread overview]
Message-ID: <20181107191631.5072-3-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20181107191631.5072-1-jeffrey.t.kirsher@intel.com>
From: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
The remove path does not currently check to see if a
reset is in progress before proceeding. This can cause
a resource collision resulting in various types of errors.
Check for reset in progress and wait for a reasonable
amount of time before allowing the remove to progress.
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/ice/ice.h | 2 ++
drivers/net/ethernet/intel/ice/ice_main.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h
index 4c4b5717a627..e5b37fa60884 100644
--- a/drivers/net/ethernet/intel/ice/ice.h
+++ b/drivers/net/ethernet/intel/ice/ice.h
@@ -76,6 +76,8 @@ extern const char ice_drv_ver[];
#define ICE_MIN_INTR_PER_VF (ICE_MIN_QS_PER_VF + 1)
#define ICE_DFLT_INTR_PER_VF (ICE_DFLT_QS_PER_VF + 1)
+#define ICE_MAX_RESET_WAIT 20
+
#define ICE_VSIQF_HKEY_ARRAY_SIZE ((VSIQF_HKEY_MAX_INDEX + 1) * 4)
#define ICE_DFLT_NETIF_M (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 6d31ffb64940..aee22f11a41a 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -2182,6 +2182,12 @@ static void ice_remove(struct pci_dev *pdev)
if (!pf)
return;
+ for (i = 0; i < ICE_MAX_RESET_WAIT; i++) {
+ if (!ice_is_reset_in_progress(pf->state))
+ break;
+ msleep(100);
+ }
+
set_bit(__ICE_DOWN, pf->state);
ice_service_task_stop(pf);
--
2.19.1
next prev parent reply other threads:[~2018-11-08 4:48 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-07 19:16 [net 00/14][pull request] Intel Wired LAN Driver Updates 2018-11-07 Jeff Kirsher
2018-11-07 19:16 ` [net 01/14] ice: Set carrier state and start/stop queues in rebuild Jeff Kirsher
2018-11-07 19:16 ` Jeff Kirsher [this message]
2018-11-07 19:16 ` [net 03/14] ice: Fix dead device link issue with flow control Jeff Kirsher
2018-11-07 19:16 ` [net 04/14] ice: Free VSI contexts during for unload Jeff Kirsher
2018-11-07 19:16 ` [net 05/14] ice: Remove duplicate addition of VLANs in replay path Jeff Kirsher
2018-11-07 19:16 ` [net 06/14] ice: Fix flags for port VLAN Jeff Kirsher
2018-11-07 19:16 ` [net 07/14] ice: Fix typo in error message Jeff Kirsher
2018-11-07 19:16 ` [net 08/14] ice: Fix napi delete calls for remove Jeff Kirsher
2018-11-07 19:16 ` [net 09/14] ice: Fix tx_timeout in PF driver Jeff Kirsher
2018-11-07 19:16 ` [net 10/14] ice: Fix the bytecount sent to netdev_tx_sent_queue Jeff Kirsher
2018-11-07 19:16 ` [net 11/14] igb: shorten maximum PHC timecounter update interval Jeff Kirsher
2018-11-07 19:16 ` [net 12/14] ice: Change req_speeds to be u16 Jeff Kirsher
2018-11-07 19:16 ` [net 13/14] i40e: restore NETIF_F_GSO_IPXIP[46] to netdev features Jeff Kirsher
2018-11-07 19:16 ` [net 14/14] i40e: enable NETIF_F_NTUPLE and NETIF_F_HW_TC at driver load Jeff Kirsher
2018-11-08 1:14 ` [net 00/14][pull request] Intel Wired LAN Driver Updates 2018-11-07 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=20181107191631.5072-3-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=anirudh.venkataramanan@intel.com \
--cc=davem@davemloft.net \
--cc=david.m.ertman@intel.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.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).