Re: [PATCH v2 2/2] drm/amd/display: close DDC on I2C engine setup failure

From: NepNep7601

Date: Fri Sep 11 2026 - 08:08:11 EST


Just a kind reminder to check this patch, thank you!

Best regards,
NepNep7601

On 27/08/2026 03:44, NepNep7601 wrote:
> acquire_i2c_hw_engine() opens the DDC pins before setting up the
> hardware engine. If setup_engine() fails, the error path releases the
> engine but leaves the DDC pins open and the engine's DDC pointer set.
>
> Subsequent attempts to open the pins then return
> GPIO_RESULT_ALREADY_OPENED, preventing further I2C transfers, EDID
> reads and hotplug detection on that port until reboot.
>
> Mirror the normal teardown path by closing the DDC pins and clearing
> the pointer after releasing the engine.
>
> Assisted-by: Codex:gpt-5
> Signed-off-by: NepNep7601 <neptune@xxxxxxxxxxxxxxxxxxxx>
> ---
> drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c b/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c
> index 05892ab4529f..e7a05494abab 100644
> --- a/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c
> +++ b/drivers/gpu/drm/amd/display/dc/dce/dce_i2c_hw.c
> @@ -485,6 +485,8 @@ struct dce_i2c_hw *acquire_i2c_hw_engine(
>
> if (!setup_engine(dce_i2c_hw)) {
> release_engine(dce_i2c_hw);
> + dal_ddc_close(dce_i2c_hw->ddc);
> + dce_i2c_hw->ddc = NULL;
> return NULL;
> }