From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: driver core: count references of the platform device's fwnode, not OF node Date: Mon, 25 May 2026 20:33:06 +1000 Message-ID: In-Reply-To: <20260521-pdev-fwnode-ref-v1-0-88c324a1b8d2@oss.qualcomm.com> References: <20260521-pdev-fwnode-ref-v1-0-88c324a1b8d2@oss.qualcomm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Overall Series Review Subject: driver core: count references of the platform device's fwnode, not OF node Author: Bartosz Golaszewski Patches: 26 Reviewed: 2026-05-25T20:33:06.580208 --- This is a well-structured 23-patch series from Bartosz Golaszewski that addresses a real architectural gap in platform device firmware node refcounting. The series follows a sound methodology: 1. **Patches 1-5**: Fix existing refcount bugs where `of_node_get()` was missing 2. **Patches 6-8**: Introduce three new helper functions (`platform_device_set_of_node()`, `platform_device_set_fwnode()`, `platform_device_set_of_node_from_dev()`) 3. **Patches 9-22**: Convert all in-tree callers to use the new helpers 4. **Patch 23**: Switch from OF-only refcounting to generic fwnode refcounting The overall design is correct. The key insight is that `platform_device_release()` currently only calls `of_node_put()`, so non-OF fwnode handles (software nodes, ACPI nodes) were never refcounted through the platform device lifecycle. By funneling all assignments through helpers first, patch 23 can atomically switch to `fwnode_handle_get()`/`fwnode_handle_put()` without breaking any caller. The series is a prerequisite for unifying the release path for dynamic platform devices with unmanaged software nodes, which is a worthwhile goal. **One concern**: The series depends on a function `dev_assign_of_node_reused()` (used in patch 23's `platform_device_register_full()` change) that does not exist in the current drm-next tree. This is presumably introduced in a companion series or different base. This should be clarified. **DRM-specific impact**: Only patch 18 touches DRM code (`drivers/gpu/drm/xe/xe_i2c.c`), and it's a trivial mechanical conversion. Low risk for the DRM subsystem. --- Generated by Claude Code Patch Reviewer