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 5C8262B9B3; Tue, 16 Jul 2024 15:15:34 +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=1721142934; cv=none; b=PkXnBuC9cgkBt8wKi2Qi9prV7ODZ16/0Q4Pv0NbgURYNDWMcbEYMdXtR24Szc7A+Y8T2YU4RlacaLAAVNG7ZNNU/WZwB4GE0PQB83ZzFU8xADxWF5di6Z5WjaVndzQ8UR1d7cQIkBQTBsuBmQ/yjJ7AzC15XPXWYHY57kVNnIfw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721142934; c=relaxed/simple; bh=gH/9v8gdvRPTuEMlos4E4YaZ22thsKhD8PVSvs6RoRY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PSYRC80hHQx7AxKOmMNzG9lWzS5WPeTZOcLzdSdUfeWmZN7Em5kN9a6biwGpReA5kqD9hAZAMEnnFCfDz4dUQnShfFCxtMoqzCDvhWRvqvIcjqHH9ZsRvkvvMQMVShmymqyfSMm7u6ymHjcrBa3dC+BjxiNaaotvOopkTiC62WM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XwWWMv2W; 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="XwWWMv2W" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA084C116B1; Tue, 16 Jul 2024 15:15:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721142933; bh=gH/9v8gdvRPTuEMlos4E4YaZ22thsKhD8PVSvs6RoRY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XwWWMv2W964OtTHvFJbs2l54wvapkUOVCVPZCYUMoi6Z3eVz7kmEUwOi1cDGehWOx TzmJ5G4mxSLaw7HfydJ9c9OIaLssAQ6IM9lzNjj2RhXiL2jb04cK8Gu3LI5RMYI9Ns +NrBMobZgoXJQyG0+WxQAcp1rKcGhQx+7soPLpbpWYVot6LX+/P1gwkmYjb+6vF7fd miYJoBGoKFv+3/J61zdZ3DyRn6zssDKbw2ech2dPCGqi1lrIuufs0jdLq0FOK7H1NJ C+R/tNXXuRRrfD2SAnCx9xbWf3BVyEk2taeHBiK2Aqw7F8GbIfY2g+h28RclQOaiJ2 4iA1Vx6t1sgKg== Date: Tue, 16 Jul 2024 17:15:25 +0200 From: Danilo Krummrich To: Greg KH Cc: Danilo Krummrich , 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: References: <20240711130802.vk7af6zd4um3b2cm@vireshk-i7> <2024071122-escargot-treadmill-6e9a@gregkh> <2024071111-negotiate-spoof-da94@gregkh> 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: <2024071111-negotiate-spoof-da94@gregkh> On Thu, Jul 11, 2024 at 06:34:22PM +0200, Greg KH wrote: > 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. For those drivers, wouldn't it be better if proper devices would be derived from the CPU OF nodes directly? This seems to be a common problem for cpuidle and cpufreq drivers. But it's quite a while ago I dealt with such drivers, maybe there are reasons not to do so. Anyway, using a virtual device for those seems a bit wrong to me. - Danilo