mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-23 11:01:15 +00:00
i2c: qcom-geni: Fix runtime PM mismatch with child devices
[ Upstream commit848bd3f3de
] We need to enable runtime PM on this i2c controller before populating child devices with i2c_add_adapter(). Otherwise, if a child device uses runtime PM and stays runtime PM enabled we'll get the following warning at boot. Enabling runtime PM for inactive device (a98000.i2c) with active children [...] Call trace: pm_runtime_enable+0xd8/0xf8 geni_i2c_probe+0x440/0x460 platform_drv_probe+0x74/0xc8 [...] Let's move the runtime PM enabling and setup to before we add the adapter, so that this device can respond to runtime PM requests from children. Fixes:37692de5d5
("i2c: i2c-qcom-geni: Add bus driver for the Qualcomm GENI I2C controller") Signed-off-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Douglas Anderson <dianders@chromium.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7d5019ed49
commit
1fac2f4f2f
1 changed files with 8 additions and 7 deletions
|
@ -590,18 +590,19 @@ static int geni_i2c_probe(struct platform_device *pdev)
|
|||
|
||||
dev_dbg(&pdev->dev, "i2c fifo/se-dma mode. fifo depth:%d\n", tx_depth);
|
||||
|
||||
ret = i2c_add_adapter(&gi2c->adap);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Error adding i2c adapter %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
gi2c->suspended = 1;
|
||||
pm_runtime_set_suspended(gi2c->se.dev);
|
||||
pm_runtime_set_autosuspend_delay(gi2c->se.dev, I2C_AUTO_SUSPEND_DELAY);
|
||||
pm_runtime_use_autosuspend(gi2c->se.dev);
|
||||
pm_runtime_enable(gi2c->se.dev);
|
||||
|
||||
ret = i2c_add_adapter(&gi2c->adap);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Error adding i2c adapter %d\n", ret);
|
||||
pm_runtime_disable(gi2c->se.dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -609,8 +610,8 @@ static int geni_i2c_remove(struct platform_device *pdev)
|
|||
{
|
||||
struct geni_i2c_dev *gi2c = platform_get_drvdata(pdev);
|
||||
|
||||
pm_runtime_disable(gi2c->se.dev);
|
||||
i2c_del_adapter(&gi2c->adap);
|
||||
pm_runtime_disable(gi2c->se.dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue