Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit edf6ffe4 authored by Leo (Sunpeng) Li's avatar Leo (Sunpeng) Li Committed by Alex Deucher
Browse files

drm/amd/display: Read AUX channel even if only status byte is returned



[Why]
get_channel_status() can return 0 in returned_bytes, and report a
successful operation result. This is because it prunes the first status
byte out. This was preventing read_channel_reply() from being called
(due to the faulty condition), and consequently preventing the AUX
reply status from being set.

[How]
Fix the conditional so that it accounts for when get_channel_status()
returns 0 bytes read.

[Fixes]
Fixes possible edid read failures during S3 resume, where we are now
relying on DRM's DP AUX handling. This was an regression introduced by:

    Author: Harry Wentland <harry.wentland@amd.com>
        drm/amd/display: Return aux replies directly to DRM

Signed-off-by: default avatarLeo (Sunpeng) Li <sunpeng.li@amd.com>
Reviewed-by: default avatarHarry Wentland <Harry.Wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 30921089
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -671,7 +671,7 @@ int dc_link_aux_transfer(struct ddc_service *ddc,
	case AUX_CHANNEL_OPERATION_SUCCEEDED:
		res = returned_bytes;

		if (res <= size && res > 0)
		if (res <= size && res >= 0)
			res = engine->funcs->read_channel_reply(engine, size,
								buffer, reply,
								&status);