RE: [PATCH] i2c: rzv2m: fail probe on reset and runtime-PM errors

From: Fabrizio Castro

Date: Tue Sep 01 2026 - 06:46:36 EST


Hi Pengpeng,

Thanks for your patch.

> From: Pengpeng Hou <pengpeng@xxxxxxxxxxx>
> Sent: 30 August 2026 15:07
> To: Fabrizio Castro <fabrizio.castro.jz@xxxxxxxxxxx>
> Cc: Pengpeng Hou <pengpeng@xxxxxxxxxxx>; Andi Shyti <andi.shyti@xxxxxxxxxx>; Philipp Zabel
> <p.zabel@xxxxxxxxxxxxxx>; linux-i2c@xxxxxxxxxxxxxxx; linux-renesas-soc@xxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx
> Subject: [PATCH] i2c: rzv2m: fail probe on reset and runtime-PM errors
>
> Probe ignores reset deassertion and runtime-PM activation failures before
> initializing the controller and registering an I2C adapter.
>
> Propagate both required activation errors and disable runtime PM if its
> initial resume fails.
>
> Fixes: e0ca796a151b ("i2c: Add Renesas RZ/V2M controller")
> Signed-off-by: Pengpeng Hou <pengpeng@xxxxxxxxxxx>

Did you use an AI tool to generate this patch?

Do you need the `Assisted-by` tag here?

> ---
> drivers/i2c/busses/i2c-rzv2m.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-rzv2m.c b/drivers/i2c/busses/i2c-rzv2m.c
> index 206a99e722a37..81e0101b61946 100644
> --- a/drivers/i2c/busses/i2c-rzv2m.c
> +++ b/drivers/i2c/busses/i2c-rzv2m.c
> @@ -433,7 +433,9 @@ static int rzv2m_i2c_probe(struct platform_device *pdev)
> * The reset also affects other HW that is not under the control
> * of Linux. Therefore, all we can do is deassert the reset.
> */
> - reset_control_deassert(rstc);
> + ret = reset_control_deassert(rstc);
> + if (ret)
> + return ret;

While the change is sound, the RZ/V2M has a strange SW arrangement.
Half the system is managed by firmware code running on a dedicated core,
the other half of the system is managed by Linux running on its own core.

Some resources are shared between the 2 halves, and the line that separates
the two is sometimes blurry. This patch should be tested against the firmware
code to make sure it's not preventing the I2C controller driver from starting
probing.

I don't have access to the firmware code at the moment, therefore I am inclined
to say that perhaps we shouldn't consider it until somebody is able to properly
test it, as I suspect that the return value of reset_control_deassert() was not
tested for a reason.

Cheers,
Fab

>
> irq = platform_get_irq(pdev, 0);
> if (irq < 0)
> @@ -461,7 +463,11 @@ static int rzv2m_i2c_probe(struct platform_device *pdev)
>
> pm_runtime_enable(dev);
>
> - pm_runtime_get_sync(dev);
> + ret = pm_runtime_resume_and_get(dev);
> + if (ret < 0) {
> + pm_runtime_disable(dev);
> + return ret;
> + }
> rzv2m_i2c_init(priv);
> pm_runtime_put(dev);
>
> base-commit: 08dbfad3f5040f5bdb6c529da20d6d4e81fefd72
> --
> 2.50.1