[EXT] [PATCH] i2c-imx: fix broken GPIO bus recovery due to missing recover_bus assignment

Carlos Song carlos.song at nxp.com
Wed Jul 9 00:18:30 PDT 2025



> -----Original Message-----
> From: Jan-David Voelkel <jan-david-voelkel at web.de>
> Sent: Wednesday, July 9, 2025 2:39 PM
> To: Oleksij Rempel <o.rempel at pengutronix.de>; Andi Shyti
> <andi.shyti at kernel.org>; Shawn Guo <shawnguo at kernel.org>; Sascha Hauer
> <s.hauer at pengutronix.de>
> Cc: kernel at pengutronix.de; festevam at gmail.com; linux-i2c at vger.kernel.org;
> imx at lists.linux.dev; linux-arm-kernel at lists.infradead.org;
> linux-kernel at vger.kernel.org; Janitawa <jan-david-voelkel at web.de>
> Subject: [EXT] [PATCH] i2c-imx: fix broken GPIO bus recovery due to missing
> recover_bus assignment
> 
> [You don't often get email from jan-david-voelkel at web.de. Learn why this is
> important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> Caution: This is an external email. Please take care when clicking links or
> opening attachments. When in doubt, report the message using the 'Report this
> email' button
> 
> 
> From: Janitawa <jan-david-voelkel at web.de>
> 
> The transition to generic GPIO recovery support removed the driver-specific bus
> recovery logic but failed to assign the required recover_bus callback. This
> prevented the core from enabling recovery, effectively disabling the feature.
> 
> This commit restores the assignment to ensure proper recovery initialization.
> 
> Signed-off-by: Janitawa <jan-david-voelkel at web.de>
> ---
>  drivers/i2c/busses/i2c-imx.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index
> c5224d43eea4..421f6da61f00 100644
> --- a/drivers/i2c/busses/i2c-imx.c
> +++ b/drivers/i2c/busses/i2c-imx.c
> @@ -1375,6 +1375,8 @@ static int i2c_imx_init_recovery_info(struct
> imx_i2c_struct *i2c_imx,
>         if (IS_ERR(bri->pinctrl))
>                 return PTR_ERR(bri->pinctrl);
> 
> +       bri->recover_bus = i2c_generic_scl_recovery;
> +
>         i2c_imx->adapter.bus_recovery_info = bri;
> 


Hi,

Have you meet one issue on i2c-imx recovery function?

If bri->recover_bus is NULL and scl_gpios has been added at i2c node.
I notice i2c_generic_scl_recovery will be assigned to bri->recover_bus to help
I2c-imx can support gpio recovery.

Code path in i2c-core-base.c:

> bri->recover_bus = i2c_generic_scl_recovery;
> i2c_gpio_init_generic_recovery()
> i2c_gpio_init_recovery()
> i2c_init_recovery()
> i2c_register_adapter()


Carlos Song

>         return 0;
> --
> 2.43.0
> 




More information about the linux-arm-kernel mailing list