]> git.ipfire.org Git - thirdparty/linux.git/commit
amd-xgbe: add PCI power management for S0i3 support
authorRaju Rangoju <Raju.Rangoju@amd.com>
Sun, 8 Mar 2026 09:28:51 +0000 (14:58 +0530)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 Mar 2026 02:51:23 +0000 (19:51 -0700)
commit7644e76956baa9a6bc3d208dfd92928f9ecd6a93
tree84640cb32f5a2b16548cdec58b5c7171582ef13a
parentfe81629217e09ed8772e63a4c9cb0d864d849174
amd-xgbe: add PCI power management for S0i3 support

The current suspend/resume implementation does not correctly handle PCI
device power state transitions, which prevents AMD platforms from
reaching the deepest suspend state (S0i3) when the amd-xgbe driver is
enabled.

In particular, the amd_pmc driver reports:

  "Last suspend didn't reach deepest state"

when this device is present.

Implement proper PCI power management operations following the standard
PCI PM model so that the device can be cleanly powered down and resumed.

Suspend path:
- Power down the network interface
- Put the PHY into low-power mode
- Disable bus mastering to prevent DMA activity
- Save PCI configuration space
- Disable the PCI device
- Disable wake from D3 (S0i3 does not require Wake-on-LAN)
- Set the device to D3hot

Resume path:
- Restore the PCI power state to D0
- Restore PCI configuration space
- Enable the PCI device
- Re-enable bus mastering
- Re-enable device interrupts
- Clear the PHY low-power mode
- Power up the network interface

This allows systems using amd-xgbe to reach the deepest suspend state
when entering modern standby (S0i3).

Signed-off-by: Raju Rangoju <Raju.Rangoju@amd.com>
Link: https://patch.msgid.link/20260308092851.1510214-3-Raju.Rangoju@amd.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/amd/xgbe/xgbe-pci.c