From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 8DAB1606A32C for ; Thu, 3 Dec 2026 16:16:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=cTg5p8Ad; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OykDBhRM DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:References:From:To:Cc: Subject:Message-Id:Date:Mime-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=5lvujxhavuC3u/egpKv4fMXbY9nAVj1l/mPhheoyphw=; b=cTg5p8Ad6lX7ku6Y7PNVKBeIBb fXovTb20aa6qMAMr9DkA7BRy1hlXP5k2keMGg/TC0a51WJVASCE8SS6zrbUvSdK6OqzJLAz/lCPv0 7FKuSrGcuhs3ExvsTlmxsZtLjoCzjE8vuNCVRcgFO2cpCkGrdvSHt4aFRM1HPsjzNZK+WlL1j4mcm /eNrGkdcTnj8cXAFHaSMTSRF8+8GLeS0N7MQ10KTUnsbKrTkK7i3pKBxNT0h1VyuVu3lFpIfiuCyl Jo6x+vlQvejNRU8RGc1G1NjlMsZ1cQFyd89oueMSvY4+3VImhB1SMrOX6lqnfPgUeW5JDhwn0DT82 McWrKl3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZ9TZ-0000000FFXC-0H1d; Thu, 03 Dec 2026 16:16:05 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZ9TX-0000000FFWv-1rsR for linux-riscv@lists.infradead.org; Thu, 03 Dec 2026 16:16:03 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id A57BB419B6; Thu, 3 Dec 2026 16:16:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D4DC1F00893; Thu, 3 Dec 2026 16:15:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796314560; bh=BY0PjJBer+mlbbOm6fMn5QZ63T9GB5DFeOnxZrFjAss=; h=Date:Subject:Cc:To:From:References:In-Reply-To; b=OykDBhRMcmwmBht0wNkSGjNj54MUDk51vQ7nPhPLuR8sKeYhXrCN0QIFx3lMI1SML +aYV6sktGqKBsyp+pKd8+9Ro/rlWqeS7fJW/giDj8LKze66vcJjYpuAmdBboLEI0Xz RtYCJd/MKFmfohxd09i8xshRyCGKGEq+keIflmuORO7BcwD3MEsPKt/8xBZdBg/PPG rwM9JCMv+zsFJ1hH+K3QC/cIiqfG6g4vtExUneLVb2xYH3x5VdV8vUv1p9rw6FomzX q9l/kXy+UdsU1JSiJMBmL6S+zrR9IKS3I7XWJrPVoJzMiVpLbIHfQrcnZRB1pHygKt kEa+ZaMJJEULA== X-Archived-By: Mime-Version: 1.0 Date: Thu, 03 Dec 2026 17:15:52 +0100 Message-Id: Subject: Re: [PATCH v6 0/7] Clk improvements Cc: "Rafael J. Wysocki" , "Viresh Kumar" , "Alice Ryhl" , "David Airlie" , "Simona Vetter" , "Michal Wilczynski" , "Drew Fustini" , "Guo Ren" , "Fu Wei" , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , "Stephen Boyd" , "Brian Masney" , "Jerome Brunet" , "Miguel Ojeda" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Trevor Gross" , "Tamir Duberstein" , "Alexandre Courbot" , , , , , , , , "Boris Brezillon" , =?utf-8?q?Onur_=C3=96zkan?= , "Maurice Hieronymus" To: "Daniel Almeida" From: "Danilo Krummrich" References: <20261013-clk-type-state-v6-0-a5e9977b3509@collabora.com> In-Reply-To: <20261013-clk-type-state-v6-0-a5e9977b3509@collabora.com> X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" X-Spam-Status: No, score=-8.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On Tue Oct 13, 2026 at 7:07 PM CEST, Daniel Almeida wrote: > This series contains a few improvements that simplify clock handling for > drivers. > > Patch 1 converts clk.rs to the kernel-vertical style for imports. > > Patch 2 replaces OptionalClk with Clk::get_optional(). There is no struct > optional_clk in C, and Clk already allows a NULL pointer. > > Patch 3 implements the same typestate pattern that has been used > successfully for Regulators. This is needed because otherwise drivers > will be responsible for unpreparing and disabling clocks themselves and > ultimately handling the reference counts on their own. This is > undesirable. The patch automatically encodes this information using the > type system so that no misuse can occur. > > Patch 4 adds guards that prepare and/or enable a clock for the lifetime > of the guard without consuming the Clk, so that a driver can keep a > long-lived Clk and enable it for scoped sections. > > Patch 5 makes things more convenient by offering devres-managed APIs. This > lets drivers set clock parameters once and forget about lifetime > management. > > Patch 6 adds ExclusiveClk, which holds rate exclusivity over a Clk > in any state until it is dropped. > > Patch 7 uses it in pwm-th1520 to lock the clock rate for the lifetime of > the driver data. Except for the devres one, Acked-by: Danilo Krummrich Constraining the driver facing types with the Device lifetime is fine for me to address in a follow up series. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv