From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 72DE121883E; Wed, 11 Feb 2026 16:47:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770828437; cv=none; b=cC90v+7DYBj5yKSTFsxsbmGT3f6YwgmI4qU+tl4gJHD0cbjwhV7u9RzhOL8MsL6gVF20aIwaxpTYtaqmLLg1u1baOeSC+MuYWAz6TyjWlwQF8c1HPGUnTBz+IiQB5y2IL9Q5yxCvVjGl/3pY5O1v7PhWMKFb1C909mA3vsObx3Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770828437; c=relaxed/simple; bh=Axd6+FAx+svU01taZF9dBwsFOMn//n4UUyQCxOZzxLE=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:To:From:Subject: References:In-Reply-To; b=bCZWXqyeC5LHibBmCwZ+ZnOSy9lxf/SjP21/Adyplvn4KCQx1ZC89qmDzfr1/Aya7mZzuUeIcAmiYm685Rz9tEFqZRzS6gBbztyYY6xP2OnPKU5GNuC99Phgjs64nvNL1q/6yXfitFBkY2rAl6fAIRmeYdINj39sjTl6CerBRMQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HD0OiU/X; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HD0OiU/X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B434C4CEF7; Wed, 11 Feb 2026 16:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770828437; bh=Axd6+FAx+svU01taZF9dBwsFOMn//n4UUyQCxOZzxLE=; h=Date:Cc:To:From:Subject:References:In-Reply-To:From; b=HD0OiU/X9XdxIPhqSht4yMAhClrCU0+gnVun0CaAq5Yb9HV7dl3p8e2GOuzP81AKF LjXvjZqzFdaux5+yWWAZsZ5CqvQqa6Ab+c99OfMXICjFS3xCHxzgWrR2iSI5CqvZt+ F8nVhOZTY8JCg42YOpMEXhZ5+3qYBGKaAM8OJvKHaTfEw4H0N5K6GQ37DacuCQs+sN Yxah6cvl7+np9/YZHGg/IMr+itaSy5o5Ve4aiV0tSw+3DE+wpnfRoVaye1PMmcPa7K WMlcMazd4fO80Pw3fNwBlK0HRNFHEHdmBgVbHVme1p+R2iaqooeeLy9/wuBwK+9tAE S0nGTPkw+HslQ== Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 11 Feb 2026 17:47:09 +0100 Message-Id: Cc: "Boris Brezillon" , "Daniel Almeida" , "Alice Ryhl" , "Rafael J. Wysocki" , "Viresh Kumar" , "Maarten Lankhorst" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" , "Drew Fustini" , "Guo Ren" , "Fu Wei" , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , "Michael Turquette" , "Stephen Boyd" , "Miguel Ojeda" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Trevor Gross" , , , , , , , To: "Maxime Ripard" From: "Danilo Krummrich" Subject: Re: [PATCH v3 1/3] rust: clk: use the type-state pattern References: <518D8B09-B9A1-4DB4-85CD-37A2DD3D5FB1@collabora.com> <20260119-weightless-pelican-of-anger-190db0@houat> <20260122-majestic-masterful-jaguarundi-d0abde@houat> <2F3D3A40-6EF9-46FC-A769-E5A3AAF67E65@collabora.com> <20260204-nickel-seal-of-poetry-8fdefb@houat> <91A92D84-1F2E-45F3-82EC-6A97D32E2A78@collabora.com> <20260204-angelic-vermilion-beagle-fd1507@houat> <20260209105047.693f2515@fedora> <20260211-flawless-feathered-boar-0b87ad@houat> In-Reply-To: <20260211-flawless-feathered-boar-0b87ad@houat> On Wed Feb 11, 2026 at 5:37 PM CET, Maxime Ripard wrote: > I do think we can find a compromise though. Miguel suggested for example > to make the current enable/prepare/disable/unprepare function unsafe, > and that's totally reasonable to me. > > Then we can implement the "managed" clock version on that unsafe API, What do you mean with "managed" clock? Do you mean devres managed? If so, I don't think there is any reason to switch to the unsafe API to be able to implement devres managed APIs (see also [1]). [1] https://lore.kernel.org/all/DFVW9MS5YLON.CVJDBYQKJ0P6@kernel.org/ > and we would end up with a "raw", unsafe, version kind of equivalent to > the one we have today, and where callers would have to justify why their > usage of the API is actually safe, or the new, managed, variant that is > safe and can be easily used by most drivers. > > And we can call these RawClk vs Clk, or Clk vs ManagedClk, or whatever. > > How does that sound? What about we just wait until we have a user that really requires an unsafe= API for some reason? And if it never appears, even better. :)