f6bd2f63 | 12-Jul-2024 |
Alexis Belmonte <alexbelm48@gmail.com> |
platform/x86: hp-wmi: Fix implementation of the platform_profile_omen_get function
Fix ill-formed implementation of the platform_profile_omen_get function introduced by the commit d23430233494 ("pla
platform/x86: hp-wmi: Fix implementation of the platform_profile_omen_get function
Fix ill-formed implementation of the platform_profile_omen_get function introduced by the commit d23430233494 ("platform/x86: hp-wmi: Fix platform profile option switch bug on Omen and Victus laptops"). platform_profile_omen_get() is .profile_get function that should set *profile and return 0 on success.
Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Fixes: d23430233494 ("platform/x86: hp-wmi: Fix platform profile option switch bug on Omen and Victus laptops") Signed-off-by: Alexis Belmonte <alexbelm48@gmail.com> Reviewed-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/ZpFnV8w1558BW7iZ@alexis-pc Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
3a057bf3 | 01-Feb-2024 |
Alexis Belmonte <alexbelm48@gmail.com> |
platform/x86: hp-wmi: Add thermal profile support for 8BAD boards
Add 8BAD to the list of boards which have thermal profile selection available. This allows the CPU to draw more power than the defau
platform/x86: hp-wmi: Add thermal profile support for 8BAD boards
Add 8BAD to the list of boards which have thermal profile selection available. This allows the CPU to draw more power than the default TDP barrier defined by the 'balanced' thermal profile (around 50W), hence allowing it to perform better without being throttled by the embedded controller (around 130W).
We first need to set the HP_OMEN_EC_THERMAL_PROFILE_TIMER_OFFSET to zero. This prevents the timer countdown from reaching zero, making the embedded controller "force-switch" the system's thermal profile back to 'balanced' automatically.
We also need to put a number of specific flags in HP_OMEN_EC_THERMAL_PROFILE_FLAGS_OFFSET when we're switching to another thermal profile:
- for 'performance', we need to set both HP_OMEN_EC_FLAGS_TURBO and HP_OMEN_EC_FLAGS_NOTIMER;
- for 'balanced' and 'powersave', we clear out the register to notify the system that we want to lower the TDP barrier as soon as possible.
The third flag defined in the hp_thermal_profile_omen_flags enum, HP_OMEN_EC_FLAGS_JUSTSET, is present for completeness.
To prevent potential behaviour breakage with other Omen models, a separate omen_timed_thermal_profile_boards array has been added to list which boards expose this behaviour.
Performance benchmarking was done with the help of silver.urih.com and Google Chrome 120.0.6099.129, on Gnome 45.2, with the 'performance' thermal profile set:
| | Performance | Stress | TDP | |------------------|-------------|------------|-------| | with my patch | P84549 | S0.1891 | 131W | | without my patch | P44084 | S0.1359 | 47W |
The TDP measurements were done with the help of the s-tui utility, during the load.
There is still work to be done:
- tune the CPU and GPU fans to better cool down and enhance performance at the right time; right now, it seems that the fans are not properly reacting to thermal/performance events, which in turn either causes thermal throttling OR makes the fans spin way too long, even though the temperatures have lowered down
- expose the CPU and GPU fan curves to user-land so that they can be controlled just like what the Omen Gaming Hub utility proposes to its users;
Signed-off-by: Alexis Belmonte <alexbelm48@gmail.com> Link: https://lore.kernel.org/r/ZbucvX2rRdqRgtcu@alexis-pc Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
92c47597 | 13-Nov-2023 |
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> |
platform/x86: hp-bioscfg: Remove unused obj in hp_add_other_attributes()
acpi_object *obj is unused in this function, so delete it, also delete a unnecessary kfree(obj);
Signed-off-by: Harshit Moga
platform/x86: hp-bioscfg: Remove unused obj in hp_add_other_attributes()
acpi_object *obj is unused in this function, so delete it, also delete a unnecessary kfree(obj);
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20231113200742.3593548-4-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
f40f9399 | 13-Nov-2023 |
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> |
platform/x86: hp-bioscfg: Fix error handling in hp_add_other_attributes()
'attr_name_kobj' is allocated using kzalloc, but on all the error paths it is not freed, hence we have a memory leak.
Fix t
platform/x86: hp-bioscfg: Fix error handling in hp_add_other_attributes()
'attr_name_kobj' is allocated using kzalloc, but on all the error paths it is not freed, hence we have a memory leak.
Fix the error path before kobject_init_and_add() by adding kfree().
kobject_put() must be always called after passing the object to kobject_init_and_add(). Only the error path which is immediately next to kobject_init_and_add() calls kobject_put() and not any other error path after it.
Fix the error handling after kobject_init_and_add() by moving the kobject_put() into the goto label err_other_attr_init that is already used by all the error paths after kobject_init_and_add().
Fixes: a34fc329b189 ("platform/x86: hp-bioscfg: bioscfg") Cc: stable@vger.kernel.org # 6.6.x: c5dbf0416000: platform/x86: hp-bioscfg: Simplify return check in hp_add_other_attributes() Cc: stable@vger.kernel.org # 6.6.x: 5736aa9537c9: platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes() Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Closes: https://lore.kernel.org/r/202309201412.on0VXJGo-lkp@intel.com/ Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> [ij: Added the stable dep tags] Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20231113200742.3593548-3-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
5736aa95 | 13-Nov-2023 |
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> |
platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes()
attr_name_kobj's memory allocation is done with mutex_lock() held, this is not needed.
Move allocation outside of mutex
platform/x86: hp-bioscfg: move mutex_lock() down in hp_add_other_attributes()
attr_name_kobj's memory allocation is done with mutex_lock() held, this is not needed.
Move allocation outside of mutex_lock() so unlock is not needed when allocation fails.
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20231113200742.3593548-2-harshit.m.mogalapalli@oracle.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
show more ...
|
5b44abbc | 04-Oct-2023 |
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> |
platform/x86: hp-wmi:: Mark driver struct with __refdata to prevent section mismatch warning
As described in the added code comment, a reference to .exit.text is ok for drivers registered via module
platform/x86: hp-wmi:: Mark driver struct with __refdata to prevent section mismatch warning
As described in the added code comment, a reference to .exit.text is ok for drivers registered via module_platform_driver_probe(). Make this explicit to prevent a section mismatch warning:
WARNING: modpost: drivers/platform/x86/hp/hp-wmi: section mismatch in reference: hp_wmi_driver+0x8 (section: .data) -> hp_wmi_bios_remove (section: .exit.text)
Fixes: c165b80cfecc ("hp-wmi: fix handling of platform device") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20231004111624.2667753-1-u.kleine-koenig@pengutronix.de Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|
6f8972a0 | 03-Aug-2023 |
Li Zetao <lizetao1@huawei.com> |
platform/x86: hp-bioscfg: Use kmemdup() to replace kmalloc + memcpy
There are some warnings reported by coccinelle:
./drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:317:35-42: WARNING opp
platform/x86: hp-bioscfg: Use kmemdup() to replace kmalloc + memcpy
There are some warnings reported by coccinelle:
./drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:317:35-42: WARNING opportunity for kmemdup ./drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:270:40-47: WARNING opportunity for kmemdup ./drivers/platform/x86/hp/hp-bioscfg/spmobj-attributes.c:233:36-43: WARNING opportunity for kmemdup
Use kmemdup rather than duplicating its implementation.
Signed-off-by: Li Zetao <lizetao1@huawei.com> Reviewed-by: Jorge Lopez <jorge.lopez2@hp.com> Link: https://lore.kernel.org/r/20230803032027.3044851-1-lizetao1@huawei.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
show more ...
|