]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
i2c: rcar: disable runtime PM correctly in slave mode
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 16 Dec 2015 19:05:18 +0000 (20:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Feb 2016 22:28:29 +0000 (14:28 -0800)
commite266f6c3b75c6b1695483685ab16f2cdb54e47ec
treebea1b19e1b1de68bbcfadb1f9e96d0cd24d63278
parent42947fa48a86aca9e52a4003af69e6bb753dc7ea
i2c: rcar: disable runtime PM correctly in slave mode

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.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-rcar.c