Skip to content

Commit dbbec8c

Browse files
Russell King (Oracle)kuba-moo
authored andcommitted
net: stmmac: fix stm32 (and potentially others) resume regression
Marek reported that suspending stm32 causes the following errors when the interface is administratively down: $ echo devices > /sys/power/pm_test $ echo mem > /sys/power/state ... ck_ker_eth2stp already disabled ... ck_ker_eth2stp already unprepared ... On suspend, stm32 starts the eth2stp clock in its suspend method, and stops it in the resume method. This is because the blamed commit omits the call to the platform glue ->suspend() method, but does make the call to the platform glue ->resume() method. This problem affects all other converted drivers as well - e.g. looking at the PCIe drivers, pci_save_state() will not be called, but pci_restore_state() will be. Similar issues affect all other drivers. Fix this by always calling the ->suspend() method, even when the network interface is down. This fixes all the conversions to the platform glue ->suspend() and ->resume() methods. Link: https://lore.kernel.org/r/[email protected] Fixes: 07bbbfe ("net: stmmac: add suspend()/resume() platform ops") Reported-by: Marek Vasut <[email protected]> Tested-by: Marek Vasut <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 1c172fe commit dbbec8c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8042,7 +8042,7 @@ int stmmac_suspend(struct device *dev)
80428042
u32 chan;
80438043

80448044
if (!ndev || !netif_running(ndev))
8045-
return 0;
8045+
goto suspend_bsp;
80468046

80478047
mutex_lock(&priv->lock);
80488048

@@ -8082,6 +8082,7 @@ int stmmac_suspend(struct device *dev)
80828082
if (stmmac_fpe_supported(priv))
80838083
ethtool_mmsv_stop(&priv->fpe_cfg.mmsv);
80848084

8085+
suspend_bsp:
80858086
if (priv->plat->suspend)
80868087
return priv->plat->suspend(dev, priv->plat->bsp_priv);
80878088

0 commit comments

Comments
 (0)