The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Kurt Borja" <kuurtb@gmail.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Hans de Goede" <hdegoede@redhat.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Lyndon Sanche" <lsanche@lyndeno.ca>,
	"Mario Limonciello" <mario.limonciello@amd.com>,
	<platform-driver-x86@vger.kernel.org>,
	"LKML" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] platform/x86: dell-pc: Transition to faux device
Date: Fri, 25 Apr 2025 04:48:13 -0300	[thread overview]
Message-ID: <D9FJYO87PWNU.1296TXH1IPP66@gmail.com> (raw)
In-Reply-To: <310fae71-d3b7-51b8-6012-c73b2ba7e282@linux.intel.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 3551 bytes --]

On Thu Apr 24, 2025 at 8:57 AM -03, Ilpo Järvinen wrote:
> On Wed, 23 Apr 2025, Hans de Goede wrote:
>> On 23-Apr-25 6:14 PM, Kurt Borja wrote:
>> > On Wed Apr 23, 2025 at 10:44 AM -03, Hans de Goede wrote:
>> >> On 23-Apr-25 3:27 PM, Ilpo Järvinen wrote:
>> >>> On Fri, 11 Apr 2025, Kurt Borja wrote:
>> >>>
>> >>>> Use a faux device parent for registering the platform_profile instead of
>> >>>> a "fake" platform device.
>> >>>>
>> >>>> The faux bus is a minimalistic, single driver bus designed for this
>> >>>> purpose.
>> >>>
>> >>> Hi Kurt, Hans & Greg,
>> >>>
>> >>> I'm not sure about this change. So dell-pc not a platform device but
>> >>> a "fake".
>> >>
>> >> Arguably the dell-pc driver does not need a struct device at all,
>> >> since it just exports /sys/firmware/acpi/platform_profile sysfs
>> >> interface by using the relevant Dell SMBIOS interfaces for this.
>> >>
>> >> As such maybe we should just completely get rid of the whole
>> >> struct device here?
>> >>
>> >> If we do decide to keep the struct device, then since the struct device
>> >> seems to just be there to tie the lifetime of the platform_profile
>> >> handler to, I guess that calling it a faux device is fair.
>> > 
>> > I think it's important to mention that a parent device is required to
>> > register a platform profile, see [1].
>> 
>> Ah ok, that is new, I guess that was changed with the new support
>> for registering multiple platform-profile handlers.
>> 
>> > I guess we could get away with removing the device altogether from here,
>> > but that would require to find another suitable parent device. The
>> > obvious choice would be the `dell-smbios` device, however that would
>> > require exporting it in the first place.
>> > 
>> > For some reason, exporting devices doesn't seem right to me, so IMO a
>> > faux device is a good choice here.
>> 
>> Agreed.
>> 
>> > Another solution that would make more sense, lifetime wise, is to turn
>> > this into an aux driver and let `dell-smbios` create the matching aux
>> > device.
>
> Well, that was what caused part of my confusion / uncertainty here as
> I could see that aux bus between these two drivers. Obviously, it's not 
> there currently but conceptually this relationship looks what full-blown 
> aux bus was supposed to solve.
>
> The other part was that as per Greg's simple classification, certainly 
> this driver needs to access platform resources. BUT, that access is routed 
> through another driver which is a case his answer/classification did not 
> cover.

Perhaps it didn't cover it because, as you mentioned, this falls under
the aux bus use cases.

>
>> > I could do this, but I think it's overly complicated.
>>
>> Yes that does seem overly complicated, lets just go with the faux
>> device.
>
> Okay. In part, this was also to check whether replacing full-blown aux bus 
> with faux should be considered another kind of "abuse". I've no problem 
> with accepting faux for cases like this as I see these as policy / 
> convention decision more than one being right and another wrong. :-)

Now that you put it that way, I guess this still is kind of "abusive",
but is still an improvement over creating a full platform device.

Nevertheless, although this driver do access platform resources, it does
it completely detached from the "dell-smbios" device. The only use of
the platform device here was `&pdev->dev` :p

>
> Thanks to all who answered.

Thanks for your review!

-- 
 ~ Kurt

[-- Attachment #1.2: 57E3B6585920A69A.asc --]
[-- Type: application/pgp-keys, Size: 4349 bytes --]

-----BEGIN PGP PUBLIC KEY BLOCK-----

mQINBGgKemsBEADlBa3abjsoEof7YAphRayi3YrBgIp06UinSkhCkv7g4daNUUvz
D8clrNHZ6GCt4DXEjbbApQZaZSwn+/e0Gt7FAK8HYftVir158tftWk8JPqN3cZaH
a15B+0svYc9bBsmSZyMNsllIBOE3h4oSqIVrPuEWEqK+6cC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Ci9JH+IuDMEaAp7xxYJKwYBBAHa
Rw8BAQdAKkxKhQUR39+VwLvyev1AR1l1ardbn+qtj2PicyY0CRGJAjYEGAEIACAW
IQRU074XCu93eYPDxjtX47ZYWSCmmgUCaAp7xwIbIAAKCRBX47ZYWSCmmgllD/4h
f+MD3lHN/z4kI8zjKJ4sh+6wq79Mb1lGZyFgNm4ZW8TYJVN6G/CJN/Y/AFwX0izj
Qamzs6A5FZf6EFR4lkbFLFFU8QtC3NeddlC8Rq9C409wrbR+G/Qp78KWyvyVMeEI
U0Qk4mtmGmrnkKpii116O5uof3W2eVzYry9AlWNk0qP2DZ/BxYL8XBH+mkLPyLKa
O60fXflRL+616kd5IAffwZq97mWU9GSkmeY984D+cqXrqWCXx1UlHz+qzszzAkzH
muz2NRWloicZ0MrcHw5ftDvIzY1hIRdRcHdk3tLDpXxkZldDDS43apGLGeDf3rHz
QHgDtCSx1fT3OL2PT8nZPki3mnWJ/KwX6u2rrErP92OYPX1ACcwQ3uKNlvevZkXU
amaRoIrZD65EDobgokCwwfoK0Ga+8I0oftFKBV5CZFixl9hf8XzjWK6eif8QUk38
fhheO3PpIAxh8+pHzpdIjEAJI3ycbdYhFRXprN610K37cXmwljrD/YhiyUHLAIHf
9RepyH30UJLiwVNMHOZlRnp4GaKEkpGP0tSE2ZoSGWuCw7BzOQmjTnRrow41SmWN
CG13hiGSG3hvTwkgOYr7fJQydFqQd+NOnp3aDc8r+2josRWp9MiwlK2euRkTygsy
wOBUvzk73mjU+O6iYOw7hhDbXKcZ3HQ/5mh5b8FCzA==
=GRvV
-----END PGP PUBLIC KEY BLOCK-----

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2025-04-25  7:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-11 14:36 [PATCH 0/3] platform/x86: dell-pc: Transition to faux device Kurt Borja
2025-04-11 14:36 ` [PATCH 1/3] platform/x86: dell-pc: Propagate errors when detecting feature support Kurt Borja
2025-04-11 14:36 ` [PATCH 2/3] platform/x86: dell-pc: Use non-atomic bitmap operations Kurt Borja
2025-04-11 14:36 ` [PATCH 3/3] platform/x86: dell-pc: Transition to faux device Kurt Borja
2025-04-23 13:27   ` Ilpo Järvinen
2025-04-23 13:44     ` Hans de Goede
2025-04-23 13:59       ` Greg Kroah-Hartman
2025-04-23 14:12         ` Lyndon Sanche
2025-04-23 16:14       ` Kurt Borja
2025-04-23 17:05         ` Hans de Goede
2025-04-24 11:57           ` Ilpo Järvinen
2025-04-25  7:48             ` Kurt Borja [this message]
2025-04-25 11:50               ` Ilpo Järvinen
2025-04-24 14:06 ` [PATCH 0/3] " Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D9FJYO87PWNU.1296TXH1IPP66@gmail.com \
    --to=kuurtb@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lsanche@lyndeno.ca \
    --cc=mario.limonciello@amd.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox