Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

e1000e: i219 - Increase minimum FIFO read/write min gap

Due to clocking changes in the Skylake platform, there was i219
data corruption. To work around this, HW team reported the need
to increase the minimum gap between the PHY FIFO read and write pointers.

Signed-off-by: Yanir Lubetkin <yanirx.lubetkin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

authored by

Yanir Lubetkin and committed by
Jeff Kirsher
93cbfc70 69cfbc95

+46
+46
drivers/net/ethernet/intel/e1000e/ich8lan.c
··· 1437 1437 1438 1438 if (ret_val) 1439 1439 return ret_val; 1440 + 1441 + if (hw->mac.type == e1000_pch_spt) { 1442 + u16 data; 1443 + u16 ptr_gap; 1444 + 1445 + if (speed == SPEED_1000) { 1446 + ret_val = hw->phy.ops.acquire(hw); 1447 + if (ret_val) 1448 + return ret_val; 1449 + 1450 + ret_val = e1e_rphy_locked(hw, 1451 + PHY_REG(776, 20), 1452 + &data); 1453 + if (ret_val) { 1454 + hw->phy.ops.release(hw); 1455 + return ret_val; 1456 + } 1457 + 1458 + ptr_gap = (data & (0x3FF << 2)) >> 2; 1459 + if (ptr_gap < 0x18) { 1460 + data &= ~(0x3FF << 2); 1461 + data |= (0x18 << 2); 1462 + ret_val = 1463 + e1e_wphy_locked(hw, 1464 + PHY_REG(776, 20), 1465 + data); 1466 + } 1467 + hw->phy.ops.release(hw); 1468 + if (ret_val) 1469 + return ret_val; 1470 + } 1471 + } 1472 + } 1473 + 1474 + /* I217 Packet Loss issue: 1475 + * ensure that FEXTNVM4 Beacon Duration is set correctly 1476 + * on power up. 1477 + * Set the Beacon Duration for I217 to 8 usec 1478 + */ 1479 + if ((hw->mac.type == e1000_pch_lpt) || (hw->mac.type == e1000_pch_spt)) { 1480 + u32 mac_reg; 1481 + 1482 + mac_reg = er32(FEXTNVM4); 1483 + mac_reg &= ~E1000_FEXTNVM4_BEACON_DURATION_MASK; 1484 + mac_reg |= E1000_FEXTNVM4_BEACON_DURATION_8USEC; 1485 + ew32(FEXTNVM4, mac_reg); 1440 1486 } 1441 1487 1442 1488 /* Work-around I218 hang issue */