[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <2de2ee26bbf443491dfff1c802f2fa9efaf58d52.1617968250.git.agx@sigxcpu.org>
Date: Fri, 9 Apr 2021 13:40:20 +0200
From: Guido Günther <agx@...xcpu.org>
To: Kishon Vijay Abraham I <kishon@...com>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Robert Chiras <robert.chiras@....com>,
Sam Ravnborg <sam@...nborg.org>, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, Liu Ying <victor.liu@....com>
Subject: [PATCH v5 1/2] phy: core: Use runtime pm during configure too
The phy's configure phase usually needs register access so taking the
device out of pm_runtime suspend looks useful.
There's currently two in tree drivers using runtime pm and .configure
(qualcomm/phy-qcom-qmp.c, rockchip/phy-rockchip-inno-dsidphy.c) but both
don't use the phy layers 'transparent' runtime phy_pm_runtime handling
but manage it manually so this will for now only affect the
phy-fsl-imx8-mipi-dphy driver.
Signed-off-by: Guido Günther <agx@...xcpu.org>
---
drivers/phy/phy-core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
index ccb575b13777..256a964d52d3 100644
--- a/drivers/phy/phy-core.c
+++ b/drivers/phy/phy-core.c
@@ -470,10 +470,16 @@ int phy_configure(struct phy *phy, union phy_configure_opts *opts)
if (!phy->ops->configure)
return -EOPNOTSUPP;
+ ret = phy_pm_runtime_get_sync(phy);
+ if (ret < 0 && ret != -ENOTSUPP)
+ return ret;
+ ret = 0; /* Override possible ret == -ENOTSUPP */
+
mutex_lock(&phy->mutex);
ret = phy->ops->configure(phy, opts);
mutex_unlock(&phy->mutex);
+ phy_pm_runtime_put(phy);
return ret;
}
EXPORT_SYMBOL_GPL(phy_configure);
--
2.30.1
Powered by blists - more mailing lists