diff options
| author | Shrey Vijay <shreyv@codeaurora.org> | 2016-12-14 15:56:05 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-12-22 01:46:01 -0800 |
| commit | 1ee08ea3dd185eaba6d3bd812a7b9a1e57735200 (patch) | |
| tree | cc74a7237084611e54622296d754e714074293da | |
| parent | e379f786aa82c6c94b95cbb06befba802731019a (diff) | |
i2c-msm-v2:Synchronise runtime PM callback operations
During system wakeup from suspend by connecting USB cable,
runtime PM framework transitions from enabled to disabled
state during i2c transaction. This causes asymmetric increment
and decrement of device's usage counter which blocks runtime
PM suspend callback.
To avoid this, remove rumtime PM status check on suspend path
to make it symmetric with the resume path. This takes care
of unaccounted increment/decrement of device's usage counter.
Change-Id: I47cfe2cd7d93ba5db57365cf250c600dac22bab1
Signed-off-by: Shrey Vijay <shreyv@codeaurora.org>
| -rw-r--r-- | drivers/i2c/busses/i2c-msm-v2.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-msm-v2.c b/drivers/i2c/busses/i2c-msm-v2.c index a510490d28d6..04b1b62f85c3 100644 --- a/drivers/i2c/busses/i2c-msm-v2.c +++ b/drivers/i2c/busses/i2c-msm-v2.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -2236,12 +2236,12 @@ static void i2c_msm_pm_xfer_end(struct i2c_msm_ctrl *ctrl) i2c_msm_dma_free_channels(ctrl); i2c_msm_pm_clk_disable_unprepare(ctrl); - if (pm_runtime_enabled(ctrl->dev)) { - pm_runtime_mark_last_busy(ctrl->dev); - pm_runtime_put_autosuspend(ctrl->dev); - } else { + + if (!pm_runtime_enabled(ctrl->dev)) i2c_msm_pm_suspend(ctrl->dev); - } + + pm_runtime_mark_last_busy(ctrl->dev); + pm_runtime_put_autosuspend(ctrl->dev); mutex_unlock(&ctrl->xfer.mtx); } |
