Skip to content

Commit aeae0ef

Browse files
committed
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 a950a59: 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>
2 parents f50ee3a + 42066c4 commit aeae0ef

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

drivers/net/ethernet/intel/i40e/i40e_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ void i40e_clear_hw(struct i40e_hw *hw)
10821082
I40E_PFLAN_QALLOC_FIRSTQ_SHIFT;
10831083
j = (val & I40E_PFLAN_QALLOC_LASTQ_MASK) >>
10841084
I40E_PFLAN_QALLOC_LASTQ_SHIFT;
1085-
if (val & I40E_PFLAN_QALLOC_VALID_MASK)
1085+
if (val & I40E_PFLAN_QALLOC_VALID_MASK && j >= base_queue)
10861086
num_queues = (j - base_queue) + 1;
10871087
else
10881088
num_queues = 0;
@@ -1092,7 +1092,7 @@ void i40e_clear_hw(struct i40e_hw *hw)
10921092
I40E_PF_VT_PFALLOC_FIRSTVF_SHIFT;
10931093
j = (val & I40E_PF_VT_PFALLOC_LASTVF_MASK) >>
10941094
I40E_PF_VT_PFALLOC_LASTVF_SHIFT;
1095-
if (val & I40E_PF_VT_PFALLOC_VALID_MASK)
1095+
if (val & I40E_PF_VT_PFALLOC_VALID_MASK && j >= i)
10961096
num_vfs = (j - i) + 1;
10971097
else
10981098
num_vfs = 0;

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
77

88
#include <generated/utsrelease.h>
9+
#include <linux/crash_dump.h>
910
#include "ice.h"
1011
#include "ice_base.h"
1112
#include "ice_lib.h"
@@ -4683,6 +4684,9 @@ static void ice_init_features(struct ice_pf *pf)
46834684

46844685
static void ice_deinit_features(struct ice_pf *pf)
46854686
{
4687+
if (ice_is_safe_mode(pf))
4688+
return;
4689+
46864690
ice_deinit_lag(pf);
46874691
if (test_bit(ICE_FLAG_DCB_CAPABLE, pf->flags))
46884692
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)
50145018
return -EINVAL;
50155019
}
50165020

5021+
/* when under a kdump kernel initiate a reset before enabling the
5022+
* device in order to clear out any pending DMA transactions. These
5023+
* transactions can cause some systems to machine check when doing
5024+
* the pcim_enable_device() below.
5025+
*/
5026+
if (is_kdump_kernel()) {
5027+
pci_save_state(pdev);
5028+
pci_clear_master(pdev);
5029+
err = pcie_flr(pdev);
5030+
if (err)
5031+
return err;
5032+
pci_restore_state(pdev);
5033+
}
5034+
50175035
/* this driver uses devres, see
50185036
* Documentation/driver-api/driver-model/devres.rst
50195037
*/

0 commit comments

Comments
 (0)