As is the case on Meteor Lake, the Gaussian & Neural Accelerator (GNA)
device is powered by BIOS to D0 by default. If no driver is loaded, this
will cause the Package C state to be limited to PC2, leading to
significant power consumption and decrease in batter life. Put the GNA
device in D3 by default if no driver is loaded for it.
Fixes: 83f168a1a4 ("platform/x86/intel/pmc: Add Arrow Lake S support to intel_pmc_core driver")
Signed-off-by: "David E. Box" <david.e.box@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Link: https://lore.kernel.org/r/20240227190134.1592072-3-david.e.box@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
A recent PMC firmware change in Lunar Lake caused the pmc_core driver to
fail to probe. This is due to a change in the GUID for PMC telemetry coming
from the SSRAM device. Until a final release is ready this value may
change again. In the meantime, disable the SSRAM support for Lunar Lake so
the driver can load and provide some basic functionality.
Fixes: 3748dfdae2 ("platform/x86/intel/pmc: Add Lunar Lake M support to intel_pmc_core driver")
Signed-off-by: "David E. Box" <david.e.box@linux.intel.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240227190134.1592072-2-david.e.box@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
intel_vsec_walk_header() is used to configure features from devices that
don't provide a PCI VSEC or DVSEC structure. Some of these features may
be unsupported and fail to load. Ignore them silently as we do for
unsupported features described by VSEC/DVSEC.
Signed-off-by: "David E. Box" <david.e.box@linux.intel.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240227190134.1592072-1-david.e.box@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This parameter allows predator laptop users to test and use features
(mode button, platform profile, fan speed monitoring) without
adding model names to acer_quirks and compiling kernel.
Signed-off-by: SungHwan Jung <onenowy@gmail.com>
Link: https://lore.kernel.org/r/20240220080416.6395-1-onenowy@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Add Acer Predator PH16-71 to Acer_quirks with predator_v4
to support mode button and fan speed sensor.
Signed-off-by: SungHwan Jung <onenowy@gmail.com>
Link: https://lore.kernel.org/r/20240220055231.6451-1-onenowy@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
The variable is only used internally and has no external users,
so it should me made static.
Compile-tested only.
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20240223163901.13504-3-W_Armin@gmx.de
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
The value of policy_base is the return value of a devm_ioremap call,
which returns a __iomem pointer instead of an regular pointer.
Add the missing __iomem attribute.
Compile-tested only.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Link: https://lore.kernel.org/r/20240223163901.13504-1-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
The whitelist-based approach for preventing older WMI drivers from
being instantiated multiple times has many drawbacks:
- uses cannot see all available WMI devices (if not whitelisted)
- whitelisting a WMI driver requires changes in the WMI driver core
- maintenance burden for driver and subsystem developers
Since the WMI driver core already takes care that older WMI drivers
are not being instantiated multiple times, remove the now redundant
whitelist.
Tested on a ASUS Prime B650-Plus.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240226193557.2888-3-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Many older WMI drivers cannot be instantiated multiple times for
two reasons:
- they are using the legacy GUID-based WMI API
- they are singletons (with global state)
Prevent such WMI drivers from binding to WMI devices with a duplicated
GUID, as this would mean that the WMI driver will be instantiated at
least two times (one for the original GUID and one for the duplicated
GUID).
WMI drivers which can be instantiated multiple times can signal this
by setting a flag inside struct wmi_driver.
Tested on a ASUS Prime B650-Plus.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240226193557.2888-2-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
When matching a WMI device to a GUID used by the legacy GUID-based
API, devices with a duplicated GUID should be ignored.
Add an additional WMI device flag signaling that the GUID used by
the WMI device is also used by another WMI device. Ignore such
devices inside the match functions used by the legacy GUID-based API.
Tested on a ASUS Prime B650-Plus.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240226193557.2888-1-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Newer Lenovo Yogas and Legions with 60Hz/90Hz displays send a wmi event
when Fn + R is pressed. This is intended for use to switch between the
two refresh rates.
The Fn + R key was incorrectly assigned to KEY_DISPLAYTOGGLE because it
is used to toggle the display on and off.
Map Fn + R key to the KEY_REFRESH_RATE_TOGGLE event code.
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Link: https://lore.kernel.org/r/8fd36f0f016dde700396d8afaba1979d5dbc30a1.1710065750.git.soyer@irl.hu
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Newer Lenovo Yogas and Legions with 60Hz/90Hz displays send a wmi event
when Fn + R is pressed. This is intended for use to switch between the
two refresh rates.
Allocate a new KEY_REFRESH_RATE_TOGGLE keycode for it.
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/15a5d08c84cf4d7b820de34ebbcf8ae2502fb3ca.1710065750.git.soyer@irl.hu
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Currently, the driver has two behaviors to deal with new & unsupported
performance blocks reported by the firmware:
1. For register and unknown block types, the driver will fail to load
with the following error message:
[ 4510.956369] mlxbf-pmc: probe of MLNXBFD2:00 failed with error -22
2. For counter and crspace blocks, the driver will load and sysfs files
will be created but getting the contents of event_list or trying to
setup the counter will fail
Instead, let's ignore and log unsupported blocks. This means the driver
will always load and unsupported blocks will never show up in sysfs.
Signed-off-by: Luiz Capitulino <luizcap@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/f8e2e6210b43e825b69824b420c801cd513d401d.1708635408.git.luizcap@redhat.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
The mlxbf_pmc_event_list() function returns a pointer to an array of
supported events and the array size. The array size is returned via
a pointer passed as an argument, which is mandatory.
However, we want to be able to use mlxbf_pmc_event_list() just to check
if a block name is implemented/supported. For this usage passing the size
argument is not necessary so let's make it optional.
Signed-off-by: Luiz Capitulino <luizcap@redhat.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/182de8ec6b9c33152f2ba6b248c35b0311abf5e4.1708635408.git.luizcap@redhat.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
The WMI driver core already takes care that the WMI driver is
only bound to WMI devices with a matching GUID.
Remove the unnecessary call to wmi_has_guid(), which will always
be true when the driver probes.
Tested on a Dell Inspiron 3505.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240223162905.12416-1-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This reverts commit 1a373d15e2.
The WMI core now takes care of draining the event queue if asus-wmi
is not loaded, so the hacky event queue handling code is not needed
anymore.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240219115919.16526-6-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Update the WMI ACPI interface documentation to include the fact
that _WED should be evaluated every time an ACPI notification
is received.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240219115919.16526-5-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
The ACPI WMI specification states:
"The _WED control method is evaluated by the mapper in
response to receiving a notification from a control
method."
This means that _WED should be evaluated unconditionally even
if no WMI event consumers are present.
Some firmware implementations actually depend on this behavior
by storing the event data inside a queue which will fill up if
the WMI core stops retrieving event data items due to no
consumers being present
Fix this by always evaluating _WED even if no WMI event consumers
are present.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240219115919.16526-4-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
WMI event drivers which do not have no_notify_data set expect
that each WMI event contains valid data. Evaluating _WED however
might return no data, which can cause issues with such drivers.
Fix this by validating that evaluating _WED did return data.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240219115919.16526-3-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
If a WMI event driver has no_notify_data set, then it indicates
support for WMI events which provide no notify data, otherwise
the notify() callback expects a valid ACPI object as notify data.
However if a WMI event driver which requires notify data is bound
to a WMI event device which cannot retrieve such data due to the
_WED ACPI method being absent, then the driver will be dysfunctional
since all WMI events will be dropped due to the missing notify data.
Fix this by not allowing such WMI event drivers to bind to WMI event
devices which do not support retrieving of notify data. Also reword
the description of no_notify_data a bit.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240219115919.16526-2-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This patch adds battery charge control support on Fujitsu notebooks
via the S006 method of the FUJ02E3 ACPI device. With this method it's
possible to set charge_control_end_threshold between 50 and 100%.
Tested on Lifebook E5411 and Lifebook U728. Sadly I can't test this
patch on a dual battery one, but I didn't find any clue about
independent battery charge control on dual battery Fujitsu notebooks
either. And by that I mean checking the DSDT table of various Lifebook
notebooks and reverse engineering FUJ02E3.dll.
Signed-off-by: Szilard Fabian <szfabian@bluemarch.art>
Acked-by: Jonathan Woithe <jwoithe@just42.net>
Link: https://lore.kernel.org/r/20240215203012.228758-2-szfabian@bluemarch.art
[ij: coding style cleanups.]
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Added non-standard thermal register's support for some ThinkPads.
Some of the Thinkpads use a non-standard ECFW which has different
thermal register addresses. This is a fix to correct the wrong temperature
reporting on those systems.
Tested on Lenovo ThinkPad L13 Yoga Gen2.
Suggested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: Vishnu Sankar <vishnuocv@gmail.com>
Link: https://lore.kernel.org/r/20240215134102.25118-2-vishnuocv@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Add a thermal_read_mode_check helper to make the code
simpler during init. This helps particularly when the new
TPACPI_THERMAL_TPEC_12 mode is added in the next patch.
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Vishnu Sankar <vishnuocv@gmail.com>
Link: https://lore.kernel.org/r/20240215134102.25118-1-vishnuocv@gmail.com
[ij: Reflowed the comment to 80 cols, multiline if braces, added __init.]
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
The ACPI-WMI specification declares in the section "ACPI Control Method
Naming Conventions and Functionality for Windows 2000 Instrumentation"
that a WMxx control method takes 3 arguments: instance, method id and
argument buffer. This is also the case even when the underlying WMI
method does not have any input arguments.
So if a WMI driver evaluates a WMI method without passing an input
buffer, ACPICA will log a warning complaining that the third argument
is missing.
Prevent this by checking that a input buffer was passed, and return
an error if this was not the case.
Tested on a Asus PRIME B650-Plus.
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240212185016.5494-1-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Highlights:
- WMI bus driver fixes
- Second attempt (previously reverted) at P2SB PCI rescan deadlock fix
- AMD PMF driver improvements
- MAINTAINERS updates
- Misc. other small fixes and hw-id additions
The following is an automated git shortlog grouped by driver:
MAINTAINERS:
- remove defunct acpi4asus project info from asus notebooks section
- add Luke Jones as maintainer for asus notebooks
- Remove Perry Yuan as DELL WMI HARDWARE PRIVACY SUPPORT maintainer
intel-uncore-freq:
- Fix types in sysfs callbacks
intel-wmi-sbl-fw-update:
- Fix function name in error message
p2sb:
- Use pci_resource_n() in p2sb_read_bar0()
- Allow p2sb_bar() calls during PCI device probe
platform/mellanox:
- mlxbf-pmc: Fix offset calculation for crspace events
- mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full
platform/x86/amd/pmf:
- Fix memory leak in amd_pmf_get_pb_data()
- Get ambient light information from AMD SFH driver
- Get Human presence information from AMD SFH driver
platform/x86/intel/ifs:
- Call release_firmware() when handling errors.
silicom-platform:
- Add missing "Description:" for power_cycle sysfs attr
touchscreen_dmi:
- Add info for the TECLAST X16 Plus tablet
wmi:
- Fix wmi_dev_probe()
- Fix notify callback locking
- Decouple legacy WMI notify handlers from wmi_block_list
- Return immediately if an suitable WMI event is found
- Fix error handling in legacy WMI notify handler functions
-----BEGIN PGP SIGNATURE-----
iQFIBAABCAAyFiEEuvA7XScYQRpenhd+kuxHeUQDJ9wFAmW1JScUHGhkZWdvZWRl
QHJlZGhhdC5jb20ACgkQkuxHeUQDJ9xNVwf/YXSuNEw+ztLH0pEySBUATHrcIbO7
gOpW2ZISf6IzRe7HFw7Ea1IJxrvysPn8VEribT3Sot9Ka+Pzd6H/TVA64sfyE7oG
wEke2Uxpnfie65Yo2IYNADhfLTOyAL7mvchScQz5hTE+gBq5Fdac2ykK+ox1dpTs
BqPg1/yG06L1SRX2Id0UNNYGMBsmjUH6v2b+M8Rcba+qcdznGMRe7l8T1Q2fY+nl
P6+tz3rYdfrGn1j+35Wo2bgKaB8l6rrtOscIvpke+CxZ95+6UxqZfLOBCg8u/njA
QbWqfZGjmbRGrbNo4C3fAHjj6SzQNyNfsm4gd4eJzl8X1CR9gzM8kb/xmg==
=yoe7
-----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
iHUEABYIAB0WIQSCSUwRdwTNL2MhaBlZrE9hU+XOMQUCZcTBOwAKCRBZrE9hU+XO
MWqxAQCI45uMAAJyya3FEVUaUNO1fgC1q8gIG9KoRMACys+HnAEAzR9JNjQOJ8g2
ccMpCtfVJxxlBJw3U8L6p+2FWkrt5gU=
=5exp
-----END PGP SIGNATURE-----
Merge tag 'platform-drivers-x86-v6.8-2' into pdx/for-next
Merge tag 'platform-drivers-x86-v6.8-2' fixes into pdf86/for-next
because of WMI fixes. The WMI changes done in for-next already created
a minor conflict with the fixes and WMI is actively being improved
currently so besides resolving the current conflict, this is also to
avoid further conflicts.
Using dev_err() allows users to find out from which
device the error message came from.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240206220447.3102-4-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
If kzalloc() fails, an out-of-memory message is already
printed. Remove the unnecessary second warning message.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240206220447.3102-3-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
A missing WQxx control method is a firmware bug and should be
marked as such using FW_BUG so that users know that the issue
is not a kernel issue.
Since get_subobj_info() might fail even if the control method
is present, we need to print the warning only if acpi_get_handle()
fails.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240206220447.3102-2-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Some devices like the MSI GF63-12VF contain WMI method blocks
without providing the necessary WMxx ACPI control methods.
Avoid creating WMI devices for such WMI method blocks since
the resulting WMI device is going to be unusable.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240206220447.3102-1-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Now that the driver core can properly handle constant struct bus_type,
move the rtl_subsys variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-platform-drivers-x86-v1-2-1f0839b385c6@marliere.net
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Now that the driver core can properly handle constant struct bus_type,
move the wmi_bus_type variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-platform-drivers-x86-v1-1-1f0839b385c6@marliere.net
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
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>
This commit performs four things:
- fix up the GUID string inconsistency (lower case 'e') from the
WMI module alias declaration/macro definition
- separate GUID macros from the embedded controller offset macros
- rename the description of the module to better represent what it
actually achieves as a whole
- add a space right before the '*' pointer qualifier to match the
other array declarations
This also prepares the terrain for integrating support work for boards
identified as '8BAD', which corresponds to HP's Omen 17 ck2xxx models.
Signed-off-by: Alexis Belmonte <alexbelm48@gmail.com>
Link: https://lore.kernel.org/r/ZbucrKh36sNxeyfX@alexis-pc
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
When an ACPI netlink event is received by acpid, the ACPI device
class is passed as its first argument. But since the class string
is not initialized during probe, an empty string is being passed:
netlink: PNP0C14:01 000000d0 00000000
Fix this by passing a static string instead.
Tested on a Dell Inspiron 3505.
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20240130221942.2770-1-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
The activation for Scan at Field (SAF) includes a parameter to make
microcode wait for both threads to join. It's preferable to perform an
entry rendezvous before the activation to ensure that they start the
`wrmsr` close enough to each other. In some cases it has been observed
that one of the threads might be just a bit late to arrive. An entry
rendezvous reduces the likelihood of these cases occurring.
Add an entry rendezvous to ensure the activation on both threads happen
close enough to each other.
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20240125082254.424859-6-ashok.raj@intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
ARRAY_BIST requires the test to be invoked only from one of the HT
siblings of a core. If the other sibling was in mwait(), that didn't
permit the test to complete and resulted in several retries before the
test could finish.
The exit rendezvous was introduced to keep the HT sibling busy until
the primary CPU completed the test to avoid those retries. What is
actually needed is to ensure that both the threads rendezvous *before*
the wrmsr to trigger the test to give good chance to complete the test.
The `stop_machine()` function returns only after all the CPUs complete
running the function, and provides an exit rendezvous implicitly.
In kernel/stop_machine.c::multi_cpu_stop(), every CPU in the mask
needs to complete reaching MULTI_STOP_RUN. When all CPUs complete, the
state machine moves to next state, i.e MULTI_STOP_EXIT. Thus the
underlying API stop_core_cpuslocked() already provides an exit
rendezvous.
Add the rendezvous earlier in order to ensure the wrmsr is triggered
after all CPUs reach the do_array_test(). Remove the exit rendezvous
since stop_core_cpuslocked() already guarantees that.
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20240125082254.424859-5-ashok.raj@intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Add the current batch number in the trace output. When there are
failures, it's important to know which test content resulted in failure.
# TASK-PID CPU# ||||| TIMESTAMP FUNCTION
# | | | ||||| | |
migration/0-18 [000] d..1. 527287.084668: ifs_status: batch: 02, start: 0000, stop: 007f, status: 0000000000007f80
migration/128-785 [128] d..1. 527287.084669: ifs_status: batch: 02, start: 0000, stop: 007f, status: 0000000000007f80
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20240125082254.424859-4-ashok.raj@intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Enable the trace function on all HT threads. Currently, the trace is
called from some arbitrary CPU where the test was invoked.
This change gives visibility to the exact errors as seen by each
participating HT threads, and not just what was seen from the primary
thread.
Sample output below.
# TASK-PID CPU# ||||| TIMESTAMP FUNCTION
# | | | ||||| | |
migration/0-18 [000] d..1. 527287.084668: start: 0000, stop: 007f, status: 0000000000007f80
migration/128-785 [128] d..1. 527287.084669: start: 0000, stop: 007f, status: 0000000000007f80
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/r/20240125082254.424859-3-ashok.raj@intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Use the standard array allocation variant of devm memory allocation
APIs.
Signed-off-by: Suma Hegde <suma.hegde@amd.com>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Link: https://lore.kernel.org/r/20240125125401.597617-1-suma.hegde@amd.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
AMD supports connecting up to 8 AMD EPYCs in a system.
Hence, verify the num_sockets returned from amd_nb_num().
Also remove the WARN_ON() since the num_sockets is already verified.
Signed-off-by: Suma Hegde <suma.hegde@amd.com>
Reviewed-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240106022532.1746932-9-suma.hegde@amd.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
AMD EPYC family 0x1A and Model 0x0-0xF are having different
mailbox message ID offset compared to previous
platforms. In case of ACPI based BIOS, this information will be read
from ACPI table, for non-ACPI BIOS, this needs to be #defined.
Signed-off-by: Suma Hegde <suma.hegde@amd.com>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240106022532.1746932-8-suma.hegde@amd.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
ACPI table provides mailbox base address and register offset
information. The base address is provided as part of CRS method
and mailbox offsets are provided through DSD table.
Sockets are differentiated by UIDs.
Signed-off-by: Suma Hegde <suma.hegde@amd.com>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240106022532.1746932-7-suma.hegde@amd.com
[ij: Removed extra parenthesis.]
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Split the creation of array of attribute groups and array of attributes
into different functions. This will ease the ACPI support.
Signed-off-by: Suma Hegde <suma.hegde@amd.com>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240106022532.1746932-6-suma.hegde@amd.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
On an ACPI enabled platforms the probe is called for each socket
and the struct dev is different for each socket. This change
will help in handling both ACPI and non-ACPI platforms.
Also change pr_err() to dev_err() API.
Signed-off-by: Suma Hegde <suma.hegde@amd.com>
Signed-off-by: Naveen Krishna Chatradhi <nchatrad@amd.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240106022532.1746932-5-suma.hegde@amd.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>