drm/bridge: dw-hdmi-qp: limit DDC i2c retries on NACK#513
Conversation
A NACK on the DDC bus means no device answered at that address, which is definitive rather than transient, but the i2c read and write paths retried it 100 times with a 10ms sleep each. A sink that advertises SCDC in its HF-VSDB yet does not answer its 0x54 slave then produced ~100 error lines per transfer and stalled the modeset for about a second. Cap NACK retries at three and demote the per-attempt message to debug, keeping the single "ddc read/write failed" error. Signed-off-by: SuperKali <hello@superkali.me>
WalkthroughThis change modifies the dw-hdmi-qp DRM bridge driver's DDC I2C transaction handling. A new Estimated code review effort: 2 (Simple) | ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c`:
- Around line 1198-1206: The NACK retry path in the DDC/I2C write flow is
advancing the target register too early, so a transient retry can write to the
next address instead of the original one. Update the write logic around the
`dw_hdmi_qp` DDC transfer path to preserve the current `i2c->slave_reg` across
retries, and only advance the register after a successful byte write in the loop
that uses `hdmi_writel`, `hdmi_modb`, and the NACK `continue` branch.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 82e09cb0-6a82-4c1e-96ea-77d4f7245f3a
📒 Files selected for processing (1)
drivers/gpu/drm/bridge/synopsys/dw-hdmi-qp.c
On a YY3588 driving a 1080p120 sink the boot log fills with over a hundred lines during the first modeset:
The controller writes SCDC (I2C slave 0x54) while setting up the mode. The monitor advertises SCDC in its HF-VSDB but does not answer that slave, so every access is NACKed. The i2c read and write paths treated a NACK like a transient error and retried it 100 times with a 10ms sleep each, which both floods the log and stalls the modeset for about a second per transfer.
A NACK means no device answered at that address, so this caps the retries at three and demotes the per-attempt message to debug. The single "ddc read/write failed" error is kept, since a genuine DDC failure (a real EDID read on hotplug) still deserves a line.
Tested on a YY3588 (EVB7 V11, vendor kernel 6.1.115): the "i2c write nack" flood drops from 113 lines to 0, leaving a couple of "ddc write failed" lines, and the display still comes up at 1080p120.