From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from flow2-smtp.messagingengine.com (flow2-smtp.messagingengine.com [103.168.172.137]) (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 3645916B752; Thu, 11 Jul 2024 16:34:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.137 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720715670; cv=none; b=Nzg2DmncZZG3jreyi0hEEZI521rKoCIi+jpuOst3606qyw7wY0hcQQNwTBEbWbyIJET16gOzs44idjPzd4M++zFQGy20usun1/YknLXXc5cYOFQx/GOOBUlBAyUeGmguJMKPZz3SfC5wx43UPH8CLZ/Juw5BVLYFH2z/Z84kCTw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720715670; c=relaxed/simple; bh=smbShI+Lu4YENO9SclMUBSefMZDkT3jPuDhhU7gUJWA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mLr7C0y5Wkzm5Drh5INl5Jy3XvAewXqxjtxgRjnXsC+k8WKJhCyOuKGWaIfpZM73a0X84YrJ/ZkoFmARH9j+36BWQCRgg4UixbaF8aUnmkjyMNzBHro2Z25QHaSZr+X69/muGmm1feXo5Ddb0suqMcykKzETwVWQFdw7UQ+m5sE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kroah.com; spf=pass smtp.mailfrom=kroah.com; dkim=pass (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b=kthwHN0P; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=FP/YKxpu; arc=none smtp.client-ip=103.168.172.137 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kroah.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kroah.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="kthwHN0P"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="FP/YKxpu" Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailflow.nyi.internal (Postfix) with ESMTP id 1EEF3200536; Thu, 11 Jul 2024 12:34:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 11 Jul 2024 12:34:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1720715667; x=1720722867; bh=fbai7xo9jC lg1MHdg/OPKg9usQQpTGfdoSS4TcKGfBY=; b=kthwHN0Pw8ta9M8XfrzzYaMkOE nTMTLOFla7IlMY1bMugg8KvPzldNQ7Tnw6n4HOxz+ZQXwZ+MASmF6uSiCuF0g286 sGB+NP/a84rMorwQdvbg2jECdznuve0OOvAIv1od7SevzOg8RQJ9jXasW/EgBYw1 ofeABA8+Jp36LkgIxqWxoFcCMfC1u7TT55DzWK2RmM8InaZ8H7TgpOR2TLgyTQOg UldD73Q6JJKwYO7NHgwyh0iG+vCbEsD2AJV50VBglF1v8FlgzwSS/V53hmitmEQX /+gNlprpFKkQjEnji2Y+eQInsU0jRBy+ut9kdmoXE8A9e+vILCF/Wz0X5myg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1720715667; x=1720722867; bh=fbai7xo9jClg1MHdg/OPKg9usQQp TGfdoSS4TcKGfBY=; b=FP/YKxpuBxO3Q5JpYLxvf6W2QplUNhPoeylSRgX4AIhJ vXXmncQzUUHeHPhN2Yk/2SzWCXySwZ52QPbqmx7kZ2lTDVc+R/p7sawmY4feKpXt Cy1LdFsRqSaY8OZyoPT4swTAFZ6og/m/m1tjW6O/BZMaCszxagwCDvmUor16+CwL 00z3Mpl0Bd/Samh6DyUlBXolQr1JooXLLQaJj9O8hO2CIpdlGD5HPWIE/2aPsKxh N/YUSzKSdgk1zpkkgJGKU8q9RRIzjkAon9QeoynvpqtOQ9RrBf+Oa2gNi/RifFHd uWZDgpZGeL2cOpaBnAsQn/pSEChFpp9PI0rionksUw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrfeeggddutdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepifhrvghg ucfmjfcuoehgrhgvgheskhhrohgrhhdrtghomheqnecuggftrfgrthhtvghrnhepfeevie ffgeeuffeikeejvdegtefhuddvjeelgfevtedtgfegieegleefudeljeeknecuffhomhgr ihhnpegsohhothhlihhnrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Feedback-ID: i787e41f1:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Jul 2024 12:34:24 -0400 (EDT) Date: Thu, 11 Jul 2024 18:34:22 +0200 From: Greg KH To: Danilo Krummrich Cc: Viresh Kumar , "Rafael J. Wysocki" , Miguel Ojeda , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , 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 =?iso-8859-1?Q?Benn=E9e?= , Joakim Bech , Rob Herring , linux-kernel@vger.kernel.org Subject: Re: [PATCH V4 8/8] cpufreq: Add Rust based cpufreq-dt driver Message-ID: <2024071111-negotiate-spoof-da94@gregkh> References: <20240711130802.vk7af6zd4um3b2cm@vireshk-i7> <2024071122-escargot-treadmill-6e9a@gregkh> Precedence: bulk X-Mailing-List: rust-for-linux@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: On Thu, Jul 11, 2024 at 06:12:08PM +0200, Danilo Krummrich wrote: > On Thu, Jul 11, 2024 at 04:37:50PM +0200, Greg KH wrote: > > On Thu, Jul 11, 2024 at 03:21:31PM +0200, Danilo Krummrich wrote: > > > (2) You require drivers to always implement a "dummy" struct platform_device, > > > there is platform_device_register_simple() for that purpose. > > > > No, NEVER do that. platform devices are only for real platform devices, > > do not abuse that interface any more than it already is. > > I thought we're talking about cases like [1] or [2], but please correct me if > those are considered abusing the platform bus as well. > > (Those drivers read the CPU OF nodes, instead of OF nodes that represent a > separate device.) > > [1] https://elixir.bootlin.com/linux/latest/source/drivers/cpuidle/cpuidle-riscv-sbi.c#L586 > [2] https://elixir.bootlin.com/linux/latest/source/drivers/cpuidle/cpuidle-psci.c#L441 Yes, these are abuses of that and should be virtual devices as they have nothing to do with the platform bus. > > > I think (2) is the preferred option. > > > > No, not at all, sorry. > > > > Use a real device, you have one somewhere that relates to this hardware, > > otherwise you aren't controlling anything and then you can use a virtual > > device. > > Of course we should stick to a real device if there is one, I didn't meant to > say anything else. > > But since it came up now, some virtual drivers still require a parent device. Great, use the default one that the kernel gives you :) > For instance, in DRM we have vGEM [3] and vKMS [4], that use > platform_device_register_simple() for this purpose. Again, abuse, please do not do so. > What should they use instead? I'm happy to fix things up if required. > > [3] https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/vgem/vgem_drv.c > [4] https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/vkms/vkms_drv.c Use the virtual device interface please, that's what it is there for. thanks, greg k-h