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/rockchip: vop2: Use drm_err_ratelimited() for wait timeouts Date: Wed, 11 Feb 2026 16:54:13 +1000 Message-ID: In-Reply-To: <20260209161621.6136-1-hungen3108@gmail.com> References: <20260209161621.6136-1-hungen3108@gmail.com> <20260209161621.6136-1-hungen3108@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Mailer: Claude Code Patch Reviewer Patch Review **Commit Message Analysis**: ``` Replace deprecated DRM_DEV_ERROR() with drm_err_ratelimited() in the VOP2 register wait timeout paths to align with current DRM logging helpers and avoid flooding the kernel log when timeouts repeat. ``` The commit message is concise but contains a misleading claim. The original code did NOT use rate limiting, so "avoid flooding" implies this is fixing an existing problem when it's actually introducing new behavior. The message should clarify that this adds rate limiting as an improvement, not that it maintains existing behavior. **Technical Review**: **Change 1: Port mux timeout logging** (lines 113-117) ```c - DRM_DEV_ERROR(vop2->dev, "wait port_mux done timeout: 0x%x--0x%x\n", - port_mux_sel, vop2->old_port_sel); + drm_err_ratelimited(vop2->drm, "wait port_mux done timeout: 0x%x--0x%x\n", + port_mux_sel, vop2->old_port_sel); ``` Issues: 1. **Device context change**: Switching from `vop2->dev` (struct device) to `vop2->drm` (struct drm_device) changes what device appears in the log. Is `vop2->drm` guaranteed to be non-NULL at this point in the code path? 2. **Rate limiting implications**: Timeouts here indicate hardware/synchronization failures. Rate limiting could hide repeated failures during debugging. Is this the right tradeoff? 3. **Indentation**: The new indentation appears correct (aligned with opening parenthesis). **Change 2: Layer config timeout logging** (lines 124-128) ```c - DRM_DEV_ERROR(vop2->dev, "wait layer cfg done timeout: 0x%x--0x%x\n", - atv_layer_cfg, cfg); + drm_err_ratelimited(vop2->drm, "wait layer cfg done timeout: 0x%x--0x%x\n", + atv_layer_cfg, cfg); ``` Same issues as Change 1: 1. Device context switch from `vop2->dev` to `vop2->drm` 2. Rate limiting on hardware timeout errors 3. Indentation looks correct **Missing Analysis**: 1. **Initialization verification**: The patch should verify that `vop2->drm` is initialized before these functions can be called. A quick grep would show if there are code paths where these waits happen during early initialization. 2. **Timeout frequency**: Are these timeouts expected to occur repeatedly in normal operation (suggesting rate limiting is good), or are they exceptional events that should always be logged (suggesting rate limiting is bad)? 3. **Consistency**: Are there other timeout errors in the same file still using `DRM_DEV_ERROR()`? A grep for remaining uses would show if this conversion should be more comprehensive. **Questions for Author**: 1. Can you verify that `vop2->drm` is guaranteed to be initialized when these wait functions are called? 2. Have you observed repeated timeout errors that motivated the rate limiting, or is this purely preventative? 3. Should the commit message be updated to clarify this adds rate limiting rather than implying it was already present? 4. Are there debugging scenarios where we'd want to see every timeout occurrence, or is rate limiting always appropriate here? **Verdict**: The mechanical conversion appears correct, but the behavioral change (adding rate limiting) and device context change need justification. The commit message should be more accurate about introducing new behavior. **Suggested Commit Message**: ``` drm/rockchip: vop2: Use drm_err_ratelimited() for wait timeouts Replace deprecated DRM_DEV_ERROR() with drm_err_ratelimited() in the VOP2 register wait timeout paths to align with current DRM logging helpers. This also adds rate limiting to these error messages to prevent log spam if hardware issues cause repeated timeouts. The timeout duration is 50ms, so without rate limiting, a persistent issue could log many times per second. Signed-off-by: Hsieh Hung-En ``` --- Generated by Claude Code Patch Reviewer