]> git.baikalelectronics.ru Git - kernel.git/commit
net: wwan: t7xx: Fix Runtime PM initialization
authorKornel Dulęba <mindal@semihalf.com>
Thu, 26 Jan 2023 13:25:35 +0000 (13:25 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Feb 2023 10:28:05 +0000 (11:28 +0100)
commit7f7808a90398e2e1268266cfd62a463e515e2d8d
tree2ca4baefd194788020507f6d56abfef39ab07bfb
parent104a5d33fa09733de0dedfbf16ff917da7bc876a
net: wwan: t7xx: Fix Runtime PM initialization

[ Upstream commit 447e1d1c19b47db9310bc16038621e477e47ca49 ]

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: 6d882fcbe698 ("net: wwan: t7xx: Runtime PM")
Signed-off-by: Kornel Dulęba <mindal@semihalf.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wwan/t7xx/t7xx_pci.c