Skip to content

Commit 9158737

Browse files
committed
Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2025-04-02 (igc, e1000e, ixgbe, idpf) For igc: Joe Damato removes unmapping of XSK queues from NAPI instance. Zdenek Bouska swaps condition checks/call to prevent AF_XDP Tx drops with low budget value. For e1000e: Vitaly adjusts Kumeran interface configuration to prevent MDI errors. For ixgbe: Piotr clears PHY high values on media type detection to ensure stale values are not used. For idpf: Emil adjusts shutdown calls to prevent NULL pointer dereference. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: idpf: fix adapter NULL pointer dereference on reboot ixgbe: fix media type detection for E610 device e1000e: change k1 configuration on MTP and later platforms igc: Fix TX drops in XDP ZC igc: Fix XSK queue NAPI ID mapping ==================== Link: https://patch.msgid.link/20250402173900.1957261-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents b27055a + 4c9106f commit 9158737

File tree

8 files changed

+93
-14
lines changed

8 files changed

+93
-14
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/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/idpf/idpf_main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ static void idpf_remove(struct pci_dev *pdev)
8787
*/
8888
static void idpf_shutdown(struct pci_dev *pdev)
8989
{
90-
idpf_remove(pdev);
90+
struct idpf_adapter *adapter = pci_get_drvdata(pdev);
91+
92+
cancel_delayed_work_sync(&adapter->vc_event_task);
93+
idpf_vc_core_deinit(adapter);
94+
idpf_deinit_dflt_mbx(adapter);
9195

9296
if (system_state == SYSTEM_POWER_OFF)
9397
pci_set_power_state(pdev, PCI_D3hot);

drivers/net/ethernet/intel/igc/igc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,6 @@ struct igc_adapter {
337337
struct igc_led_classdev *leds;
338338
};
339339

340-
void igc_set_queue_napi(struct igc_adapter *adapter, int q_idx,
341-
struct napi_struct *napi);
342340
void igc_up(struct igc_adapter *adapter);
343341
void igc_down(struct igc_adapter *adapter);
344342
int igc_open(struct net_device *netdev);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,7 +3042,7 @@ static void igc_xdp_xmit_zc(struct igc_ring *ring)
30423042
* descriptors. Therefore, to be safe, we always ensure we have at least
30433043
* 4 descriptors available.
30443044
*/
3045-
while (xsk_tx_peek_desc(pool, &xdp_desc) && budget >= 4) {
3045+
while (budget >= 4 && xsk_tx_peek_desc(pool, &xdp_desc)) {
30463046
struct igc_metadata_request meta_req;
30473047
struct xsk_tx_metadata *meta = NULL;
30483048
struct igc_tx_buffer *bi;
@@ -5022,8 +5022,8 @@ static int igc_sw_init(struct igc_adapter *adapter)
50225022
return 0;
50235023
}
50245024

5025-
void igc_set_queue_napi(struct igc_adapter *adapter, int vector,
5026-
struct napi_struct *napi)
5025+
static void igc_set_queue_napi(struct igc_adapter *adapter, int vector,
5026+
struct napi_struct *napi)
50275027
{
50285028
struct igc_q_vector *q_vector = adapter->q_vector[vector];
50295029

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ static int igc_xdp_enable_pool(struct igc_adapter *adapter,
9797
napi_disable(napi);
9898
}
9999

100-
igc_set_queue_napi(adapter, queue_id, NULL);
101100
set_bit(IGC_RING_FLAG_AF_XDP_ZC, &rx_ring->flags);
102101
set_bit(IGC_RING_FLAG_AF_XDP_ZC, &tx_ring->flags);
103102

@@ -147,7 +146,6 @@ static int igc_xdp_disable_pool(struct igc_adapter *adapter, u16 queue_id)
147146
xsk_pool_dma_unmap(pool, IGC_RX_DMA_ATTR);
148147
clear_bit(IGC_RING_FLAG_AF_XDP_ZC, &rx_ring->flags);
149148
clear_bit(IGC_RING_FLAG_AF_XDP_ZC, &tx_ring->flags);
150-
igc_set_queue_napi(adapter, queue_id, napi);
151149

152150
if (needs_reset) {
153151
napi_enable(napi);

drivers/net/ethernet/intel/ixgbe/ixgbe_e610.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,9 +1453,11 @@ enum ixgbe_media_type ixgbe_get_media_type_e610(struct ixgbe_hw *hw)
14531453
hw->link.link_info.phy_type_low = 0;
14541454
} else {
14551455
highest_bit = fls64(le64_to_cpu(pcaps.phy_type_low));
1456-
if (highest_bit)
1456+
if (highest_bit) {
14571457
hw->link.link_info.phy_type_low =
14581458
BIT_ULL(highest_bit - 1);
1459+
hw->link.link_info.phy_type_high = 0;
1460+
}
14591461
}
14601462
}
14611463

0 commit comments

Comments
 (0)