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: clk: implement Send and Sync Date: Tue, 24 Feb 2026 10:11:35 +1000 Message-ID: In-Reply-To: <20260223-clk-send-sync-v5-1-181bf2f35652@google.com> References: <20260223-clk-send-sync-v5-0-181bf2f35652@google.com> <20260223-clk-send-sync-v5-1-181bf2f35652@google.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review > + // SAFETY: It is safe to call `clk_put` on another thread than where `clk_get` was called. > + unsafe impl Send for Clk {} > + > + // SAFETY: It is safe to call any combination of the `&self` methods in parallel, as the > + // methods are synchronized internally. > + unsafe impl Sync for Clk {} The safety comments are accurate. The `Clk` type wraps a `*mut bindings::clk`, which prevents auto-derivation of `Send`/`Sync`. The C clock framework's `clk_prepare`/`clk_enable`/`clk_disable`/`clk_unprepare`/`clk_get_rate`/`clk_set_rate` operations all use internal locking (prepare_lock mutex and enable_lock spinlock), making concurrent `&self` access safe. One minor observation: `OptionalClk` is defined as `pub struct OptionalClk(Clk)` and has no explicit `Send`/`Sync` impls. It will correctly auto-derive both traits from `Clk` after this patch. This is fine and requires no changes. No issues found. --- Generated by Claude Code Patch Reviewer