From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.180.11 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795709187; b=KLrpgkEqOvHuyNRJju/2nHPN+9iPSD1B3s2BsnUMtkal3T4vk5NMeZAIe7eOZheM38RK IfBCDvSyStB61PEuVyKAKNwgQZnRatMiiZU6gMaMikBHfEeLR5hGdkRDzPk+ayv+i97N2 rhLNp4CfHCXgjKlTcfTSn6ivLxA/N//lDw5HxFmn6gTKdPIXO6zcA/BxLD4oRnZFrDMGc lDnETfkwivRB157V7PKOrzDSObDTYMJ+HouSd2K3l56Cw5QWmTb/Ic+Iwjzh6ibQSnOaY hWCdzbJtQ07Hcz7hxjUojo561MxlKgccjvmkIJtzJzukDo6syms8Y8GAzivgZ5VK22g== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795709187; h=DMARC-Filter:DKIM-Signature:Received:From:Subject:Date:Message-Id: MIME-Version:Content-Type:Content-Transfer-Encoding:X-B4-Tracking: X-Change-ID:To:Cc:X-Mailer:X-ZohoMailClient; bh=Yyxvp9gohrAV1EarHFGlcgh89ssvG83TzXCqeBFpj4U=; b=q8dGYRCT6Ox/rZxCW0h8+N3OkcHe89qY7EEIO8YxtIiIkR6JtMUkrK7qjzb8/uDjVl3v bNrzmH1LxYFhDtAnsTMbB+4x4FKYq1IHei78GoQgNi06+/8Uwn9F0DGcJFmHzykH9R6PT 5upkZssiql+z77VU/T9ntESQJsYw47X61dObUs0Z8FGZrbiSuz2yFprPhjmUjr50l0TLf 3KJNlQv24Se+7o/X5PZQ8ExLEjlKd7QeCipzEl3T2vNgmESKrE9Ueb0IOOVyunFY2kcUv eSbv+T9bVhbGk4ycfg7BKe1HYHnuaarTnmQT6ES/EPCshLyzmLsTcwrNYieHJbL8sHA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=collabora.com; spf=pass smtp.mailfrom=collabora.com; dkim=pass header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b="NBrMf/dm"; arc=pass header.oldest-pass=0 smtp.remote-ip=165.173.180.11 Received: from sender6-op-o11.zoho.com (sender6-op-o11.zoho.com [165.173.180.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32CD9606A31E; Thu, 26 Nov 2026 16:06:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 32CD9606A31E Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=collabora.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=collabora.com header.i=@collabora.com header.a=rsa-sha256 header.s=zohomail header.b=NBrMf/dm ARC-Seal: i=1; a=rsa-sha256; t=1795709083; cv=none; d=zohomail.com; s=zohoarc; b=dkJV7LWKL/rZZMifblFI3iCphtTkx+fEJC+IYutOU4ksPsVlF/CvwEgGGge5jW0L9BLXexsY8AYbv3A4y21/KuWx+4EEH+Wh5ywXjnxdY6lv1iphANFotiC1rEPRgVWOjf28qGJ6Z+/NoOkJ6c7lD+1WYLeuyvYJj18FxXV7Jhg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1795709083; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=Yyxvp9gohrAV1EarHFGlcgh89ssvG83TzXCqeBFpj4U=; b=AMeh4Q/vGnEw1/zv6Al+LJMiYgPAQ4jQChp/aUy+ugDf2s1lV2r0S6uaWfL5130FdSG1liop+D366m45n7+TGttvOSxg/Ji4gLLMMpOX62BChi+MiewHU9hGyVkyaZ3Hnm+CM7yQeuCx+QFZLxVPSXyS+SF6CnPkKwdtBxrvKcE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=collabora.com; spf=pass smtp.mailfrom=daniel.almeida@collabora.com; dmarc=pass header.from= DKIM-Signature: a=rsa-sha256; b=NBrMf/dmCTCdveLaejZVhlg9ZJ+EIoVWEWcG9jUkq4rGeduhUdLpVpYguOgHIeEN5bhzU0OpFK28lHJOELqdNon1Nb5MURF5whDZpwQtzC8JgTxyW0BxiRsqCFPnFGaKpGGIS+JYRuxff6XdLmh5umWCCasMM/gw+wSPPdrwc7g=; c=relaxed/relaxed; s=zohomail; d=collabora.com; v=1; bh=Yyxvp9gohrAV1EarHFGlcgh89ssvG83TzXCqeBFpj4U=; h=Content-Description:Content-ID:Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Resent-Sender:Resent-Cc:Resent-Date:Resent-To:Reply-To:Resent-Message-ID:Resent-From:Sender:Subject:To:Date:From:Message-Id:Reply-To:Subject:To:Cc; Received: by smtp.zohomail.com with SMTPS id 1795709079389205.15445158410614; Thu, 26 Nov 2026 08:04:39 -0800 (PST) From: Daniel Almeida Subject: [PATCH 0/7] rust: reset: add reset control abstractions Date: Thu, 26 Nov 2026 13:04:27 -0300 Message-Id: <20261126-b4-rust-reset-v1-0-9c4c3d029080@collabora.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yXMOw6DMBBF0a2gqTMS5uOCrSAKY17CUACaMVEkx N7jkPIU955kUIFRV5ykeIvJtma4R0FxDusLLFM2VWXlnXM1jw3rYYkVhsQxtBNi8ChrT7nZFU/ 53L9++NuOcUFMvwld1xfvTouCcQAAAA== X-Change-ID: 20261113-b4-rust-reset-ca5deca6e036 To: Miguel Ojeda , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , =?utf-8?q?Onur_=C3=96zkan?= , Philipp Zabel Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org, dri-devel@lists.freedesktop.org, Detlev Casanova , Nicolas Dufresne X-Mailer: b4 0.15.2 X-ZohoMailClient: External This series adds a Rust abstraction for the consumer side of the reset controller API. A driver can get the reset lines of its device, as an exclusive or a shared reset control, and assert and deassert them. This will be used by the upcoming rkvenc driver that my colleagues Detlev Casanova, Nicolas Dufresne and I are working on, to recover a hung core of the encoder without stopping the other one. More details on this driver can be found by watching Nicolas Dufresne's talk at LPC 2026 [0]. Samsung's Rust UFS RFC [1] also uses reset lines, through an abstraction that it has not posted. The abstraction follows the regulator abstraction and the clk series [2], with the reset state as a type parameter. Patch 1 adds the C helpers that patch 2 needs. Patch 2 adds ExclusiveResetControl, with the Unknown, Asserted and Deasserted states. Patch 3 adds ExclusiveResetControl::get_array() and get_array_optional(), which get all the reset lines of a device as one control. Patch 4 adds AssertedGuard, which asserts the line of an exclusive control in the Unknown state and deasserts it when dropped, as a convenience for drivers. Patch 5 adds SharedResetControl, with the Unknown and Deasserted states only, and patch 6 adds its array getters. Patch 7 adds ExclusiveResetControl::devm_deassert() and devm_deassert_optional(), for drivers that only need their line deasserted while they are bound. reset_control_reset(), the bulk API and the shared devm getters are not covered, and there is no guard for a Deasserted control or for a shared one. Nothing in the tree uses the abstraction yet. Patches 1 and 2 add the two new files to the RESET CONTROLLER FRAMEWORK entry of MAINTAINERS. Philipp, please let me know if you would rather have them elsewhere. This is based on v7.4-rc2. [0]: https://www.youtube.com/watch?v=75E15eHY7ac [1]: https://lore.kernel.org/r/20260912-rufs-private-v1-1-716db733e655@samsung.com [2]: https://lore.kernel.org/r/20261013-clk-type-state-v6-0-a5e9977b3509@collabora.com --- Daniel Almeida (7): rust: reset: add reset control helpers rust: reset: add ExclusiveResetControl rust: reset: add ExclusiveResetControl::get_array() and get_array_optional() rust: reset: add AssertedGuard rust: reset: add SharedResetControl rust: reset: add SharedResetControl::get_array() and get_array_optional() rust: reset: add devm_deassert() and devm_deassert_optional() MAINTAINERS | 2 + rust/bindings/bindings_helper.h | 1 + rust/helpers/helpers.c | 1 + rust/helpers/reset.c | 67 ++++ rust/kernel/lib.rs | 1 + rust/kernel/reset.rs | 870 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 942 insertions(+) --- base-commit: 7475ea8b58616b33c04afb976cf0fbaad9dd63fb change-id: 20261113-b4-rust-reset-ca5deca6e036 Best regards, -- Daniel Almeida