aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-10-13 17:57:07 -0700
committerJakub Kicinski <kuba@kernel.org>2023-10-13 17:57:07 -0700
commitaeae0ef0aaa7bbe19143439ddaba7617aa46ffa2 (patch)
tree2bd277d5ea6ea83996b5df524fcac372feff0e2a
parentf50ee3a00382fc7eed6e0e4c9872d3dbd1b3dbcd (diff)
parent42066c4d5d344cdf8564556cdbe0aa36854fefa4 (diff)
downloadfsi-aeae0ef0aaa7bbe19143439ddaba7617aa46ffa2.tar.gz
Merge branch 'intel-wired-lan-driver-updates-2023-10-11-i40e-ice'
Jacob Keller says: ==================== Intel Wired LAN Driver Updates 2023-10-11 (i40e, ice) This series contains fixes for the i40e and ice drivers. Jesse adds handling to the ice driver which resetis the device when loading on a crash kernel, preventing stale transactions from causing machine check exceptions which could prevent capturing crash data. Mateusz fixes a bug in the ice driver 'Safe mode' logic for handling the device when the DDP is missing. Michal fixes a crash when probing the i40e driver in the event that HW registers are reporting invalid/unexpected values. The following are changes since commit a950a5921db450c74212327f69950ff03419483a: net/smc: Fix pos miscalculation in statistics I'm covering for Tony Nguyen while he's out, and don't have access to create a pull request branch on his net-queue, so these are sent via mail only. ==================== Link: https://lore.kernel.org/r/20231011233334.336092-1-jacob.e.keller@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_common.c4
-rw-r--r--drivers/net/ethernet/intel/ice/ice_main.c18
2 files changed, 20 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c
index eeef20f7710625..1b493854f52292 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_common.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_common.c
@@ -1082,7 +1082,7 @@ void i40e_clear_hw(struct i40e_hw *hw)
I40E_PFLAN_QALLOC_FIRSTQ_SHIFT;
j = (val & I40E_PFLAN_QALLOC_LASTQ_MASK) >>
I40E_PFLAN_QALLOC_LASTQ_SHIFT;
- if (val & I40E_PFLAN_QALLOC_VALID_MASK)
+ if (val & I40E_PFLAN_QALLOC_VALID_MASK && j >= base_queue)
num_queues = (j - base_queue) + 1;
else
num_queues = 0;
@@ -1092,7 +1092,7 @@ void i40e_clear_hw(struct i40e_hw *hw)
I40E_PF_VT_PFALLOC_FIRSTVF_SHIFT;
j = (val & I40E_PF_VT_PFALLOC_LASTVF_MASK) >>
I40E_PF_VT_PFALLOC_LASTVF_SHIFT;
- if (val & I40E_PF_VT_PFALLOC_VALID_MASK)
+ if (val & I40E_PF_VT_PFALLOC_VALID_MASK && j >= i)
num_vfs = (j - i) + 1;
else
num_vfs = 0;
diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index c8286adae94629..7784135160fd20 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -6,6 +6,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <generated/utsrelease.h>
+#include <linux/crash_dump.h>
#include "ice.h"
#include "ice_base.h"
#include "ice_lib.h"
@@ -4683,6 +4684,9 @@ static void ice_init_features(struct ice_pf *pf)
static void ice_deinit_features(struct ice_pf *pf)
{
+ if (ice_is_safe_mode(pf))
+ return;
+
ice_deinit_lag(pf);
if (test_bit(ICE_FLAG_DCB_CAPABLE, pf->flags))
ice_cfg_lldp_mib_change(&pf->hw, false);
@@ -5014,6 +5018,20 @@ ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent)
return -EINVAL;
}
+ /* when under a kdump kernel initiate a reset before enabling the
+ * device in order to clear out any pending DMA transactions. These
+ * transactions can cause some systems to machine check when doing
+ * the pcim_enable_device() below.
+ */
+ if (is_kdump_kernel()) {
+ pci_save_state(pdev);
+ pci_clear_master(pdev);
+ err = pcie_flr(pdev);
+ if (err)
+ return err;
+ pci_restore_state(pdev);
+ }
+
/* this driver uses devres, see
* Documentation/driver-api/driver-model/devres.rst
*/