summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKornel Dulęba <mindal@semihalf.com>2023-01-26 13:25:35 +0000
committerDavid S. Miller <davem@davemloft.net>2023-01-28 13:20:21 +0000
commite3d6d152a1cbdee25f2e3962009a2751b54e2297 (patch)
treeac547964f725388e0ce9e873b6fbd6aea94a7be1
parent364d0221f1788e5225006ba7a0026e5968431c29 (diff)
downloadlinux-stable-e3d6d152a1cbdee25f2e3962009a2751b54e2297.tar.gz
linux-stable-e3d6d152a1cbdee25f2e3962009a2751b54e2297.tar.bz2
linux-stable-e3d6d152a1cbdee25f2e3962009a2751b54e2297.zip
net: wwan: t7xx: Fix Runtime PM initialization
For PCI devices the Runtime PM refcount is incremented twice: 1. During device enumeration with a call to pm_runtime_forbid. 2. Just before a driver probe logic is called. Because of that in order to enable Runtime PM on a given device we have to call both pm_runtime_allow and pm_runtime_put_noidle, once it's ready to be runtime suspended. The former was missing causing the pm refcount to never reach 0. Fixes: d10b3a695ba0 ("net: wwan: t7xx: Runtime PM") Signed-off-by: Kornel Dulęba <mindal@semihalf.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/wwan/t7xx/t7xx_pci.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wwan/t7xx/t7xx_pci.c b/drivers/net/wwan/t7xx/t7xx_pci.c
index 871f2a27a398..226fc1703e90 100644
--- a/drivers/net/wwan/t7xx/t7xx_pci.c
+++ b/drivers/net/wwan/t7xx/t7xx_pci.c
@@ -121,6 +121,8 @@ void t7xx_pci_pm_init_late(struct t7xx_pci_dev *t7xx_dev)
iowrite32(T7XX_L1_BIT(0), IREG_BASE(t7xx_dev) + ENABLE_ASPM_LOWPWR);
atomic_set(&t7xx_dev->md_pm_state, MTK_PM_RESUMED);
+ pm_runtime_mark_last_busy(&t7xx_dev->pdev->dev);
+ pm_runtime_allow(&t7xx_dev->pdev->dev);
pm_runtime_put_noidle(&t7xx_dev->pdev->dev);
}