Skip to content

Commit 9fc751f

Browse files
sudeep-hollaLee Jones
authored andcommitted
i2c: qup: skip qup_i2c_suspend if the device is already runtime suspended
commit 331dcf4 upstream. If the i2c device is already runtime suspended, if qup_i2c_suspend is executed during suspend-to-idle or suspend-to-ram it will result in the following splat: WARNING: CPU: 3 PID: 1593 at drivers/clk/clk.c:476 clk_core_unprepare+0x80/0x90 Modules linked in: CPU: 3 PID: 1593 Comm: bash Tainted: G W 4.8.0-rc3 TheScarastic#14 Hardware name: Qualcomm Technologies, Inc. APQ 8016 SBC (DT) PC is at clk_core_unprepare+0x80/0x90 LR is at clk_unprepare+0x28/0x40 pc : [<ffff0000086eecf0>] lr : [<ffff0000086f0c58>] pstate: 60000145 Call trace: clk_core_unprepare+0x80/0x90 qup_i2c_disable_clocks+0x2c/0x68 qup_i2c_suspend+0x10/0x20 platform_pm_suspend+0x24/0x68 ... This patch fixes the issue by executing qup_i2c_pm_suspend_runtime conditionally in qup_i2c_suspend. Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Reviewed-by: Andy Gross <andy.gross@linaro.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Lee Jones <lee.jones@linaro.org> Change-Id: Idf53f82075dedbb8a9da9d4004ee0cdd26a23377
1 parent be387d7 commit 9fc751f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/i2c/busses/i2c-qup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,8 @@ static int qup_i2c_pm_resume_runtime(struct device *device)
728728
#ifdef CONFIG_PM_SLEEP
729729
static int qup_i2c_suspend(struct device *device)
730730
{
731-
qup_i2c_pm_suspend_runtime(device);
731+
if (!pm_runtime_suspended(device))
732+
return qup_i2c_pm_suspend_runtime(device);
732733
return 0;
733734
}
734735

0 commit comments

Comments
 (0)