i2c: qcom-cci: Fix ordering of pm_runtime_xx and i2c_add_adapter
stable inclusion from stable-v5.10.152 commit 6dcf1f0802cc36df55c94e7ce1edd83666a1d8f4 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I73HJ0 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6dcf1f0802cc36df55c94e7ce1edd83666a1d8f4 -------------------------------- commit 61775d54 upstream. When we compile-in the CCI along with the imx412 driver and run on the RB5 we see that i2c_add_adapter() causes the probe of the imx412 driver to happen. This probe tries to perform an i2c xfer() and the xfer() in i2c-qcom-cci.c fails on pm_runtime_get() because the i2c-qcom-cci.c::probe() function has not completed to pm_runtime_enable(dev). Fix this sequence by ensuring pm_runtime_xxx() calls happen prior to adding the i2c adapter. Fixes: e5175261 ("i2c: Add Qualcomm CCI I2C driver") Reported-by:Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Reviewed-by:
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Tested-by:
Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Cc: <stable@vger.kernel.org> Signed-off-by:
Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by:
Robert Foss <robert.foss@linaro.org> Signed-off-by:
Wolfram Sang <wsa@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Lipeng Sang <sanglipeng1@jd.com>
Loading
Please sign in to comment