lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tftomtw456sevajiid76bgenmxl2s5ycv4sckfgl7mdjbs5hxb@5vs36lxjtaxc>
Date: Fri, 3 Jan 2025 14:01:04 -0500
From: Kurt Borja <kuurtb@...il.com>
To: Hridesh MG <hridesh699@...il.com>
Cc: Armin Wolf <W_Armin@....de>, "Lee, Chun-Yi" <jlee@...e.com>, 
	Hans de Goede <hdegoede@...hat.com>, Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>, 
	platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Shuah Khan <skhan@...uxfoundation.org>, onenowy@...il.com
Subject: Re: [PATCH] platform/x86: acer-wmi: improve platform profile handling

On Thu, Jan 02, 2025 at 12:20:36PM +0530, Hridesh MG wrote:
> On Thu, Jan 2, 2025 at 2:28 AM Armin Wolf <W_Armin@....de> wrote:
> > > @@ -1946,12 +2038,10 @@ static int acer_thermal_profile_change(void)
> > >               u8 current_tp;
> > >               int tp, err;
> > >               u64 on_AC;
> > > -             acpi_status status;
> > > -
> > > -             err = ec_read(ACER_PREDATOR_V4_THERMAL_PROFILE_EC_OFFSET,
> > > -                           &current_tp);
> > >
> > > -             if (err < 0)
> > > +             err = WMID_gaming_get_misc_setting(ACER_WMID_MISC_SETTING_PLATFORM_PROFILE,
> > > +                                                &current_tp);
> > > +             if (err)
> > >                       return err;
> > >
> > >               /* Check power source */
> > > @@ -1962,54 +2052,52 @@ static int acer_thermal_profile_change(void)
> > >               switch (current_tp) {
> > >               case ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO:
> > >                       if (!on_AC)
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED;
> > >                       else if (cycle_gaming_thermal_profile)
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_ECO_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_ECO;
> > >                       else
> > >                               tp = last_non_turbo_profile;
> > >                       break;
> > >               case ACER_PREDATOR_V4_THERMAL_PROFILE_PERFORMANCE:
> > >                       if (!on_AC)
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED;
> > >                       else
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO;
> > >                       break;
> > >               case ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED:
> > >                       if (!on_AC)
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_ECO_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_ECO;
> > >                       else if (cycle_gaming_thermal_profile)
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_PERFORMANCE_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_PERFORMANCE;
> > >                       else
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO;
> > >                       break;
> > >               case ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET:
> > >                       if (!on_AC)
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED;
> > >                       else if (cycle_gaming_thermal_profile)
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED;
> > >                       else
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO;
> > >                       break;
> > >               case ACER_PREDATOR_V4_THERMAL_PROFILE_ECO:
> > >                       if (!on_AC)
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_BALANCED;
> > >                       else if (cycle_gaming_thermal_profile)
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_QUIET;
> > >                       else
> > > -                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO_WMI;
> > > +                             tp = ACER_PREDATOR_V4_THERMAL_PROFILE_TURBO;
> > >                       break;
> > >               default:
> > >                       return -EOPNOTSUPP;
> > >               }
> >
> > This needs a bit more work, since you might accidentally select unsupported platform profiles this way.
> >
> > Using platform_profile_cycle() would make sense here, but we still need to handle "on_AC". I however wonder
> > if that is really necessary.
> >
> >From my testing, what I've found out is that even if we don't handle
> on_AC, the profile is still set but the hardware will not put the
> changes into effect until we plug in AC.

This is interesting.

Do you perhaps know if users expect a thermal profile change on AC
connect/disconnect events on Windows? This would solve this discussion
[1].

~ Kurt

[1] https://lore.kernel.org/platform-driver-x86/20241210001657.3362-6-W_Armin@gmx.de/

> 
> I've incorporated the rest of the changes into v2, thanks for the feedback!
> 
> --
> Thanks,
> Hridesh MG

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ