mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 07:51:31 -04:00
Merge branch 'intel-wired-lan-driver-updates-2026-05-04-i40e-ice-idpf'
Jacob Keller says: ==================== Intel Wired LAN Driver Updates 2026-05-04 (i40e, ice, idpf) Matt Volrath fixes two issues with the i40e driver probe routine, ensuring that PTP is properly cleaned up if the probe fails. Emil corrects the initialization of the read_dev_clk_lock spinlock in idpf_ptp_init, ensuring it is initialized prior to when the ptp_schedule_worker() is called. Greg KH fixes a double free and use-after free in the idpf auxiliary device error paths. Marcin fixes ice_set_rss_hfunc() to use the correct q_opt_flags field, correcting the assignment and preventing submission of invalid data to the firmware. Bart corrects the locking in ice_dcb_rebuild(), ensuring that the tc_mutex is held over the entire operation. Ivan fixes the rclk pin state get for E810 devices, ensuring the index is properly offset by the base_rclk_idx value. This ensures that the correct pin index is used to look up recovered clock state. He additionally adds bounds checking to prevent attempting to access pins outside of the pin state array. Ivan also moves the CGU register macros to the top of ice_dpll.h, inside the header guard to avoid duplicate macro definitions should the ice_dpll.h header is included multiple times. ==================== Link: https://patch.msgid.link/20260506-jk-iwl-net-2026-05-04-v2-0-a5ea4dc837a9@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
@@ -1318,6 +1318,7 @@ void i40e_ptp_restore_hw_time(struct i40e_pf *pf);
|
||||
void i40e_ptp_init(struct i40e_pf *pf);
|
||||
void i40e_ptp_stop(struct i40e_pf *pf);
|
||||
int i40e_ptp_alloc_pins(struct i40e_pf *pf);
|
||||
void i40e_ptp_free_pins(struct i40e_pf *pf);
|
||||
int i40e_update_adq_vsi_queues(struct i40e_vsi *vsi, int vsi_offset);
|
||||
int i40e_is_vsi_uplink_mode_veb(struct i40e_vsi *vsi);
|
||||
int i40e_get_partition_bw_setting(struct i40e_pf *pf);
|
||||
|
||||
@@ -16108,9 +16108,11 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
/* Unwind what we've done if something failed in the setup */
|
||||
err_vsis:
|
||||
set_bit(__I40E_DOWN, pf->state);
|
||||
i40e_ptp_stop(pf);
|
||||
i40e_clear_interrupt_scheme(pf);
|
||||
kfree(pf->vsi);
|
||||
err_switch_setup:
|
||||
i40e_ptp_free_pins(pf);
|
||||
i40e_reset_interrupt_capability(pf);
|
||||
timer_shutdown_sync(&pf->service_timer);
|
||||
err_mac_addr:
|
||||
|
||||
@@ -940,12 +940,13 @@ int i40e_ptp_hwtstamp_get(struct net_device *netdev,
|
||||
*
|
||||
* Release memory allocated for PTP pins.
|
||||
**/
|
||||
static void i40e_ptp_free_pins(struct i40e_pf *pf)
|
||||
void i40e_ptp_free_pins(struct i40e_pf *pf)
|
||||
{
|
||||
if (i40e_is_ptp_pin_dev(&pf->hw)) {
|
||||
kfree(pf->ptp_pins);
|
||||
kfree(pf->ptp_caps.pin_config);
|
||||
pf->ptp_pins = NULL;
|
||||
pf->ptp_caps.pin_config = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -537,14 +537,14 @@ void ice_dcb_rebuild(struct ice_pf *pf)
|
||||
struct ice_dcbx_cfg *err_cfg;
|
||||
int ret;
|
||||
|
||||
mutex_lock(&pf->tc_mutex);
|
||||
|
||||
ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL);
|
||||
if (ret) {
|
||||
dev_err(dev, "Query Port ETS failed\n");
|
||||
goto dcb_error;
|
||||
}
|
||||
|
||||
mutex_lock(&pf->tc_mutex);
|
||||
|
||||
if (!pf->hw.port_info->qos_cfg.is_sw_lldp)
|
||||
ice_cfg_etsrec_defaults(pf->hw.port_info);
|
||||
|
||||
|
||||
@@ -2523,6 +2523,8 @@ ice_dpll_rclk_state_on_pin_set(const struct dpll_pin *pin, void *pin_priv,
|
||||
if (hw_idx < 0)
|
||||
goto unlock;
|
||||
hw_idx -= pf->dplls.base_rclk_idx;
|
||||
if (hw_idx >= ICE_DPLL_RCLK_NUM_MAX)
|
||||
goto unlock;
|
||||
|
||||
if ((enable && p->state[hw_idx] == DPLL_PIN_STATE_CONNECTED) ||
|
||||
(!enable && p->state[hw_idx] == DPLL_PIN_STATE_DISCONNECTED)) {
|
||||
@@ -2586,6 +2588,9 @@ ice_dpll_rclk_state_on_pin_get(const struct dpll_pin *pin, void *pin_priv,
|
||||
hw_idx = ice_dpll_pin_get_parent_idx(p, parent_pin);
|
||||
if (hw_idx < 0)
|
||||
goto unlock;
|
||||
hw_idx -= pf->dplls.base_rclk_idx;
|
||||
if (hw_idx >= ICE_DPLL_RCLK_NUM_MAX)
|
||||
goto unlock;
|
||||
|
||||
ret = ice_dpll_pin_state_update(pf, p, ICE_DPLL_PIN_TYPE_RCLK_INPUT,
|
||||
extack);
|
||||
|
||||
@@ -8,6 +8,22 @@
|
||||
|
||||
#define ICE_DPLL_RCLK_NUM_MAX 4
|
||||
|
||||
#define ICE_CGU_R10 0x28
|
||||
#define ICE_CGU_R10_SYNCE_CLKO_SEL GENMASK(8, 5)
|
||||
#define ICE_CGU_R10_SYNCE_CLKODIV_M1 GENMASK(13, 9)
|
||||
#define ICE_CGU_R10_SYNCE_CLKODIV_LOAD BIT(14)
|
||||
#define ICE_CGU_R10_SYNCE_DCK_RST BIT(15)
|
||||
#define ICE_CGU_R10_SYNCE_ETHCLKO_SEL GENMASK(18, 16)
|
||||
#define ICE_CGU_R10_SYNCE_ETHDIV_M1 GENMASK(23, 19)
|
||||
#define ICE_CGU_R10_SYNCE_ETHDIV_LOAD BIT(24)
|
||||
#define ICE_CGU_R10_SYNCE_DCK2_RST BIT(25)
|
||||
#define ICE_CGU_R10_SYNCE_S_REF_CLK GENMASK(31, 27)
|
||||
|
||||
#define ICE_CGU_R11 0x2C
|
||||
#define ICE_CGU_R11_SYNCE_S_BYP_CLK GENMASK(6, 1)
|
||||
|
||||
#define ICE_CGU_BYPASS_MUX_OFFSET_E825C 3
|
||||
|
||||
/**
|
||||
* enum ice_dpll_pin_sw - enumerate ice software pin indices:
|
||||
* @ICE_DPLL_PIN_SW_1_IDX: index of first SW pin
|
||||
@@ -157,19 +173,3 @@ static inline void ice_dpll_deinit(struct ice_pf *pf) { }
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#define ICE_CGU_R10 0x28
|
||||
#define ICE_CGU_R10_SYNCE_CLKO_SEL GENMASK(8, 5)
|
||||
#define ICE_CGU_R10_SYNCE_CLKODIV_M1 GENMASK(13, 9)
|
||||
#define ICE_CGU_R10_SYNCE_CLKODIV_LOAD BIT(14)
|
||||
#define ICE_CGU_R10_SYNCE_DCK_RST BIT(15)
|
||||
#define ICE_CGU_R10_SYNCE_ETHCLKO_SEL GENMASK(18, 16)
|
||||
#define ICE_CGU_R10_SYNCE_ETHDIV_M1 GENMASK(23, 19)
|
||||
#define ICE_CGU_R10_SYNCE_ETHDIV_LOAD BIT(24)
|
||||
#define ICE_CGU_R10_SYNCE_DCK2_RST BIT(25)
|
||||
#define ICE_CGU_R10_SYNCE_S_REF_CLK GENMASK(31, 27)
|
||||
|
||||
#define ICE_CGU_R11 0x2C
|
||||
#define ICE_CGU_R11_SYNCE_S_BYP_CLK GENMASK(6, 1)
|
||||
|
||||
#define ICE_CGU_BYPASS_MUX_OFFSET_E825C 3
|
||||
|
||||
@@ -8046,7 +8046,7 @@ int ice_set_rss_hfunc(struct ice_vsi *vsi, u8 hfunc)
|
||||
ctx->info.q_opt_rss |=
|
||||
FIELD_PREP(ICE_AQ_VSI_Q_OPT_RSS_HASH_M, hfunc);
|
||||
ctx->info.q_opt_tc = vsi->info.q_opt_tc;
|
||||
ctx->info.q_opt_flags = vsi->info.q_opt_rss;
|
||||
ctx->info.q_opt_flags = vsi->info.q_opt_flags;
|
||||
|
||||
err = ice_update_vsi(hw, vsi->idx, ctx, NULL);
|
||||
if (err) {
|
||||
|
||||
@@ -90,7 +90,10 @@ static int idpf_plug_vport_aux_dev(struct iidc_rdma_core_dev_info *cdev_info,
|
||||
return 0;
|
||||
|
||||
err_aux_dev_add:
|
||||
ida_free(&idpf_idc_ida, adev->id);
|
||||
vdev_info->adev = NULL;
|
||||
auxiliary_device_uninit(adev);
|
||||
return ret;
|
||||
err_aux_dev_init:
|
||||
ida_free(&idpf_idc_ida, adev->id);
|
||||
err_ida_alloc:
|
||||
@@ -228,7 +231,10 @@ static int idpf_plug_core_aux_dev(struct iidc_rdma_core_dev_info *cdev_info)
|
||||
return 0;
|
||||
|
||||
err_aux_dev_add:
|
||||
ida_free(&idpf_idc_ida, adev->id);
|
||||
cdev_info->adev = NULL;
|
||||
auxiliary_device_uninit(adev);
|
||||
return ret;
|
||||
err_aux_dev_init:
|
||||
ida_free(&idpf_idc_ida, adev->id);
|
||||
err_ida_alloc:
|
||||
|
||||
@@ -952,6 +952,8 @@ int idpf_ptp_init(struct idpf_adapter *adapter)
|
||||
goto free_ptp;
|
||||
}
|
||||
|
||||
spin_lock_init(&adapter->ptp->read_dev_clk_lock);
|
||||
|
||||
err = idpf_ptp_create_clock(adapter);
|
||||
if (err)
|
||||
goto free_ptp;
|
||||
@@ -977,8 +979,6 @@ int idpf_ptp_init(struct idpf_adapter *adapter)
|
||||
goto remove_clock;
|
||||
}
|
||||
|
||||
spin_lock_init(&adapter->ptp->read_dev_clk_lock);
|
||||
|
||||
pci_dbg(adapter->pdev, "PTP init successful\n");
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user