public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: rcar: call pm_runtime_put() only if it has ID_P_PM_BLOCKED
@ 2022-04-14  1:15 Kuninori Morimoto
  2022-05-20  9:44 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Kuninori Morimoto @ 2022-04-14  1:15 UTC (permalink / raw)
  To: Wolfram Sang, Philipp Zabel; +Cc: linux-i2c

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

ID_P_PM_BLOCKED is controlling PM status.
We need to check it for pm_runtime_put() on rcar_i2c_probe(),
otherwise it will be duplicated put.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
Wolfram:
It is not deeply tested.

 drivers/i2c/busses/i2c-rcar.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index f71c730f9838..b5f0929bcea5 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -1121,7 +1121,8 @@ static int rcar_i2c_probe(struct platform_device *pdev)
  out_del_device:
 	i2c_del_adapter(&priv->adap);
  out_pm_put:
-	pm_runtime_put(dev);
+	if (priv->flags & ID_P_PM_BLOCKED)
+		pm_runtime_put(dev);
  out_pm_disable:
 	pm_runtime_disable(dev);
 	return ret;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] i2c: rcar: call pm_runtime_put() only if it has ID_P_PM_BLOCKED
  2022-04-14  1:15 [PATCH] i2c: rcar: call pm_runtime_put() only if it has ID_P_PM_BLOCKED Kuninori Morimoto
@ 2022-05-20  9:44 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2022-05-20  9:44 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Philipp Zabel, linux-i2c

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

Hi Morimoto-san,

> ID_P_PM_BLOCKED is controlling PM status.
> We need to check it for pm_runtime_put() on rcar_i2c_probe(),
> otherwise it will be duplicated put.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Yes, you found a problem here, thank you! However, the solution is not
complete and while investigating what else is needed, I already created
V2 myself. I hope you don't mind. I will send it in a minute.

All the best,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-20  9:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-14  1:15 [PATCH] i2c: rcar: call pm_runtime_put() only if it has ID_P_PM_BLOCKED Kuninori Morimoto
2022-05-20  9:44 ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox