{"id":2229225,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2229225/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pwm/patch/20260427221155.2144848-8-dakr@kernel.org/","project":{"id":38,"url":"http://patchwork.ozlabs.org/api/1.1/projects/38/?format=json","name":"Linux PWM development","link_name":"linux-pwm","list_id":"linux-pwm.vger.kernel.org","list_email":"linux-pwm@vger.kernel.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260427221155.2144848-8-dakr@kernel.org>","date":"2026-04-27T22:11:05","name":"[07/24] rust: platform: implement Sync for Device<Bound>","commit_ref":null,"pull_url":null,"state":"handled-elsewhere","archived":false,"hash":"03df72829f56a94a7b6d231a6ff1c7b56807e136","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-pwm/patch/20260427221155.2144848-8-dakr@kernel.org/mbox/","series":[{"id":501734,"url":"http://patchwork.ozlabs.org/api/1.1/series/501734/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-pwm/list/?series=501734","date":"2026-04-27T22:10:58","name":"rust: device: Higher-Ranked Lifetime Types for device drivers","version":1,"mbox":"http://patchwork.ozlabs.org/series/501734/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2229225/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2229225/checks/","tags":{},"headers":{"Return-Path":"\n <linux-pwm+bounces-8710-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-pwm@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=fhs4XRkL;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-pwm+bounces-8710-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=\"fhs4XRkL\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=10.30.226.201"],"Received":["from sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::12fc:5321])\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 4g4Hwh2hGrz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 08:16:52 +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 4B3FE30530CE\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 22:12:53 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id AC7413AB283;\n\tMon, 27 Apr 2026 22:12:52 +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 87F0C3793BB;\n\tMon, 27 Apr 2026 22:12:52 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 4FDFDC19425;\n\tMon, 27 Apr 2026 22:12:46 +0000 (UTC)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1777327972; cv=none;\n b=LNI7Mwt8YiLXTErZ3nNoZWk2D2DOtmSrHpGVPTRimpsRBm76W21RB2ujPmfeooeZn9po+aC5aZw3FUqtLS+oOFbwElmd2ldREjkwMRprJwnVaWkWA7O2AS+sdz4J6Ah5ZaoOfM/3jYb3Z2YjjtK3hlEk23T+NAq6dYaIGKmoZzw=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1777327972; c=relaxed/simple;\n\tbh=ZL0zZCof376hKMo9gCVpVeB8x9AGCrUGR4sSsGtHfmE=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=eNXzx/f/IATUdoCQGba8IUCGKoaX4IXICDxR0v4RXfz/6XGs/pC8OesGvjfdA6RJ48aqfP2UolqcG9pk9i6xxepFHPb43oEULySTCIfBxF8tMHB1+eFN/4B5DY12OGZWJgELqkRqo9Qy3rFqiFvBc9ZpBrN22RpMF9+JFdq2NCs=","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=fhs4XRkL; 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=1777327972;\n\tbh=ZL0zZCof376hKMo9gCVpVeB8x9AGCrUGR4sSsGtHfmE=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=fhs4XRkLdj6f/yxZNfHY6NuvcXE6SzB2cRVRxBtKOZ+l1bM47Btenuklj8PnO7Euf\n\t khfDpJdzT032Ikvv4at1RhXzxCH+/+1Uvn3f7KoeMRwvTKb+zkfMZUb7u1o/pCbF0d\n\t /dEr7ZJPu53xD9cenRMXcnCj8FI+xI+R4kKbUj6YbyPkIH9SsuNQaDDYtB7ifcWCS0\n\t gGzh7PfW+xelHhV9gbUUJTnsKh7Zt0j6wVOd87hRgmZwoLvA/OLNIh+TCTHjl8t+Cx\n\t /C5H5XJL/M7py5KzI5XsYcqHQpa4xfxahE7QsRiLg7qI+JtkTIyO5t2GIE48cKwSEh\n\t hsBF0GHxBhvdA==","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 07/24] rust: platform: implement Sync for Device<Bound>","Date":"Tue, 28 Apr 2026 00:11:05 +0200","Message-ID":"<20260427221155.2144848-8-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-pwm@vger.kernel.org","List-Id":"<linux-pwm.vger.kernel.org>","List-Subscribe":"<mailto:linux-pwm+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-pwm+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit"},"content":"Device<Bound> uses the same underlying struct platform_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 platform::Device<Bound> in their\nHRT private data while remaining Send.\n\nSigned-off-by: Danilo Krummrich <dakr@kernel.org>\n---\n rust/kernel/platform.rs | 4 ++++\n 1 file changed, 4 insertions(+)","diff":"diff --git a/rust/kernel/platform.rs b/rust/kernel/platform.rs\nindex 1585b6a1ac45..ae648304eb5b 100644\n--- a/rust/kernel/platform.rs\n+++ b/rust/kernel/platform.rs\n@@ -564,3 +564,7 @@ unsafe impl Send for Device {}\n // SAFETY: `Device` can be shared among threads because all methods of `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 platform_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","prefixes":["07/24"]}