Message ID | 20220114071430.1335872-1-kai.heng.feng@canonical.com (mailing list archive) |
---|---|
State | Accepted |
Commit | d90d0c175cf2982789d336dda928c0f69d3e8a9d |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: stmmac: Fix "Unbalanced pm_runtime_enable!" warning | expand |
Hello: This patch was applied to netdev/net.git (master) by David S. Miller <davem@davemloft.net>: On Fri, 14 Jan 2022 15:14:30 +0800 you wrote: > If the device is PCI based like intel-eth-pci, pm_runtime_enable() is > already called by pci_pm_init(). > > So only pm_runtime_enable() when it's not already enabled. > > Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> > > [...] Here is the summary with links: - net: stmmac: Fix "Unbalanced pm_runtime_enable!" warning https://git.kernel.org/netdev/net/c/d90d0c175cf2 You are awesome, thank you!
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 63ff2dad8c85f..6708ca2aa4f73 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7159,7 +7159,8 @@ int stmmac_dvr_probe(struct device *device, pm_runtime_get_noresume(device); pm_runtime_set_active(device); - pm_runtime_enable(device); + if (!pm_runtime_enabled(device)) + pm_runtime_enable(device); if (priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) {
If the device is PCI based like intel-eth-pci, pm_runtime_enable() is already called by pci_pm_init(). So only pm_runtime_enable() when it's not already enabled. Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)