From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: drm/msm/hdmi: Fix wrong CTRL1 register used in writing info frames Date: Thu, 12 Mar 2026 06:46:34 +1000 Message-ID: In-Reply-To: <20260311191620.245394-2-krzysztof.kozlowski@oss.qualcomm.com> References: <20260311191620.245394-2-krzysztof.kozlowski@oss.qualcomm.com> <20260311191620.245394-2-krzysztof.kozlowski@oss.qualcomm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Bug analysis:** The original code (from commit `384d2b03d0a1`) converted unconditional register writes to read-modify-write sequences but read from `REG_HDMI_INFOFRAME_CTRL1` while applying masks for `HDMI_INFOFRAME_CTRL0` fields and writing to `REG_HDMI_INFOFRAME_CTRL0`. This means the CTRL0 register was being corrupted with bits from CTRL1, and any existing CTRL0 bits that should have been preserved were lost. **Fix correctness:** The fix changes both occurrences to read from `REG_HDMI_INFOFRAME_CTRL0`, making the read-modify-write consistent: ```c val = hdmi_read(hdmi, REG_HDMI_INFOFRAME_CTRL0); // was CTRL1 val |= HDMI_INFOFRAME_CTRL0_AVI_SEND | HDMI_INFOFRAME_CTRL0_AVI_CONT; hdmi_write(hdmi, REG_HDMI_INFOFRAME_CTRL0, val); ``` and similarly for the audio infoframe path: ```c val = hdmi_read(hdmi, REG_HDMI_INFOFRAME_CTRL0); // was CTRL1 val |= HDMI_INFOFRAME_CTRL0_AUDIO_INFO_SEND | HDMI_INFOFRAME_CTRL0_AUDIO_INFO_CONT | HDMI_INFOFRAME_CTRL0_AUDIO_INFO_SOURCE | HDMI_INFOFRAME_CTRL0_AUDIO_INFO_UPDATE; hdmi_write(hdmi, REG_HDMI_INFOFRAME_CTRL0, val); ``` Looking at the post-patch source (lines 156-164), the pattern is now consistent with the immediately following block that correctly does read-modify-write on CTRL1 for CTRL1-specific fields (`HDMI_INFOFRAME_CTRL1_AVI_INFO_LINE`). **Minor observation:** The `|=` operation (rather than clearing bits first with a mask) means these "send/cont" bits are only ever set, never cleared through this path. This is fine since the `clear_avi_infoframe` / `clear_audio_infoframe` functions are called at the start of each write function to handle the clearing. **Tags:** Fixes tag, Cc: stable, and Signed-off-by are all present and appropriate. **No issues found.** Reviewed-by recommendation: This patch is correct and ready to merge. --- Generated by Claude Code Patch Reviewer