Message ID | 20230911035501.36706-2-tony@atomide.com |
---|---|
State | Superseded |
Headers | show |
Series | [1/3] phy: mapphone-mdm6600: Fix runtime disable on probe | expand |
Hi, On Mon, Sep 11, 2023 at 06:54:56AM +0300, Tony Lindgren wrote: > Otherwise we will get an underflow on remove. > > Cc: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> > Cc: Merlijn Wajer <merlijn@wizzup.org> > Cc: Pavel Machek <pavel@ucw.cz> > Cc: Sebastian Reichel <sre@kernel.org> > Fixes: f7f50b2a7b05 ("phy: mapphone-mdm6600: Add runtime PM support for n_gsm on USB suspend") > Signed-off-by: Tony Lindgren <tony@atomide.com> > --- > drivers/phy/motorola/phy-mapphone-mdm6600.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c > --- a/drivers/phy/motorola/phy-mapphone-mdm6600.c > +++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c > @@ -640,6 +640,11 @@ static void phy_mdm6600_remove(struct platform_device *pdev) > { > struct phy_mdm6600 *ddata = platform_get_drvdata(pdev); > struct gpio_desc *reset_gpio = ddata->ctrl_gpios[PHY_MDM6600_RESET]; > + int error; > + > + error = pm_runtime_resume_and_get(ddata->dev); > + if (error) > + return; Isn't this just about the use counters, i.e. pm_runtime_get_noresume(); should be enough? -- Sebastian > pm_runtime_dont_use_autosuspend(ddata->dev); > pm_runtime_put_sync(ddata->dev); > -- > 2.42.0
* Sebastian Reichel <sebastian.reichel@collabora.com> [230912 15:00]: > Isn't this just about the use counters, i.e. > pm_runtime_get_noresume(); should be enough? Good point I'll check. We are toggling the out-of-bandwidth modem wake gpio line with runtime PM, it may not matter on remove. Regards, Tony
diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c --- a/drivers/phy/motorola/phy-mapphone-mdm6600.c +++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c @@ -640,6 +640,11 @@ static void phy_mdm6600_remove(struct platform_device *pdev) { struct phy_mdm6600 *ddata = platform_get_drvdata(pdev); struct gpio_desc *reset_gpio = ddata->ctrl_gpios[PHY_MDM6600_RESET]; + int error; + + error = pm_runtime_resume_and_get(ddata->dev); + if (error) + return; pm_runtime_dont_use_autosuspend(ddata->dev); pm_runtime_put_sync(ddata->dev);
Otherwise we will get an underflow on remove. Cc: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Cc: Sebastian Reichel <sre@kernel.org> Fixes: f7f50b2a7b05 ("phy: mapphone-mdm6600: Add runtime PM support for n_gsm on USB suspend") Signed-off-by: Tony Lindgren <tony@atomide.com> --- drivers/phy/motorola/phy-mapphone-mdm6600.c | 5 +++++ 1 file changed, 5 insertions(+)