mbox series

[v4,0/3] Let other drivers react to platform profile changes

Message ID 20211026190835.10697-1-mario.limonciello@amd.com (mailing list archive)
Headers show
Series Let other drivers react to platform profile changes | expand

Message

Mario Limonciello Oct. 26, 2021, 7:08 p.m. UTC
Currently only one driver can register as a handler for a platform profile.

This limitation means that if multiple drivers want to react to platform
profile changes that they will need to directly interact with individual
drivers.

Instead introduce a notification flow that drivers can register for event
changes.  The idea is that any driver that wants to can:
1. read the current profile
2. set up initial values
3. register for changes
4. react to changes

Changes from v3->v4:
 * Simplify platform_profile_notify
   - No need to check cur_profile as platform_profile_get does it
   - No need to track ret as it's unused
Changes from v2->v3:
 * Add patches to avoid collisions in hp-wmi and asus-wmi symbols

Mario Limonciello (3):
  platform/x86: hp-wmi: rename platform_profile_* function symbols
  platform/x86: asus-wmi: rename platform_profile_* function symbols
  ACPI: platform_profile: Add support for notification chains

 drivers/acpi/platform_profile.c  | 46 +++++++++++++++++++++++++++-----
 drivers/platform/x86/asus-wmi.c  | 12 ++++-----
 drivers/platform/x86/hp-wmi.c    | 12 ++++-----
 include/linux/platform_profile.h | 10 +++++++
 4 files changed, 61 insertions(+), 19 deletions(-)

Comments

Hans de Goede Oct. 27, 2021, 1:51 p.m. UTC | #1
Hi Mario,

On 10/26/21 21:08, Mario Limonciello wrote:
> Currently only one driver can register as a handler for a platform profile.
> 
> This limitation means that if multiple drivers want to react to platform
> profile changes that they will need to directly interact with individual
> drivers.
> 
> Instead introduce a notification flow that drivers can register for event
> changes.  The idea is that any driver that wants to can:
> 1. read the current profile
> 2. set up initial values
> 3. register for changes
> 4. react to changes
> 
> Changes from v3->v4:
>  * Simplify platform_profile_notify
>    - No need to check cur_profile as platform_profile_get does it
>    - No need to track ret as it's unused
> Changes from v2->v3:
>  * Add patches to avoid collisions in hp-wmi and asus-wmi symbols

We typically do not merge new in-kernel API without at least one
consumer of that in-kernel API.

I can take patches 1 + 2 now as prep work for the future,
but I would expect Rafael to only want to take patch 3/3 if
you post a new series which also includes at least one consumer
for the functionality added by 3/3.

That will also make it a lot easier to review 3/3 / to consider
other means to reach the same goal.
Rafael, do you concur?

Regards,

Hans
Rafael J. Wysocki Oct. 27, 2021, 1:57 p.m. UTC | #2
On Wed, Oct 27, 2021 at 3:51 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi Mario,
>
> On 10/26/21 21:08, Mario Limonciello wrote:
> > Currently only one driver can register as a handler for a platform profile.
> >
> > This limitation means that if multiple drivers want to react to platform
> > profile changes that they will need to directly interact with individual
> > drivers.
> >
> > Instead introduce a notification flow that drivers can register for event
> > changes.  The idea is that any driver that wants to can:
> > 1. read the current profile
> > 2. set up initial values
> > 3. register for changes
> > 4. react to changes
> >
> > Changes from v3->v4:
> >  * Simplify platform_profile_notify
> >    - No need to check cur_profile as platform_profile_get does it
> >    - No need to track ret as it's unused
> > Changes from v2->v3:
> >  * Add patches to avoid collisions in hp-wmi and asus-wmi symbols
>
> We typically do not merge new in-kernel API without at least one
> consumer of that in-kernel API.
>
> I can take patches 1 + 2 now as prep work for the future,
> but I would expect Rafael to only want to take patch 3/3 if
> you post a new series which also includes at least one consumer
> for the functionality added by 3/3.
>
> That will also make it a lot easier to review 3/3 / to consider
> other means to reach the same goal.
> Rafael, do you concur?

Yes, I do.

Thanks!
Mario Limonciello Oct. 27, 2021, 2:02 p.m. UTC | #3
[Public]

+Alex, Shyam

> -----Original Message-----
> From: Rafael J. Wysocki <rafael@kernel.org>
> Sent: Wednesday, October 27, 2021 08:57
> To: Hans de Goede <hdegoede@redhat.com>
> Cc: Limonciello, Mario <Mario.Limonciello@amd.com>; Mark Gross
> <mgross@linux.intel.com>; Rafael J . Wysocki <rjw@rjwysocki.net>; open
> list:X86 PLATFORM DRIVERS <platform-driver-x86@vger.kernel.org>; Mark
> Pearson <markpearson@lenovo.com>; ACPI Devel Maling List <linux-
> acpi@vger.kernel.org>
> Subject: Re: [PATCH v4 0/3] Let other drivers react to platform profile changes
> 
> On Wed, Oct 27, 2021 at 3:51 PM Hans de Goede <hdegoede@redhat.com>
> wrote:
> >
> > Hi Mario,
> >
> > On 10/26/21 21:08, Mario Limonciello wrote:
> > > Currently only one driver can register as a handler for a platform profile.
> > >
> > > This limitation means that if multiple drivers want to react to platform
> > > profile changes that they will need to directly interact with individual
> > > drivers.
> > >
> > > Instead introduce a notification flow that drivers can register for event
> > > changes.  The idea is that any driver that wants to can:
> > > 1. read the current profile
> > > 2. set up initial values
> > > 3. register for changes
> > > 4. react to changes
> > >
> > > Changes from v3->v4:
> > >  * Simplify platform_profile_notify
> > >    - No need to check cur_profile as platform_profile_get does it
> > >    - No need to track ret as it's unused
> > > Changes from v2->v3:
> > >  * Add patches to avoid collisions in hp-wmi and asus-wmi symbols
> >
> > We typically do not merge new in-kernel API without at least one
> > consumer of that in-kernel API.
> >
> > I can take patches 1 + 2 now as prep work for the future,
> > but I would expect Rafael to only want to take patch 3/3 if
> > you post a new series which also includes at least one consumer
> > for the functionality added by 3/3.
> >
> > That will also make it a lot easier to review 3/3 / to consider
> > other means to reach the same goal.
> > Rafael, do you concur?
> 
> Yes, I do.
> 
> Thanks!

OK Thanks.  At least landing 1 and 2 will make things easier later when
it's time to merge 3.

Alex, Shyam,

This was mostly in preparation for your drivers that may build on top of this.
Please feel free to pull the last patch into your series when you're ready.
Full thread is here: https://patchwork.kernel.org/project/platform-driver-x86/cover/20211026190835.10697-1-mario.limonciello@amd.com/