Skip to content

Commit e9e6d07

Browse files
committed
Merge: e1000e: Driver Update
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7039 0cab3b0 e1000e: Remove duplicated writel() in e1000_configure_tx/rx() c6b8cd6 e1000e: Link NAPI instances to queues and IRQs 13e2297 e1000e: Fix real-time violations on link up efaaf34 e1000e: change k1 configuration on MTP and later platforms 8fa7292 treewide: Switch/rename to timer_delete[_sync]() 39aa687 net: e1000e: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() JIRA: https://issues.redhat.com/browse/RHEL-99399 Signed-off-by: Corinna Vinschen <vinschen@redhat.com> Approved-by: Michal Schmidt <mschmidt@redhat.com> Approved-by: Kamal Heib <kheib@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Augusto Caringi <acaringi@redhat.com>
2 parents ddda6dc + 175f1e0 commit e9e6d07

File tree

6 files changed

+149
-55
lines changed

6 files changed

+149
-55
lines changed

drivers/net/ethernet/intel/e1000e/defines.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,4 +803,7 @@
803803
/* SerDes Control */
804804
#define E1000_GEN_POLL_TIMEOUT 640
805805

806+
#define E1000_FEXTNVM12_PHYPD_CTRL_MASK 0x00C00000
807+
#define E1000_FEXTNVM12_PHYPD_CTRL_P1 0x00800000
808+
806809
#endif /* _E1000_DEFINES_H_ */

drivers/net/ethernet/intel/e1000e/e1000.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ struct e1000_adapter {
319319
u16 tx_ring_count;
320320
u16 rx_ring_count;
321321

322-
struct hwtstamp_config hwtstamp_config;
322+
struct kernel_hwtstamp_config hwtstamp_config;
323323
struct delayed_work systim_overflow_work;
324324
struct sk_buff *tx_hwtstamp_skb;
325325
unsigned long tx_hwtstamp_start;

drivers/net/ethernet/intel/e1000e/ich8lan.c

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,45 @@ static void e1000_toggle_lanphypc_pch_lpt(struct e1000_hw *hw)
285285
}
286286
}
287287

288+
/**
289+
* e1000_reconfigure_k1_exit_timeout - reconfigure K1 exit timeout to
290+
* align to MTP and later platform requirements.
291+
* @hw: pointer to the HW structure
292+
*
293+
* Context: PHY semaphore must be held by caller.
294+
* Return: 0 on success, negative on failure
295+
*/
296+
static s32 e1000_reconfigure_k1_exit_timeout(struct e1000_hw *hw)
297+
{
298+
u16 phy_timeout;
299+
u32 fextnvm12;
300+
s32 ret_val;
301+
302+
if (hw->mac.type < e1000_pch_mtp)
303+
return 0;
304+
305+
/* Change Kumeran K1 power down state from P0s to P1 */
306+
fextnvm12 = er32(FEXTNVM12);
307+
fextnvm12 &= ~E1000_FEXTNVM12_PHYPD_CTRL_MASK;
308+
fextnvm12 |= E1000_FEXTNVM12_PHYPD_CTRL_P1;
309+
ew32(FEXTNVM12, fextnvm12);
310+
311+
/* Wait for the interface the settle */
312+
usleep_range(1000, 1100);
313+
314+
/* Change K1 exit timeout */
315+
ret_val = e1e_rphy_locked(hw, I217_PHY_TIMEOUTS_REG,
316+
&phy_timeout);
317+
if (ret_val)
318+
return ret_val;
319+
320+
phy_timeout &= ~I217_PHY_TIMEOUTS_K1_EXIT_TO_MASK;
321+
phy_timeout |= 0xF00;
322+
323+
return e1e_wphy_locked(hw, I217_PHY_TIMEOUTS_REG,
324+
phy_timeout);
325+
}
326+
288327
/**
289328
* e1000_init_phy_workarounds_pchlan - PHY initialization workarounds
290329
* @hw: pointer to the HW structure
@@ -327,15 +366,22 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
327366
* LANPHYPC Value bit to force the interconnect to PCIe mode.
328367
*/
329368
switch (hw->mac.type) {
369+
case e1000_pch_mtp:
370+
case e1000_pch_lnp:
371+
case e1000_pch_ptp:
372+
case e1000_pch_nvp:
373+
/* At this point the PHY might be inaccessible so don't
374+
* propagate the failure
375+
*/
376+
if (e1000_reconfigure_k1_exit_timeout(hw))
377+
e_dbg("Failed to reconfigure K1 exit timeout\n");
378+
379+
fallthrough;
330380
case e1000_pch_lpt:
331381
case e1000_pch_spt:
332382
case e1000_pch_cnp:
333383
case e1000_pch_tgp:
334384
case e1000_pch_adp:
335-
case e1000_pch_mtp:
336-
case e1000_pch_lnp:
337-
case e1000_pch_ptp:
338-
case e1000_pch_nvp:
339385
if (e1000_phy_is_accessible_pchlan(hw))
340386
break;
341387

@@ -419,8 +465,20 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw)
419465
* the PHY is in.
420466
*/
421467
ret_val = hw->phy.ops.check_reset_block(hw);
422-
if (ret_val)
468+
if (ret_val) {
423469
e_err("ME blocked access to PHY after reset\n");
470+
goto out;
471+
}
472+
473+
if (hw->mac.type >= e1000_pch_mtp) {
474+
ret_val = hw->phy.ops.acquire(hw);
475+
if (ret_val) {
476+
e_err("Failed to reconfigure K1 exit timeout\n");
477+
goto out;
478+
}
479+
ret_val = e1000_reconfigure_k1_exit_timeout(hw);
480+
hw->phy.ops.release(hw);
481+
}
424482
}
425483

426484
out:
@@ -4888,6 +4946,18 @@ static s32 e1000_init_hw_ich8lan(struct e1000_hw *hw)
48884946
u16 i;
48894947

48904948
e1000_initialize_hw_bits_ich8lan(hw);
4949+
if (hw->mac.type >= e1000_pch_mtp) {
4950+
ret_val = hw->phy.ops.acquire(hw);
4951+
if (ret_val)
4952+
return ret_val;
4953+
4954+
ret_val = e1000_reconfigure_k1_exit_timeout(hw);
4955+
hw->phy.ops.release(hw);
4956+
if (ret_val) {
4957+
e_dbg("Error failed to reconfigure K1 exit timeout\n");
4958+
return ret_val;
4959+
}
4960+
}
48914961

48924962
/* Initialize identification LED */
48934963
ret_val = mac->ops.id_led_init(hw);

drivers/net/ethernet/intel/e1000e/ich8lan.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@
219219
#define I217_PLL_CLOCK_GATE_REG PHY_REG(772, 28)
220220
#define I217_PLL_CLOCK_GATE_MASK 0x07FF
221221

222+
/* PHY Timeouts */
223+
#define I217_PHY_TIMEOUTS_REG PHY_REG(770, 21)
224+
#define I217_PHY_TIMEOUTS_K1_EXIT_TO_MASK 0x0FC0
225+
222226
#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in ms */
223227

224228
/* Inband Control */

drivers/net/ethernet/intel/e1000e/mac.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,21 @@ void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw,
331331
}
332332

333333
/* replace the entire MTA table */
334-
for (i = hw->mac.mta_reg_count - 1; i >= 0; i--)
334+
for (i = hw->mac.mta_reg_count - 1; i >= 0; i--) {
335335
E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, hw->mac.mta_shadow[i]);
336+
337+
if (IS_ENABLED(CONFIG_PREEMPT_RT)) {
338+
/*
339+
* Do not queue up too many posted writes to prevent
340+
* increased latency for other devices on the
341+
* interconnect. Flush after each 8th posted write,
342+
* to keep additional execution time low while still
343+
* preventing increased latency.
344+
*/
345+
if (!(i % 8) && i)
346+
e1e_flush();
347+
}
348+
}
336349
e1e_flush();
337350
}
338351

0 commit comments

Comments
 (0)