From: bui duc phuc <[email protected]> regcache_sync() failure in adv7511_power_on() is silently ignored, leaving the chip marked as powered on even though register synchronization may not have completed successfully. Log the error and attempt to power the chip back off on failure, to avoid the driver believing the chip is fully configured when it may not be.
Signed-off-by: bui duc phuc <[email protected]> --- drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index d98a8f7afc7f..3e470366bce0 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c @@ -367,12 +367,20 @@ static void __adv7511_power_on(struct adv7511 *adv7511) static void adv7511_power_on(struct adv7511 *adv7511) { + int ret; + __adv7511_power_on(adv7511); /* * Most of the registers are reset during power down or when HPD is low. */ - regcache_sync(adv7511->regmap); + ret = regcache_sync(adv7511->regmap); + if (ret) { + dev_err(&adv7511->i2c_main->dev, + "Failed to sync register cache: %d\n", ret); + __adv7511_power_off(adv7511); + return; + } if (adv7511->info->has_dsi) adv7533_dsi_power_on(adv7511); -- 2.43.0
