From: Wolfram Sang <>

When we also are I2C slave, we need to disable runtime PM because the
address detection mechanism needs to be active all the time. However, we
can reenable runtime PM once the slave instance was unregistered. So,
use pm_runtime_disable/enable to achieve this, since it has proper
refcounting. pm_runtime_allow/forbid is like a global switch which is
unsuitable here.

Signed-off-by: Wolfram Sang <>

I'd be grateful to get an ACK from a runtime PM expert to verify that my
assumptions match reality :)

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

diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c
index b2389c492579cf..dc3343291e7497 100644
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -533,7 +533,7 @@ static int rcar_reg_slave(struct i2c_client *slave)
        if (slave->flags & I2C_CLIENT_TEN)
                return -EAFNOSUPPORT;
-       pm_runtime_forbid(rcar_i2c_priv_to_dev(priv));
+       pm_runtime_disable(rcar_i2c_priv_to_dev(priv));
        priv->slave = slave;
        rcar_i2c_write(priv, ICSAR, slave->addr);
@@ -555,7 +555,7 @@ static int rcar_unreg_slave(struct i2c_client *slave)
        priv->slave = NULL;
-       pm_runtime_allow(rcar_i2c_priv_to_dev(priv));
+       pm_runtime_enable(rcar_i2c_priv_to_dev(priv));
        return 0;

To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to
More majordomo info at

Reply via email to