Patch "i2c: rcar: disable runtime PM correctly in slave mode" has been added to the 4.3-stable tree
Subsystems (4)
This is a note to let you know that I've just added the patch titled
i2c: rcar: disable runtime PM correctly in slave mode
to the 4.3-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
i2c-rcar-disable-runtime-pm-correctly-in-slave-mode.patch
and it can be found in the queue-4.3 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
b4cd08aa1f53c831e67dc5c6bc9f9acff27abcbaMon Sep 17 00:00:00 2001
From: Wolfram Sang <[email protected]>
Date: Wed, 16 Dec 2015 20:05:18 +0100
Subject: i2c: rcar: disable runtime PM correctly in slave mode
From: Wolfram Sang <[email protected]>
commit b4cd08aa1f53c831e67dc5c6bc9f9acff27abcba upstream.
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_get_sync/put to achieve this, since it has proper refcounting. pm_runtime_allow/forbid is like a global knob controllable from userspace which is unsuitable here.
--- drivers/i2c/busses/i2c-rcar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-rcar.c +2 -2
@@ -575,7 +575,7 @@ static int rcar_reg_slave(struct i2c_cliif (slave->flags &I2C_CLIENT_TEN )return -EAFNOSUPPORT ; -pm_runtime_forbid (rcar_i2c_priv_to_dev (priv)); +pm_runtime_get_sync (rcar_i2c_priv_to_dev (priv)); priv->slave = slave;rcar_i2c_write (priv,ICSAR , slave->addr);
@@ -597,7 +597,7 @@ static int rcar_unreg_slave(struct i2c_c priv->slave =NULL ; -pm_runtime_allow (rcar_i2c_priv_to_dev (priv)); +pm_runtime_put (rcar_i2c_priv_to_dev (priv));return 0 ; }
Patches currently in stable-queue which might be from [email protected] are
queue-4.3/i2c-rcar-disable-runtime-pm-correctly-in-slave-mode.patch