Skip to content

Commit 08441f1

Browse files
samasth-norwayjlahtine-intel
authored andcommitted
drm/i915/gmbus: fix spurious timeout on 512-byte burst reads
When reading exactly 512 bytes with burst read enabled, the extra_byte_added path breaks out of the inner do-while without decrementing len. The outer while(len) then re-enters and gmbus_wait() times out since all data has been delivered. Decrement len before the break so the outer loop terminates correctly. Fixes: d5dc0f4 ("drm/i915/gmbus: Enable burst read") Signed-off-by: Samasth Norway Ananda <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jani Nikula <[email protected]> (cherry picked from commit 4ab0f09) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent c369299 commit 08441f1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/gpu/drm/i915/display/intel_gmbus.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,10 @@ gmbus_xfer_read_chunk(struct intel_display *display,
496496

497497
val = intel_de_read_fw(display, GMBUS3(display));
498498
do {
499-
if (extra_byte_added && len == 1)
499+
if (extra_byte_added && len == 1) {
500+
len--;
500501
break;
502+
}
501503

502504
*buf++ = val & 0xff;
503505
val >>= 8;

0 commit comments

Comments
 (0)