Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2165855lqt; Mon, 22 Apr 2024 03:32:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUdkxxKZ20P3zKbwqQJnCptrlx2QvxPY10Rrn4r7WcTwMvKC4zV9CFrFqbvZ43xIrcnEXRZRzMHRXH5Zj7+AkLazL4LAnAs2Fhf5Q9Ykg== X-Google-Smtp-Source: AGHT+IGykl/0fyl0+y6wqBlz1RFr6DQKlq6/6PusPjimiTKUFuJBvEpSP3OqK7xOSX4SYGh3z9N+ X-Received: by 2002:a05:6358:6a53:b0:17e:b78b:b223 with SMTP id c19-20020a0563586a5300b0017eb78bb223mr12998738rwh.5.1713781963009; Mon, 22 Apr 2024 03:32:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713781962; cv=pass; d=google.com; s=arc-20160816; b=h3Fw+x+jlrgePuDdlXXIaiFOilRQcUpRpQEYvzUkylZ2Cm7yTmyV4MnG4U3Emk6Q6o Cy/uS99s/2su19gAxuD3A+YpFYgb21XZKR8QuQqnjRFdcxn0JVEzpcJzpMSn0hix3MVe bJOkuMaZKEFRoYj62YnQ9dqmdVMGlSolRZLKvQsLpX1FvOGfLXTWHiCijB9AIFFp0Gub k7aCSx3w40ReoSVluyVplRSLDv+0SlfOpvpPce0qqW+5Saibw60BG+hsVhXXyT7MppAV btRmEmfIr65QwgZkh8zRtTL/suCRUjKV/E6O39R165NT1hEPeIQ1dWqAZ7Oznfcg3+fj Agaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tKvKShPD6e4jW0fEjFt1J89IUkhFZDroLQfz2r7xoxA=; fh=vnzy69f07IyaLjnc8AG5omV8Kh3KxpZhziO/UTRJOlI=; b=GSlBvh6znXPY5UFzN+xipR0IN3kQbOjUbNAdSkPaO1IrwLM9TF8uAuntJ66uxUMv8C TSU0Jp5WXgO2vcaiTbMTe6Ar0HmqKsENoFq1XAh3o/Xz4txRrFcdkl428xEAxKStjI6d y6Pi9W5LTftTd7TTnULXB8DNkaxg8ySZt3Y6v3BnYeNtvl4h4TtEtug/zrHHKNRHJdSA udgWbbvkVuztsMJL5GKm5R8LQ1CMrf6dY4FbucyIf7rLsuqaCnBTZQizlLYj68j6ekj/ s7C5eFeLGQfsxlslUFzCx2zKdGTglJpGYioWKqKLGu59WxB3U7rlAa1ZIjny5OdjIbMi +xcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ud7D1pak; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-153182-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153182-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id jl15-20020ad45e8f000000b006993eecb931si10392858qvb.601.2024.04.22.03.32.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 03:32:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153182-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ud7D1pak; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-153182-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153182-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B2D191C20E66 for ; Mon, 22 Apr 2024 10:32:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13FF1146003; Mon, 22 Apr 2024 10:30:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ud7D1pak" Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB5BD1442FC for ; Mon, 22 Apr 2024 10:30:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713781856; cv=none; b=A4kgPC3YbAtUhbtLhYiEpXTaJsTG9hROoVf6Pey1XW1Rf7hfJfKkFHWG4NcWrjXu9BRIfr3UzVR1jJxDUPgg7WXyhDZSDGP5pIatwc3jBbk8tp9U1pK2203O7pLi+70Ew3Ul9gnf/ABqtnnBhUIYJ7s2Ys8c0NYO5a14gLQywB8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713781856; c=relaxed/simple; bh=YeDcYif+zDkHv19iBPgDSKK6Yx0J30FDJC2BzwsHGkY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rLdm60lz/959N8zwYxS5DXjxtYqzf8NIJOqgqKlOkmZM2stgM4ksqKMGZpdBQPb4WMRlV7dgEA1Fzoo29+To8S138qMElw+Nk2BRXHbbuELicNx6FXzGXFObhEvJKmDu8mohmwbOqYvOSG8q1B19KgMUwMQ1OiTvNFLz7h+zhLM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ud7D1pak; arc=none smtp.client-ip=209.85.166.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-36b2adedec7so18044835ab.1 for ; Mon, 22 Apr 2024 03:30:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713781853; x=1714386653; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=tKvKShPD6e4jW0fEjFt1J89IUkhFZDroLQfz2r7xoxA=; b=ud7D1pakDx2PpC4Uc+Z0CyrKHAn2uMtkg6YCu9t3iBJvFGOWBU4FHUtVH50NHZaOwi EL3KId9U96GK/tNSD+Zlgw0zLGOSKfRq/UpQdBAFRwKqGTMbRsh/vBGYVcOleZhwMk9e KfN9g6mty39XsZDK7udlkXM1gE5L8Nu+wRcpatlWoGU0QvWqdYLvdFj+lzL7yTJLu0q+ jXDgr/wuyKamS40MAH30V15yz1R9yQpcySvn/MkS8DSWEzxojkVpC2l/1ZDtxn4bSEiK FzcLEJr2ea2c4AqyDAdzm5fQDI38QDQYyhOuio3qJseTzYxW3wpw4hOfWVfxgc6WQSE+ MBAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713781853; x=1714386653; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tKvKShPD6e4jW0fEjFt1J89IUkhFZDroLQfz2r7xoxA=; b=Bmv0vC//NocpeZRGfqHjfivwcL2IbDhCi1cCbAq6oQ8RRE95Wofb92XSzaYM76gZBP S+bnrmH4DFPowIv4qConPuUCPnHbb8m8qPeO3IBLEYpwYCkZETG88gIubv5umxJXlCE1 dIWsX59yjZg6UyX5jqY2s2Phnlap1bfV8uBN+YU+Gz47OU0XoJXz6jLU9v5MU6on49ww suNqzLW4oJatJQmfRGgtJFvm1PHPcrXz/BXJZKceHCm0H33oE/zdyrWnogRxKqHnxyro EDPwqH4zJt/UYFnSepG6MgR/cD/cA76de18Tur8E27MNXZrcSpQIz7eNAolv0VX8Htc8 1mPA== X-Forwarded-Encrypted: i=1; AJvYcCWmb+q7hbGMC6A7XuYdxxr60azZwk1QZd4SCvru9kS+ZS5EaeqzxvqbQE45A/qnx2bQrdqpcfhmBOLjCO5SWTL9ZTIa+tVWcCO+/D6d X-Gm-Message-State: AOJu0Ywl21m4Q58C48BT+BF4B/Ffw6GdvSPgujNbFA0KkgWcnb1+yddg t01XjUEmPOG6u2hcG53VCk/DUTJXUmd+gBvA+0TaAnbAnbyzq7ujNTAiZa3odak= X-Received: by 2002:a05:6e02:1848:b0:368:9799:fc30 with SMTP id b8-20020a056e02184800b003689799fc30mr13356900ilv.17.1713781852752; Mon, 22 Apr 2024 03:30:52 -0700 (PDT) Received: from localhost ([122.172.87.52]) by smtp.gmail.com with ESMTPSA id u3-20020a631403000000b005bdbe9a597fsm7366083pgl.57.2024.04.22.03.30.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 03:30:52 -0700 (PDT) Date: Mon, 22 Apr 2024 16:00:50 +0530 From: Viresh Kumar To: Benno Lossin Cc: "Rafael J. Wysocki" , Miguel Ojeda , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?B?QmrDtnJu?= Roy Baron , Andreas Hindborg , Alice Ryhl , linux-pm@vger.kernel.org, Vincent Guittot , Stephen Boyd , Nishanth Menon , rust-for-linux@vger.kernel.org, Manos Pitsidianakis , Erik Schilling , Alex =?utf-8?Q?Benn=C3=A9e?= , Joakim Bech , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 3/3] cpufreq: Add Rust based cpufreq-dt driver Message-ID: <20240422103050.tiecvamrd5upunou@vireshk-i7> References: <1792467a772b7a8355c6d0cb0cbacfbffff08afd.1712314032.git.viresh.kumar@linaro.org> <4ff5f30b-f2b8-4625-b3cd-ac08e4ffb068@proton.me> <8c4f2053-acbc-4f4a-93de-18f149c80869@proton.me> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8c4f2053-acbc-4f4a-93de-18f149c80869@proton.me> On 07-04-24, 10:17, Benno Lossin wrote: > On 07.04.24 11:54, Benno Lossin wrote: > > On 05.04.24 13:09, Viresh Kumar wrote: > >> +// Finds exact supply name from the OF node. > >> +fn find_supply_name_exact(np: *mut bindings::device_node, name: &str) -> Option { > >> + let sname = CString::try_from_fmt(fmt!("{}-supply", name)).ok()?; > >> + > >> + // SAFETY: The OF node is guaranteed by the C code to be valid. > >> + let pp = unsafe { bindings::of_find_property(np, sname.as_ptr() as *mut _, ptr::null_mut()) }; > > > > Drivers should avoid calling `unsafe` code as much as possible. They > > also should not be calling `bindings` code directly. Please write (or > > find) abstractions for these `unsafe` calls. > > Having re-read the cover letter, I see that you are already aware of > this. If you need any help with creating the abstractions, feel free to > reach out! Thanks Benno. I am not sure what's the right approach here as there are so many missing things (frameworks) I need. Though I don't need full support for them but just a handful of APIs. And then there is dependency on the generic support for device/driver, platform device/driver, etc. -- viresh