Skip to content

Commit 4460e45

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2025-01-07 (ice, igc) For ice: Arkadiusz corrects mask value being used to determine DPLL phase range. Przemyslaw corrects frequency value for E823 devices. For igc: En-Wei Wu adds a check and, early, return for failed register read. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: igc: return early when failing to read EECD register ice: fix incorrect PHY settings for 100 GB/s ice: fix max values for dpll pin phase adjust ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 6730ee8 + bd2776e commit 4460e45

File tree

4 files changed

+33
-14
lines changed

4 files changed

+33
-14
lines changed

drivers/net/ethernet/intel/ice/ice_adminq_cmd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,6 +2264,8 @@ struct ice_aqc_get_pkg_info_resp {
22642264
struct ice_aqc_get_pkg_info pkg_info[];
22652265
};
22662266

2267+
#define ICE_AQC_GET_CGU_MAX_PHASE_ADJ GENMASK(30, 0)
2268+
22672269
/* Get CGU abilities command response data structure (indirect 0x0C61) */
22682270
struct ice_aqc_get_cgu_abilities {
22692271
u8 num_inputs;

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

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,6 +2064,18 @@ static int ice_dpll_init_worker(struct ice_pf *pf)
20642064
return 0;
20652065
}
20662066

2067+
/**
2068+
* ice_dpll_phase_range_set - initialize phase adjust range helper
2069+
* @range: pointer to phase adjust range struct to be initialized
2070+
* @phase_adj: a value to be used as min(-)/max(+) boundary
2071+
*/
2072+
static void ice_dpll_phase_range_set(struct dpll_pin_phase_adjust_range *range,
2073+
u32 phase_adj)
2074+
{
2075+
range->min = -phase_adj;
2076+
range->max = phase_adj;
2077+
}
2078+
20672079
/**
20682080
* ice_dpll_init_info_pins_generic - initializes generic pins info
20692081
* @pf: board private structure
@@ -2105,8 +2117,8 @@ static int ice_dpll_init_info_pins_generic(struct ice_pf *pf, bool input)
21052117
for (i = 0; i < pin_num; i++) {
21062118
pins[i].idx = i;
21072119
pins[i].prop.board_label = labels[i];
2108-
pins[i].prop.phase_range.min = phase_adj_max;
2109-
pins[i].prop.phase_range.max = -phase_adj_max;
2120+
ice_dpll_phase_range_set(&pins[i].prop.phase_range,
2121+
phase_adj_max);
21102122
pins[i].prop.capabilities = cap;
21112123
pins[i].pf = pf;
21122124
ret = ice_dpll_pin_state_update(pf, &pins[i], pin_type, NULL);
@@ -2152,18 +2164,21 @@ ice_dpll_init_info_direct_pins(struct ice_pf *pf,
21522164
struct ice_hw *hw = &pf->hw;
21532165
struct ice_dpll_pin *pins;
21542166
unsigned long caps;
2167+
u32 phase_adj_max;
21552168
u8 freq_supp_num;
21562169
bool input;
21572170

21582171
switch (pin_type) {
21592172
case ICE_DPLL_PIN_TYPE_INPUT:
21602173
pins = pf->dplls.inputs;
21612174
num_pins = pf->dplls.num_inputs;
2175+
phase_adj_max = pf->dplls.input_phase_adj_max;
21622176
input = true;
21632177
break;
21642178
case ICE_DPLL_PIN_TYPE_OUTPUT:
21652179
pins = pf->dplls.outputs;
21662180
num_pins = pf->dplls.num_outputs;
2181+
phase_adj_max = pf->dplls.output_phase_adj_max;
21672182
input = false;
21682183
break;
21692184
default:
@@ -2188,19 +2203,13 @@ ice_dpll_init_info_direct_pins(struct ice_pf *pf,
21882203
return ret;
21892204
caps |= (DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE |
21902205
DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE);
2191-
pins[i].prop.phase_range.min =
2192-
pf->dplls.input_phase_adj_max;
2193-
pins[i].prop.phase_range.max =
2194-
-pf->dplls.input_phase_adj_max;
21952206
} else {
2196-
pins[i].prop.phase_range.min =
2197-
pf->dplls.output_phase_adj_max;
2198-
pins[i].prop.phase_range.max =
2199-
-pf->dplls.output_phase_adj_max;
22002207
ret = ice_cgu_get_output_pin_state_caps(hw, i, &caps);
22012208
if (ret)
22022209
return ret;
22032210
}
2211+
ice_dpll_phase_range_set(&pins[i].prop.phase_range,
2212+
phase_adj_max);
22042213
pins[i].prop.capabilities = caps;
22052214
ret = ice_dpll_pin_state_update(pf, &pins[i], pin_type, NULL);
22062215
if (ret)
@@ -2308,8 +2317,10 @@ static int ice_dpll_init_info(struct ice_pf *pf, bool cgu)
23082317
dp->dpll_idx = abilities.pps_dpll_idx;
23092318
d->num_inputs = abilities.num_inputs;
23102319
d->num_outputs = abilities.num_outputs;
2311-
d->input_phase_adj_max = le32_to_cpu(abilities.max_in_phase_adj);
2312-
d->output_phase_adj_max = le32_to_cpu(abilities.max_out_phase_adj);
2320+
d->input_phase_adj_max = le32_to_cpu(abilities.max_in_phase_adj) &
2321+
ICE_AQC_GET_CGU_MAX_PHASE_ADJ;
2322+
d->output_phase_adj_max = le32_to_cpu(abilities.max_out_phase_adj) &
2323+
ICE_AQC_GET_CGU_MAX_PHASE_ADJ;
23132324

23142325
alloc_size = sizeof(*d->inputs) * d->num_inputs;
23152326
d->inputs = kzalloc(alloc_size, GFP_KERNEL);

drivers/net/ethernet/intel/ice/ice_ptp_consts.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,9 +761,9 @@ const struct ice_vernier_info_e82x e822_vernier[NUM_ICE_PTP_LNK_SPD] = {
761761
/* rx_desk_rsgb_par */
762762
644531250, /* 644.53125 MHz Reed Solomon gearbox */
763763
/* tx_desk_rsgb_pcs */
764-
644531250, /* 644.53125 MHz Reed Solomon gearbox */
764+
390625000, /* 390.625 MHz Reed Solomon gearbox */
765765
/* rx_desk_rsgb_pcs */
766-
644531250, /* 644.53125 MHz Reed Solomon gearbox */
766+
390625000, /* 390.625 MHz Reed Solomon gearbox */
767767
/* tx_fixed_delay */
768768
1620,
769769
/* pmd_adj_divisor */

drivers/net/ethernet/intel/igc/igc_base.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ static s32 igc_init_nvm_params_base(struct igc_hw *hw)
6868
u32 eecd = rd32(IGC_EECD);
6969
u16 size;
7070

71+
/* failed to read reg and got all F's */
72+
if (!(~eecd))
73+
return -ENXIO;
74+
7175
size = FIELD_GET(IGC_EECD_SIZE_EX_MASK, eecd);
7276

7377
/* Added to a constant, "size" becomes the left-shift value
@@ -221,6 +225,8 @@ static s32 igc_get_invariants_base(struct igc_hw *hw)
221225

222226
/* NVM initialization */
223227
ret_val = igc_init_nvm_params_base(hw);
228+
if (ret_val)
229+
goto out;
224230
switch (hw->mac.type) {
225231
case igc_i225:
226232
ret_val = igc_init_nvm_params_i225(hw);

0 commit comments

Comments
 (0)