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: Tue, 26 May 2026 06:47:02 +1000 Message-ID: In-Reply-To: <20260525202921.124698-6-dakr@kernel.org> References: <20260525202921.124698-1-dakr@kernel.org> <20260525202921.124698-6-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 The critical C-side change that enables the entire series: ```c static void device_unbind_cleanup(struct device *dev) { - devres_release_all(dev); if (dev->driver->p_cb.post_unbind_rust) dev->driver->p_cb.post_unbind_rust(dev); + devres_release_all(dev); ``` The comment is updated from "Called after remove() and after all devres entries have been processed" to "Called after remove() but before devres entries are released." This reordering is sound because, as the commit message explains, the driver's bus device private data is only accessible by the owning driver itself (drvdata() having been removed). The Rust-side comment update: ```rust - // `remove()` and all devres callbacks have been completed at this point + // `remove()` has been completed at this point; devres resources are still valid ``` This is well-justified and has appropriate reviews from both the Rust and driver-core maintainers. ### PATCHES 6-10: implement Sync for Device\ (PCI, platform, auxiliary, USB, generic device) Five small patches, each adding: ```rust +unsafe impl Sync for Device {} ``` for their respective bus types. The SAFETY comments correctly note that `Bound` is a zero-sized type-state marker and the underlying C struct is the same as `Normal`. These are needed because drivers storing `&'bound Device` must be `Send`, which requires `Device: Sync`. Straightforward and correct. --- Generated by Claude Code Patch Reviewer