From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: driver core: drop drvdata before devres release Date: Thu, 07 May 2026 13:02:03 +1000 Message-ID: In-Reply-To: <20260506215113.851360-2-dakr@kernel.org> References: <20260506215113.851360-1-dakr@kernel.org> <20260506215113.851360-2-dakr@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review This is the critical C-side change that enables everything else. Moving `post_unbind_rust` before `devres_release_all()` in `device_unbind_cleanup()` ensures the Rust driver's private data (which may hold references to devres-managed resources) is dropped while those resources are still alive. The change is small and clean. The comment update in `driver.h` correctly reflects the new ordering: ```c - * Called after remove() and after all devres entries have been - * processed. This is a Rust only callback. + * Called after remove() but before devres entries are released. + * This is a Rust only callback. ``` **Question:** Is there any existing C or Rust code that relies on devres having already been released when `post_unbind_rust` runs? The cover letter says this is only used by Rust, and the dependency series [1] would need to be checked. Since `post_unbind_rust` currently drops the Rust drvdata, and the drvdata was previously not allowed to reference devres resources (they were `'static`), the reordering should be safe for existing users. But this warrants explicit verification against the dependency series. No issues found. --- Generated by Claude Code Patch Reviewer