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/i915/reset: Move pending_fb_pin handling to i915 Date: Sun, 12 Apr 2026 12:04:47 +1000 Message-ID: In-Reply-To: <20260408233458.22666-4-ville.syrjala@linux.intel.com> References: <20260408233458.22666-1-ville.syrjala@linux.intel.com> <20260408233458.22666-4-ville.syrjala@linux.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 This moves the `pending_fb_pin` atomic counter from `display->restore` to `= i915->` (i915-specific) so it's not a display-layer concern. The pending_fb= _pin check and wedging are moved from `intel_display_reset_prepare()` into = the i915 `intel_gt_reset_global()` caller. **Issue in `i915_overlay.c`:** The patch adds `atomic_inc(&i915->pending_fb= _pin)` before the pin and `atomic_dec(&i915->pending_fb_pin)` after `i915_g= em_ww_ctx_fini()`, but critically, the decrement happens **before** checkin= g `if (ret) return ERR_PTR(ret)`: ```c atomic_inc(&i915->pending_fb_pin); i915_gem_ww_ctx_init(&ww, true); retry: ... i915_gem_ww_ctx_fini(&ww); atomic_dec(&i915->pending_fb_pin); if (ret) return ERR_PTR(ret); ``` On the success path, the counter is decremented immediately after pinning, = before the overlay is actually using the pinned buffer. This matches the st= ated intent ("just cover the actual pinning part") but means the `pending_f= b_pin` counter no longer reflects that a framebuffer is actively pinned for= display =E2=80=94 only that a pin operation is in-flight. The commit messa= ge acknowledges this change: "For some reason the overlay code kept the pen= ding_fb_pin counter elevated for longer than just for the pin, but from now= on it'll just cover the actual pinning part." This seems intentional but n= arrows the window where wedging would trigger. Whether that's acceptable de= pends on the actual deadlock scenario. **Minor concern in `intel_overlay.c` (display side):** The patch removes th= e `atomic_inc/dec` pair from the display overlay code (`intel_overlay_do_pu= t_image`), which previously wrapped both the pin call AND the rest of the o= verlay update. The `out_pin_section` error label is removed. This is fine s= ince the i915-specific `i915_overlay_pin_fb` now handles it internally. The rest of the `i915_fb_pin.c` and `i915_dpt.c` changes are mechanical s/d= isplay->restore.pending_fb_pin/i915->pending_fb_pin/ and look correct. --- Generated by Claude Code Patch Reviewer