On Tue, Feb 24, 2026 at 12:10:41PM +0100, Mika Westerberg wrote:
> Currently igc driver calls pci_set_power_state() and pci_restore_state()
> and the like to bring the device back from low power states. However,
> PCI core handles all this on behalf of the driver. Furthermore with PTM
> enabled the PCI core re-enables it on resume but the driver calls
> pci_restore_state() which ends up disabling it again.
> 
> For this reason let the PCI core handle the common PM resume flow.
> 
> Signed-off-by: Mika Westerberg <[email protected]>
> Reviewed-by: Andy Shevchenko <[email protected]>

I love it, thanks a lot for doing this!

Do we still need the pci_enable_device_mem() and pci_set_master()
in __igc_resume()?

I suppose some of that is related to the pci_disable_device() in the
suspend path (__igc_shutdown()), but there are only a few dozen
drivers that do this, so I'm not sure it's essential.

> ---
>  drivers/net/ethernet/intel/igc/igc_main.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igc/igc_main.c 
> b/drivers/net/ethernet/intel/igc/igc_main.c
> index 7ffd34bfa14e..99a4c99ddd57 100644
> --- a/drivers/net/ethernet/intel/igc/igc_main.c
> +++ b/drivers/net/ethernet/intel/igc/igc_main.c
> @@ -7526,9 +7526,6 @@ static int __igc_resume(struct device *dev)
>       struct igc_hw *hw = &adapter->hw;
>       u32 err, val;
>  
> -     pci_set_power_state(pdev, PCI_D0);
> -     pci_restore_state(pdev);
> -
>       if (!pci_device_is_present(pdev))
>               return -ENODEV;
>       err = pci_enable_device_mem(pdev);
> @@ -7538,9 +7535,6 @@ static int __igc_resume(struct device *dev)
>       }
>       pci_set_master(pdev);
>  
> -     pci_enable_wake(pdev, PCI_D3hot, 0);
> -     pci_enable_wake(pdev, PCI_D3cold, 0);
> -
>       if (igc_is_device_id_i226(hw))
>               pci_disable_link_state(pdev, PCIE_LINK_STATE_L1_2);
>  
> -- 
> 2.50.1
> 

Reply via email to