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/display/dp: Export function to wake the sink AUX_CH Date: Tue, 10 Mar 2026 12:41:16 +1000 Message-ID: In-Reply-To: <20260309-dp_aux_timeout-v1-1-08c610a63a84@intel.com> References: <20260309-dp_aux_timeout-v1-0-08c610a63a84@intel.com> <20260309-dp_aux_timeout-v1-1-08c610a63a84@intel.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review **`poll_timeout_us` misuse:** ```c ret =3D poll_timeout_us(ret =3D drm_dp_dpcd_readb(aux, DP_SET_POWER, &value= ), ret > 0, 1000, wake_retry * 1000, true); ``` The variable `ret` is used both as the operation result (inside the macro e= xpansion) AND as the macro's return value. After the macro completes, `ret`= holds the macro's return value (0 or `-ETIMEDOUT`), not the `drm_dp_dpcd_r= eadb` return value. This means the `ret < 0` check below is only checking f= or `-ETIMEDOUT` from the poll, not a DPCD read failure. This is confusing a= nd fragile =E2=80=94 use a separate variable for the poll result. **Condition logic concern:** ```c if (value =3D=3D DP_SET_POWER_D3 || ret < 0) { ``` If the poll times out (ret =3D=3D -ETIMEDOUT), `value` might contain stale = or partial data from a failed read. The function proceeds to write to `DP_S= ET_POWER` without checking whether DPCD writes actually succeed =E2=80=94 n= o error checking on either `drm_dp_dpcd_writeb` call. **Wake sequence concern:** ```c drm_dp_dpcd_writeb(aux, DP_SET_POWER, DP_SET_POWER_D0); fsleep(1000); drm_dp_dpcd_writeb(aux, DP_SET_POWER, DP_SET_POWER_D3_AUX_ON); ``` Setting to D0 and then immediately to D3_AUX_ON seems odd. The cover letter= and spec reference (Section 2.3.4) say the goal is to wake the sink for AU= X communication, but D3_AUX_ON is still a low-power state. If the caller is= about to retry an AUX transaction, why not leave it in D0? The intent shou= ld be clarified. **Missing `#include`:** The function uses `poll_timeout_us` from `` and `fsleep`. Ensure the drm_dp_helper.c file includes the necessa= ry headers. **Naming:** `drm_dp_wake_sink` is generic but it specifically deals with AU= X channel power states. A name like `drm_dp_aux_wake_sink` might be more pr= ecise. **Documentation:** The kerneldoc is incomplete =E2=80=94 it should describe= the behavior (what it does on success/failure, return value semantics =E2= =80=94 though it's void). --- --- Generated by Claude Code Patch Reviewer