Skip to content

Commit c93a6f6

Browse files
dimaruinskiy-intelkuba-moo
authored andcommitted
e1000e: Fix S0ix residency on corporate systems
On vPro systems, the configuration of the I219-LM to achieve power gating and S0ix residency is split between the driver and the CSME FW. It was discovered that in some scenarios, where the network cable is connected and then disconnected, S0ix residency is not always reached. This was root-caused to a subset of I219-LM register writes that are not performed by the CSME FW. Therefore, the driver should perform these register writes on corporate setups, regardless of the CSME FW state. This was discovered on Meteor Lake systems; however it is likely to appear on other platforms as well. Fixes: cc23f4f ("e1000e: Add support for Meteor Lake") Link: https://bugzilla.kernel.org/show_bug.cgi?id=218589 Signed-off-by: Dima Ruinskiy <[email protected]> Signed-off-by: Vitaly Lifshits <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b97228b commit c93a6f6

File tree

1 file changed

+66
-66
lines changed
  • drivers/net/ethernet/intel/e1000e

1 file changed

+66
-66
lines changed

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

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -6363,49 +6363,49 @@ static void e1000e_s0ix_entry_flow(struct e1000_adapter *adapter)
63636363
mac_data |= E1000_EXTCNF_CTRL_GATE_PHY_CFG;
63646364
ew32(EXTCNF_CTRL, mac_data);
63656365

6366-
/* Enable the Dynamic Power Gating in the MAC */
6367-
mac_data = er32(FEXTNVM7);
6368-
mac_data |= BIT(22);
6369-
ew32(FEXTNVM7, mac_data);
6370-
63716366
/* Disable disconnected cable conditioning for Power Gating */
63726367
mac_data = er32(DPGFR);
63736368
mac_data |= BIT(2);
63746369
ew32(DPGFR, mac_data);
63756370

6376-
/* Don't wake from dynamic Power Gating with clock request */
6377-
mac_data = er32(FEXTNVM12);
6378-
mac_data |= BIT(12);
6379-
ew32(FEXTNVM12, mac_data);
6380-
6381-
/* Ungate PGCB clock */
6382-
mac_data = er32(FEXTNVM9);
6383-
mac_data &= ~BIT(28);
6384-
ew32(FEXTNVM9, mac_data);
6385-
6386-
/* Enable K1 off to enable mPHY Power Gating */
6387-
mac_data = er32(FEXTNVM6);
6388-
mac_data |= BIT(31);
6389-
ew32(FEXTNVM6, mac_data);
6390-
6391-
/* Enable mPHY power gating for any link and speed */
6392-
mac_data = er32(FEXTNVM8);
6393-
mac_data |= BIT(9);
6394-
ew32(FEXTNVM8, mac_data);
6395-
63966371
/* Enable the Dynamic Clock Gating in the DMA and MAC */
63976372
mac_data = er32(CTRL_EXT);
63986373
mac_data |= E1000_CTRL_EXT_DMA_DYN_CLK_EN;
63996374
ew32(CTRL_EXT, mac_data);
6400-
6401-
/* No MAC DPG gating SLP_S0 in modern standby
6402-
* Switch the logic of the lanphypc to use PMC counter
6403-
*/
6404-
mac_data = er32(FEXTNVM5);
6405-
mac_data |= BIT(7);
6406-
ew32(FEXTNVM5, mac_data);
64076375
}
64086376

6377+
/* Enable the Dynamic Power Gating in the MAC */
6378+
mac_data = er32(FEXTNVM7);
6379+
mac_data |= BIT(22);
6380+
ew32(FEXTNVM7, mac_data);
6381+
6382+
/* Don't wake from dynamic Power Gating with clock request */
6383+
mac_data = er32(FEXTNVM12);
6384+
mac_data |= BIT(12);
6385+
ew32(FEXTNVM12, mac_data);
6386+
6387+
/* Ungate PGCB clock */
6388+
mac_data = er32(FEXTNVM9);
6389+
mac_data &= ~BIT(28);
6390+
ew32(FEXTNVM9, mac_data);
6391+
6392+
/* Enable K1 off to enable mPHY Power Gating */
6393+
mac_data = er32(FEXTNVM6);
6394+
mac_data |= BIT(31);
6395+
ew32(FEXTNVM6, mac_data);
6396+
6397+
/* Enable mPHY power gating for any link and speed */
6398+
mac_data = er32(FEXTNVM8);
6399+
mac_data |= BIT(9);
6400+
ew32(FEXTNVM8, mac_data);
6401+
6402+
/* No MAC DPG gating SLP_S0 in modern standby
6403+
* Switch the logic of the lanphypc to use PMC counter
6404+
*/
6405+
mac_data = er32(FEXTNVM5);
6406+
mac_data |= BIT(7);
6407+
ew32(FEXTNVM5, mac_data);
6408+
64096409
/* Disable the time synchronization clock */
64106410
mac_data = er32(FEXTNVM7);
64116411
mac_data |= BIT(31);
@@ -6498,33 +6498,6 @@ static void e1000e_s0ix_exit_flow(struct e1000_adapter *adapter)
64986498
} else {
64996499
/* Request driver unconfigure the device from S0ix */
65006500

6501-
/* Disable the Dynamic Power Gating in the MAC */
6502-
mac_data = er32(FEXTNVM7);
6503-
mac_data &= 0xFFBFFFFF;
6504-
ew32(FEXTNVM7, mac_data);
6505-
6506-
/* Disable mPHY power gating for any link and speed */
6507-
mac_data = er32(FEXTNVM8);
6508-
mac_data &= ~BIT(9);
6509-
ew32(FEXTNVM8, mac_data);
6510-
6511-
/* Disable K1 off */
6512-
mac_data = er32(FEXTNVM6);
6513-
mac_data &= ~BIT(31);
6514-
ew32(FEXTNVM6, mac_data);
6515-
6516-
/* Disable Ungate PGCB clock */
6517-
mac_data = er32(FEXTNVM9);
6518-
mac_data |= BIT(28);
6519-
ew32(FEXTNVM9, mac_data);
6520-
6521-
/* Cancel not waking from dynamic
6522-
* Power Gating with clock request
6523-
*/
6524-
mac_data = er32(FEXTNVM12);
6525-
mac_data &= ~BIT(12);
6526-
ew32(FEXTNVM12, mac_data);
6527-
65286501
/* Cancel disable disconnected cable conditioning
65296502
* for Power Gating
65306503
*/
@@ -6537,13 +6510,6 @@ static void e1000e_s0ix_exit_flow(struct e1000_adapter *adapter)
65376510
mac_data &= 0xFFF7FFFF;
65386511
ew32(CTRL_EXT, mac_data);
65396512

6540-
/* Revert the lanphypc logic to use the internal Gbe counter
6541-
* and not the PMC counter
6542-
*/
6543-
mac_data = er32(FEXTNVM5);
6544-
mac_data &= 0xFFFFFF7F;
6545-
ew32(FEXTNVM5, mac_data);
6546-
65476513
/* Enable the periodic inband message,
65486514
* Request PCIe clock in K1 page770_17[10:9] =01b
65496515
*/
@@ -6581,6 +6547,40 @@ static void e1000e_s0ix_exit_flow(struct e1000_adapter *adapter)
65816547
mac_data &= ~BIT(31);
65826548
mac_data |= BIT(0);
65836549
ew32(FEXTNVM7, mac_data);
6550+
6551+
/* Disable the Dynamic Power Gating in the MAC */
6552+
mac_data = er32(FEXTNVM7);
6553+
mac_data &= 0xFFBFFFFF;
6554+
ew32(FEXTNVM7, mac_data);
6555+
6556+
/* Disable mPHY power gating for any link and speed */
6557+
mac_data = er32(FEXTNVM8);
6558+
mac_data &= ~BIT(9);
6559+
ew32(FEXTNVM8, mac_data);
6560+
6561+
/* Disable K1 off */
6562+
mac_data = er32(FEXTNVM6);
6563+
mac_data &= ~BIT(31);
6564+
ew32(FEXTNVM6, mac_data);
6565+
6566+
/* Disable Ungate PGCB clock */
6567+
mac_data = er32(FEXTNVM9);
6568+
mac_data |= BIT(28);
6569+
ew32(FEXTNVM9, mac_data);
6570+
6571+
/* Cancel not waking from dynamic
6572+
* Power Gating with clock request
6573+
*/
6574+
mac_data = er32(FEXTNVM12);
6575+
mac_data &= ~BIT(12);
6576+
ew32(FEXTNVM12, mac_data);
6577+
6578+
/* Revert the lanphypc logic to use the internal Gbe counter
6579+
* and not the PMC counter
6580+
*/
6581+
mac_data = er32(FEXTNVM5);
6582+
mac_data &= 0xFFFFFF7F;
6583+
ew32(FEXTNVM5, mac_data);
65846584
}
65856585

65866586
static int e1000e_pm_freeze(struct device *dev)

0 commit comments

Comments
 (0)