Commit 0f0a54bd authored by Anthony Koo's avatar Anthony Koo Committed by Greg Kroah-Hartman

drm/amd/display: Fix exception from AUX acquire failure

[ Upstream commit dcf1a988 ]

[Why]
AUX arbitration occurs between SW and FW components.
When AUX acquire fails, it causes engine->ddc to be NULL,
which leads to an exception when we try to release the AUX
engine.

[How]
When AUX engine acquire fails, it should return from the
function without trying to continue the operation.
The upper level will determine if it wants to retry.
i.e. dce_aux_transfer_with_retries will be used and retry.
Signed-off-by: default avatarAnthony Koo <Anthony.Koo@amd.com>
Reviewed-by: default avatarAric Cyr <Aric.Cyr@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 95be38a3
...@@ -377,7 +377,6 @@ static bool acquire( ...@@ -377,7 +377,6 @@ static bool acquire(
struct dce_aux *engine, struct dce_aux *engine,
struct ddc *ddc) struct ddc *ddc)
{ {
enum gpio_result result; enum gpio_result result;
if (!is_engine_available(engine)) if (!is_engine_available(engine))
...@@ -458,7 +457,8 @@ int dce_aux_transfer(struct ddc_service *ddc, ...@@ -458,7 +457,8 @@ int dce_aux_transfer(struct ddc_service *ddc,
memset(&aux_rep, 0, sizeof(aux_rep)); memset(&aux_rep, 0, sizeof(aux_rep));
aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en]; aux_engine = ddc->ctx->dc->res_pool->engines[ddc_pin->pin_data->en];
acquire(aux_engine, ddc_pin); if (!acquire(aux_engine, ddc_pin))
return -1;
if (payload->i2c_over_aux) if (payload->i2c_over_aux)
aux_req.type = AUX_TRANSACTION_TYPE_I2C; aux_req.type = AUX_TRANSACTION_TYPE_I2C;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment