From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.208.45 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795802699; b=Rn9eRqwjmkYz0E9ITKLCiUgo1MZ2q/U308S3GtGDSHD4xZac7KeOjhV5KVhypUssMV2C vlQ+DO7sV336Emfuye3GoV4SlVTwlzvV2hTc8vNMNnMNx3uhG+YWYc6MAXCKDFABp+a6G aZgQDlQCHi33ME9AJtMnmjC6kajZE5ybqJWuXq29dttztHgA4xA+jbyoIsP/o/xOGaOVB 8Y92PHGCv3D6pwOZOWHuVtQrP5Aiu9qOAxFZL3f5V6wepyLXC0sucE0SY3ZA063eYaGmT 4cQeq3uCFo5lExKBKmnyZMMz3NSVgdMoa6qbap41HjELGfaGbp0HNV/ycmeY/VZFrvA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795802699; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: MIME-Version:Content-Type:Content-Transfer-Encoding:Subject:From:To: Cc:In-Reply-To:References:Date:Message-Id:X-Mailer: X-Developer-Signature:X-Developer-Key; bh=RqlkJ/I+EH0yMfrfHVvBSdwYQQPjzHS4s9eY4ppBylg=; b=iY5dRsxTtlaEDwdA7J0EYgHVpHzRCSO3nSKYTEyJ4uWlwqym+TiD2P6Au6epaRMCn86p xdMeAcRkD+ng1MxJvpxSzpgrQI9047XXgmjYGwiXQ7Trjg3XN7Vtr1MI0Bf2rMlr63KEG 4apbtFKTs4PcmQ+rmk0Y3OpHkWY4pilX0JoShxFWqhfs87/q2lYzLwAAClW7UF0vLUxiO ikBnw/RCB14Q+wovWKtV8a503xD3uDmL4NcwfeeMsIWpgD8PrSOkGnPA9jDoDlDv3tdBV Bbvb0doGFMSEnN34RarlMX6JX5iKxeT2S50cXsyIp7/sgRDfRHCtPKTZmTsYMF0aSjg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass header.d=baylibre.com header.i=@baylibre.com header.a=rsa-sha256 header.s=google header.b=Iy9+aEIQ; arc=none smtp.remote-ip=209.85.208.45 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 657EF606A326 for ; Fri, 27 Nov 2026 18:04:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 657EF606A326 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.a=rsa-sha256 header.s=google header.b=Iy9+aEIQ Received: by mail-ed1-f45.google.com with SMTP id 4fb4d7f45d1cf-6a642495d81so13047986a12.2 for ; Fri, 27 Nov 2026 10:04:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1795802697; x=1796407497; darn=vger.kernel.org; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:content-type:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=RqlkJ/I+EH0yMfrfHVvBSdwYQQPjzHS4s9eY4ppBylg=; b=Iy9+aEIQ/sKkgpla/Kw3npoC6iqmm4ymf2V9QCMEc3ojxV5crKQVO3j0cnHzP3E4zH VDe45YUOG1Ojd2XuSLfQhsZ/2uHqVH+fPlScXcw0cEB3Nv0u5aj9MjxEAT/MUUc5qpvH aW75lYxib8O/r48eqz5Nytk6Sr+3trLin+yzkvuRTo0Mf4tmY3pPTf8F5WbsHohWx5zo 9XcqlXTnJZ9oYO1CfvignZLNzJtpP1K14ziis2ygXPr6wcSm14s04ME6oU6iLXEXA980 3zhsdRAkRDcGZS4e3vsRjAiXzxgoVGFLbHwvcr2gcstiPxxpSggocz02Qboy11izNIlH NXdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795802697; x=1796407497; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:content-type:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=RqlkJ/I+EH0yMfrfHVvBSdwYQQPjzHS4s9eY4ppBylg=; b=enF9cP0rgdRmDH+gDI8hebxmjO8RpsJmodx78LmGmxPHzT71SkqCTxj73V3jGrLsGL 7WA0yKvMJsegFWEE68vc1rT5Jtjea/Pbo1b/cVFMLqivueBg+W9fOvFfbTCk15eTohHW Jg8PlXHfwLrW57QQH+MPLeQ/0Fh5h9B954AB66EYYy5kySL/+63+VCtM989TWO5YkxNj VX9sQDyXI0X7Yk+GxjXYrFyoMHauKs3+oESoCYSNpGp7otAK3zvmOgeftOVW7RBrDjgD ZCIpWVTJG7MXz1OhIoS/VUGS4efnWDWOF+l/RGFK3ZzvfXt4Os569NEWs2EniBPDKIzb 8pCQ== X-Forwarded-Encrypted: i=1; AL+hErECEXdzBqgTjhpWQBf8q+2CKY8FWOEZP24iIHlD4fTeVtBtBOoYI0XHGh0zwaTauroSDR2IO5qJAExylsQ=@vger.kernel.org X-Gm-Message-State: APuU4Z/P/0wBfTP+qIvSyn+ou+E1HMMCV1rCV3Gg73R4Tz0HJ9m3Rgsw t4bC8PbDdqI/9NeGBR3HE3VvhoJzT5iPscmJALBoSY8rBWfrg7BOJMza/FuFSEhIt5M= X-Gm-Gg: AZFdTZfoD8mEA51oqRQ3GQwbWCcF0ONwEMQ596sWcUu8UavaDUwqFGaLkocc5OClo2Q qdQ2NpHTbbWXucRnGzZWE/abbtJN4F/asYvG27baeC05K4vfokJr374RoHmsQP3XEdue50gVJGM QiqiHSGcudnZ1ntW/4TFqFJnQZSKsGYz7oGRDFjSr2RJv0jrQGgRMdm14aLRD0uA6JYUJBDQpzz hJbv+oA7HqvQEugUj0a6GCffnP24GAcACk6NdmklHJkgR2iirYviP3wuNxLy84KU3QJteP3wbGT 0qAE9KmGO79hU+bZSQ9LqzIFvgMyU0oiysib399Mh1nwMeP8yQtZ3SLsq/YJuWSnwABOX3v7ND1 EB6YoqO4M9eSaX/GcmGOMVxF+CpnjeiJO6U9TxOLV6kpRU98Zxw9H4IFhXJ4G89wZatGcAgr1Er /nnCm6TCPF4xQWIKONH6iCXUK4D/P6FG+KpuuF5R/aixIfgrz278RvIb/XbFlwApcHD899e+xvp v5yv8dKnMUfBWZjY5TbmyUDiV8j4JbDkMO5vS+DBM1gzqRXhBfuP6WmOaVvk7T2fRd5Cd6Y4767 BDcATpkzk5nFWZ8cdAEKELC7EnsuifRmozYkkXirBI2b3FIJ X-Received: by 2002:aa7:d94b:0:b0:6b7:df0c:18bc with SMTP id 4fb4d7f45d1cf-6ba37d3b56bmr13992034a12.17.1795802696609; Fri, 27 Nov 2026 10:04:56 -0800 (PST) Received: from localhost (82-67-6-57.subs.proxad.net. [82.67.6.57]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6ba9b131d3bsm8376099a12.34.2026.11.27.10.04.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2026 10:04:55 -0800 (PST) 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: 8bit Subject: Re: [PATCH v6 5/7] rust: clk: add devres-managed clks From: Jerome Brunet To: Daniel Almeida Cc: Gary Guo , "Rafael J. Wysocki" , Viresh Kumar , Danilo Krummrich , 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 , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Trevor Gross , Tamir Duberstein , Alexandre Courbot , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-riscv@lists.infradead.org, linux-pwm@vger.kernel.org, linux-clk@vger.kernel.org, rust-for-linux@vger.kernel.org, Boris Brezillon , =?utf-8?q?Onur_=C3=96zkan?= , Maurice Hieronymus , Jerome Brunet In-Reply-To: <189F36A9-D1C1-478A-A195-F94D037E4376@collabora.com> References: <20261013-clk-type-state-v6-0-a5e9977b3509@collabora.com> <20261013-clk-type-state-v6-5-a5e9977b3509@collabora.com> <189F36A9-D1C1-478A-A195-F94D037E4376@collabora.com> Date: Fri, 27 Nov 2026 19:04:53 +0100 Message-Id: <179580269373.2809466.3866997464599192193.b4-reply@b4> X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1455; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=EVdcrIGg5JsCx0X3upJdG2WoVOOBbQm+FMplR+16eVc=; b=owGbwMvMwCW2VtK+WnvWU3HG02pJDNmcx1wf2nxO/vlS7391p4r88j3CD8rvTtqo+zJHx/l4O F/jc7mfHaUsDGJcDLJiiiw13NXi7yS1vsyarnMbZg4rE8gQBi5OAZiImTYjwzur9Ptm8U6ip4rk vVaFZW/7m3dS40HhpwtLzNJM1yWbmDP8s+KdsNvXYe+JLxfuuvhc1WqSbtuQczJ5c3eeFEuIet0 GNgA= X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 On 2026-11-18 11:47 -0300, Daniel Almeida wrote: > > > > On 18 Nov 2026, at 11:24, Gary Guo wrote: > > > > On Tue Oct 13, 2026 at 6:07 PM BST, Daniel Almeida wrote: > >> Many drivers only need a clock running for as long as the device is > >> bound and never touch it afterwards. In C, devm_clk_get_enabled() and > >> devm_clk_get_optional_enabled() cover this case. > >> > >> Add devm_enable(), devm_enable_optional() and > >> devm_enable_optional_with_rate(), which wrap the C helpers. They return > >> no handle, so the driver keeps nothing in its data and cannot change the > >> state of the clock. The clock is disabled, unprepared and put when the > >> device is unbound. > >> > >> This mirrors regulator::devm_enable() and devm_enable_optional(). > >> > >> Reviewed-by: Alexandre Courbot > >> Signed-off-by: Daniel Almeida > > > > Given all the device resource lifetime changes, do we still need this now, or > > would putting a guard in driver private data to be dropped automatically upon > > unbind be sufficient? > > I think we should still provide this. Many drivers only care that the clock be > enabled at a given rate, and do not care about the handle. I think this has > little to do with C or Rust and should be supported in Rust too. > > — Daniel Gary, is this OK with you ? if it is, I can take as it is. -- Jerome