Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/gmbus: fix spurious timeout on 512-byte burst reads
@ 2026-02-06 20:30 Samasth Norway Ananda
  2026-02-09 18:26 ` ✓ i915.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Samasth Norway Ananda @ 2026-02-06 20:30 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: jani.nikula, rodrigo.vivi, samasth.norway.ananda

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.

Also fix a typo in a nearby comment ("generata" -> "generate").

Fixes: d5dc0f43f268 ("drm/i915/gmbus: Enable burst read")
Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
---
 drivers/gpu/drm/i915/display/intel_gmbus.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_gmbus.c b/drivers/gpu/drm/i915/display/intel_gmbus.c
index 2caff677600c..5fb3fee34af4 100644
--- a/drivers/gpu/drm/i915/display/intel_gmbus.c
+++ b/drivers/gpu/drm/i915/display/intel_gmbus.c
@@ -496,8 +496,10 @@ gmbus_xfer_read_chunk(struct intel_display *display,
 
 		val = intel_de_read_fw(display, GMBUS3(display));
 		do {
-			if (extra_byte_added && len == 1)
+			if (extra_byte_added && len == 1) {
+				len--;
 				break;
+			}
 
 			*buf++ = val & 0xff;
 			val >>= 8;
@@ -693,7 +695,7 @@ do_gmbus_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs, int num,
 			goto clear_err;
 	}
 
-	/* Generate a STOP condition on the bus. Note that gmbus can't generata
+	/* Generate a STOP condition on the bus. Note that gmbus can't generate
 	 * a STOP on the very first cycle. To simplify the code we
 	 * unconditionally generate the STOP condition with an additional gmbus
 	 * cycle. */
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-02-19 23:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-06 20:30 [PATCH] drm/i915/gmbus: fix spurious timeout on 512-byte burst reads Samasth Norway Ananda
2026-02-09 18:26 ` ✓ i915.CI.BAT: success for " Patchwork
2026-02-10  1:26 ` ✗ i915.CI.Full: failure " Patchwork
2026-02-10  9:23 ` [PATCH] " Jani Nikula
2026-02-10 16:39   ` Ville Syrjälä
2026-02-19 23:25   ` [External] : " samasth.norway.ananda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox