[UPSTREAM] arch/arm/imxrt: Improve imxrt_lpi2c_reset

Re-initialize the bus even in the case the bus cannot be re-covered. The
client still has a reference to the bus, and may try to access it again.
If the bus is not initialized or the root clock is off, the access may
cause a crash.

Signed-off-by: Jukka Laitinen <jukka.laitinen@tii.ae>
This commit is contained in:
Jukka Laitinen 2026-09-22 12:04:59 +03:00 • committed by GUIDINGLI
parent 2c736d0860
commit 70e453c2c4

View file

@ -2387,6 +2387,10 @@ static int imxrt_lpi2c_reset(struct i2c_master_s *dev)
imxrt_config_gpio(sda_gpio);
imxrt_config_gpio(scl_gpio);
ret = OK;
out:
/* Re-init the port */
imxrt_lpi2c_init(priv);
@ -2394,9 +2398,6 @@ static int imxrt_lpi2c_reset(struct i2c_master_s *dev)
/* Restore the frequency */
imxrt_lpi2c_setclock(priv, frequency);
ret = OK;
out:
/* Release the port for reuse by other clients */