Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: core: Reinstate pm_runtime_enabled() check in phy_pm_runtime_put()

On Koelsch (R-Car M2-W), during boot and s2ram:

phy phy-e6590100.usb-phy-controller.0: Runtime PM usage count underflow!

While phy_pm_runtime_get{,_sync}() and phy_pm_runtime_put_sync() still
contain pm_runtime_enabled() checks, the same check in
phy_pm_runtime_put() was deemed redundant and removed, causing count
underflows with PHY drivers like drivers/phy/renesas/phy-rcar-gen2.c
that do not use Runtime PM yet,

Fix this by reinstating the check.

Fixes: caad07ae07e3fb17 ("phy: core: Discard pm_runtime_put() return values")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/3ca9f8166d21685bfbf97535da30172f74822130.1767107014.git.geert+renesas@glider.be
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Geert Uytterhoeven and committed by
Vinod Koul
0287c960 8df20813

+3
+3
drivers/phy/phy-core.c
··· 195 195 if (!phy) 196 196 return; 197 197 198 + if (!pm_runtime_enabled(&phy->dev)) 199 + return; 200 + 198 201 pm_runtime_put(&phy->dev); 199 202 } 200 203 EXPORT_SYMBOL_GPL(phy_pm_runtime_put);