mbox series

[v3,0/1] i2c: qcom-cci: pm runtime ordering fix

Message ID 20221018021920.3747344-1-bryan.odonoghue@linaro.org
Headers show
Series i2c: qcom-cci: pm runtime ordering fix | expand

Message

Bryan O'Donoghue Oct. 18, 2022, 2:19 a.m. UTC
v3:

- Drops pm_runtime_put, adds Valdimir Rb/Tb - Vladimir Zapolskiy
- This patch was previously part of a series for enabling CAMSS on
  sm8250/rb5. There's no reason to bind this fix up with the enabling
  series since it is an applicable fix for all CAMSS platforms.

https://patchwork.kernel.org/project/linux-media/patch/20220524140207.2758605-2-bryan.odonoghue@linaro.org/

Bryan O'Donoghue (1):
  i2c: qcom-cci: Fix ordering of pm_runtime_xx and i2c_add_adapter

 drivers/i2c/busses/i2c-qcom-cci.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Wolfram Sang Oct. 19, 2022, 7:37 p.m. UTC | #1
On Tue, Oct 18, 2022 at 03:19:20AM +0100, Bryan O'Donoghue wrote:
> 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: e517526195de ("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>

Applied to for-current, thanks!