{"id":2229230,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2229230/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260427221155.2144848-9-dakr@kernel.org/","project":{"id":28,"url":"http://patchwork.ozlabs.org/api/1.1/projects/28/?format=json","name":"Linux PCI development","link_name":"linux-pci","list_id":"linux-pci.vger.kernel.org","list_email":"linux-pci@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260427221155.2144848-9-dakr@kernel.org>","date":"2026-04-27T22:11:06","name":"[08/24] rust: auxiliary: implement Sync for Device<Bound>","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"dea6e8755bb38c71f4d76e08a0a076b1798d75ac","submitter":{"id":89037,"url":"http://patchwork.ozlabs.org/api/1.1/people/89037/?format=json","name":"Danilo Krummrich","email":"dakr@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-pci/patch/20260427221155.2144848-9-dakr@kernel.org/mbox/","series":[{"id":501733,"url":"http://patchwork.ozlabs.org/api/1.1/series/501733/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pci/list/?series=501733","date":"2026-04-27T22:10:58","name":"rust: device: Higher-Ranked Lifetime Types for device drivers","version":1,"mbox":"http://patchwork.ozlabs.org/series/501733/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2229230/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2229230/checks/","tags":{},"headers":{"Return-Path":"\n <linux-pci+bounces-53276-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pci@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256\n header.s=k20201202 header.b=hRAZBQDT;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=172.234.253.10; helo=sea.lore.kernel.org;\n envelope-from=linux-pci+bounces-53276-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=\"hRAZBQDT\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g4HxX2hKLz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 08:17:36 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 91B5E3068D7D\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 22:13:00 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id EE2353AC0C4;\n\tMon, 27 Apr 2026 22:12:58 +0000 (UTC)","from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org\n [10.30.226.201])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id C83D53A9630;\n\tMon, 27 Apr 2026 22:12:58 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 9A084C2BCB5;\n\tMon, 27 Apr 2026 22:12:52 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777327978; cv=none;\n b=HJSvEaZ1sN2mEOWugwTbLIAgEnMHXcZKSlNFXbRHPtALWEFRcN0cJHK0hmBwuqid14uO4Dx/l/g38sDpLCwrHbgtHI2jZ3SinMttq1wrCD1O9R0fk88UXRV0E7njUSV4fDVWAOQvsQ9mJZAY9mf7x5ZJf2ImeKI8TDqvAlgb7p8=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777327978; c=relaxed/simple;\n\tbh=yr8B+4rt/53Knez9GYsPy8kH5qdqBUAoWhXDtRNohr0=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=cPxKZpmkKVSDqvHQ4RUjAPcI1M4ausUzP+SAIaxRBP7k0iiCdS3nExTtAVmOnasf9yNi1hrxvbPbUDR2df1XU6cMWPfzXuPSN3Tpqqz+7ZIhwD5TQWENfosnUHjuyOrpIFYRpOiDxaQT+RhA6TMSXlC/Myw1eEaSLLySwaEadqk=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.b=hRAZBQDT; arc=none smtp.client-ip=10.30.226.201","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;\n\ts=k20201202; t=1777327978;\n\tbh=yr8B+4rt/53Knez9GYsPy8kH5qdqBUAoWhXDtRNohr0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=hRAZBQDTvT3S9AqkGWDbTNPEVAS3MP3JPhQQKSCj97OAdzLxXMI+QvTq++4rkUYAl\n\t bSVaKBzRYrpVbi6cIHmQe1C2waWZlCuZEGiQd24otVcKb6RGENUB3iWiVqGdr5NVLo\n\t NjqGDR/Sp2EXEzzxsegbw0nJLCfhQKkauuxgMd9FGrndfiymSXpB6SgaH9vdenzpru\n\t bYpLWBukNn81mIqBXdkGZn9jNfV9Cn5m9/3jWj9qYgZ1UOhQ4xdxfDGk+sHbDbJyN6\n\t iDsKtyXXJZRT1vNrFU3I5Tw6WhyZxJigtrZGulBGYNHezHu2ZDIdjXTJ+4gkYQKpNI\n\t yfyrqVTAV7Jxg==","From":"Danilo Krummrich <dakr@kernel.org>","To":"gregkh@linuxfoundation.org,\n\trafael@kernel.org,\n\tacourbot@nvidia.com,\n\taliceryhl@google.com,\n\tdavid.m.ertman@intel.com,\n\tira.weiny@intel.com,\n\tleon@kernel.org,\n\tviresh.kumar@linaro.org,\n\tm.wilczynski@samsung.com,\n\tukleinek@kernel.org,\n\tbhelgaas@google.com,\n\tkwilczynski@kernel.org,\n\tabdiel.janulgue@gmail.com,\n\trobin.murphy@arm.com,\n\tmarkus.probst@posteo.de,\n\tojeda@kernel.org,\n\tboqun@kernel.org,\n\tgary@garyguo.net,\n\tbjorn3_gh@protonmail.com,\n\tlossin@kernel.org,\n\ta.hindborg@kernel.org,\n\ttmgross@umich.edu","Cc":"driver-core@lists.linux.dev,\n\tlinux-kernel@vger.kernel.org,\n\tnova-gpu@lists.linux.dev,\n\tdri-devel@lists.freedesktop.org,\n\tlinux-pm@vger.kernel.org,\n\tlinux-pwm@vger.kernel.org,\n\tlinux-pci@vger.kernel.org,\n\trust-for-linux@vger.kernel.org,\n\tDanilo Krummrich <dakr@kernel.org>","Subject":"[PATCH 08/24] rust: auxiliary: implement Sync for Device<Bound>","Date":"Tue, 28 Apr 2026 00:11:06 +0200","Message-ID":"<20260427221155.2144848-9-dakr@kernel.org>","X-Mailer":"git-send-email 2.54.0","In-Reply-To":"<20260427221155.2144848-1-dakr@kernel.org>","References":"<20260427221155.2144848-1-dakr@kernel.org>","Precedence":"bulk","X-Mailing-List":"linux-pci@vger.kernel.org","List-Id":"<linux-pci.vger.kernel.org>","List-Subscribe":"<mailto:linux-pci+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pci+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit"},"content":"Device<Bound> uses the same underlying struct auxiliary_device as\nDevice<Normal>; Bound is a zero-sized type-state marker that does not\naffect thread safety.\n\nThis is needed for drivers to store &'a auxiliary::Device<Bound> in\ntheir HRT private data while remaining Send.\n\nSigned-off-by: Danilo Krummrich <dakr@kernel.org>\n---\n rust/kernel/auxiliary.rs | 4 ++++\n 1 file changed, 4 insertions(+)","diff":"diff --git a/rust/kernel/auxiliary.rs b/rust/kernel/auxiliary.rs\nindex 5cd10b254baf..8a278ddb5b95 100644\n--- a/rust/kernel/auxiliary.rs\n+++ b/rust/kernel/auxiliary.rs\n@@ -366,6 +366,10 @@ unsafe impl Send for Device {}\n // (i.e. `Device<Normal>) are thread safe.\n unsafe impl Sync for Device {}\n \n+// SAFETY: Same as `Device<Normal>` -- the underlying `struct auxiliary_device` is the same;\n+// `Bound` is a zero-sized type-state marker that does not affect thread safety.\n+unsafe impl Sync for Device<device::Bound> {}\n+\n /// Wrapper that stores a [`TypeId`] alongside the registration data for runtime type checking.\n #[repr(C)]\n #[pin_data]\n","prefixes":["08/24"]}