Hans de Goede
23e652467d
Merge tag 'platform-drivers-x86-v6.7-3' into pdx86/for-next
...
Back merge pdx86 fixes into pdx86/for-next for further WMI work
depending on some of the fixes.
platform-drivers-x86 for v6.7-3
Highlights:
- asus-wmi: Solve i8042 filter resource handling, input, and
suspend issues
- wmi: Skip zero instance WMI blocks to avoid issues with
some laptops
- mlxbf-bootctl: Differentiate dev/production keys
- platform/surface: Correct serdev related return value to avoid
leaking errno into userspace
- Error checking fixes
The following is an automated shortlog grouped by driver:
asus-wmi:
- Change q500a_i8042_filter() into a generic i8042-filter
- disable USB0 hub on ROG Ally before suspend
- Filter Volume key presses if also reported via atkbd
- Move i8042 filter install to shared asus-wmi code
mellanox:
- Add null pointer checks for devm_kasprintf()
- Check devm_hwmon_device_register_with_groups() return value
mlxbf-bootctl:
- correctly identify secure boot with development keys
surface: aggregator:
- fix recv_buf() return value
wmi:
- Skip blocks with zero instances
2023-12-11 11:22:02 +01:00
Ilpo Järvinen
682b43a049
platform/x86: ips: Remove unused debug code
...
Remove unused debug code inside #if 0 ... #endif.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231208134845.3900-1-ilpo.jarvinen@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-11 11:10:36 +01:00
Srinivas Pandruvada
b06458d1b1
platform/x86/intel-uncore-freq: Process read/write blocked feature status
...
When a feature is read blocked, don't continue to read uncore information
and register with uncore core.
When the feature is write blocked, continue to offer read interface but
block setting uncore limits.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231204221740.3645130-6-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-11 11:06:41 +01:00
Srinivas Pandruvada
8bed9ff7db
platform/x86: ISST: Process read/write blocked feature status
...
When a feature is read blocked, don't continue to read SST information
and register with SST core.
When the feature is write blocked, continue to offer read interface for
SST parameters, but don't allow any operation to change state. A state
change results from SST level change, feature change or class of service
change.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.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/20231204221740.3645130-5-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-11 11:06:41 +01:00
Srinivas Pandruvada
046d7be621
platform/x86/intel/tpmi: Move TPMI ID definition
...
Move TPMI ID definitions to common include file. In this way other
feature drivers don't have to redefine.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231204221740.3645130-4-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-11 11:06:41 +01:00
Srinivas Pandruvada
72dd14d241
platform/x86/intel/tpmi: Modify external interface to get read/write state
...
Modify the external interface tpmi_get_feature_status() to get read
and write blocked instead of locked and disabled. Since auxiliary device
is not created when disabled, no use of returning disabled state. Also
locked state is not useful as feature driver can't use locked state
in a meaningful way.
Using read and write state, feature driver can decide which operations
to restrict for that feature.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231204221740.3645130-3-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-11 11:06:41 +01:00
Srinivas Pandruvada
b87434f2e6
platform/x86/intel/tpmi: Don't create devices for disabled features
...
If some TPMI features are disabled, don't create auxiliary devices. In
this way feature drivers will not load.
While creating auxiliary devices, call tpmi_read_feature_status() to
check feature state and return if the feature is disabled without
creating a device.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.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/20231204221740.3645130-2-srinivas.pandruvada@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-11 11:06:41 +01:00
Andy Shevchenko
7973be9472
clk: x86: lpss-atom: Drop unneeded 'extern' in the header
...
'extern' for the functions is not needed, drop it.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231208165238.3309058-1-andriy.shevchenko@linux.intel.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-11 11:04:28 +01:00
Uwe Kleine-König
3df692169e
platform/x86: hp-wmi: Convert to platform remove callback returning void
...
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/a6b074b7ee37f3682da4b3f39ea40af97add64c2.1701726190.git.u.kleine-koenig@pengutronix.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-11 11:03:39 +01:00
Uwe Kleine-König
f2a2d85a93
platform/x86: asus-wmi: Convert to platform remove callback returning void
...
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().
Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Link: https://lore.kernel.org/r/639b9ffc18422fe59125893bd7909e8a73cffb72.1701726190.git.u.kleine-koenig@pengutronix.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-11 11:03:26 +01:00
Dan Carpenter
35ddd61cf0
platform/x86: x86-android-tablets: Fix an IS_ERR() vs NULL check in probe
...
The spi_new_device() function returns NULL on error, it doesn't return
error pointers.
Fixes: 70505ea6de ("platform/x86: x86-android-tablets: Add support for SPI device instantiation")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org >
Link: https://lore.kernel.org/r/4b1b2395-c7c5-44a4-b0b0-6d091c7f46a2@moroto.mountain
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 15:42:15 +01:00
David E. Box
6e79648553
platform/x86/intel/pmc: Show Die C6 counter on Meteor Lake
...
Expose the Die C6 counter on Meteor Lake.
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-21-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
David E. Box
3621df43b0
platform/x86/intel/pmc: Add debug attribute for Die C6 counter
...
Add a "die_c6_us_show" debugfs attribute. Reads the counter value using
Intel Platform Monitoring Technology (PMT) driver API. This counter is
useful for determining the idle residency of CPUs in the compute tile.
Also adds a missing forward declaration for punit_ep which was declared in
an earlier upstream commit but only used for the first time in this one.
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-20-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
Xi Pardee
935b8211a3
platform/x86/intel/pmc: Read low power mode requirements for MTL-M and MTL-P
...
Add support to read the low power mode requirements for Meteor Lake M and
Meteor Lake P.
Signed-off-by: Xi Pardee <xi.pardee@intel.com >
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-19-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
Xi Pardee
4d621c3f02
platform/x86/intel/pmc: Retrieve LPM information using Intel PMT
...
On supported platforms, the low power mode (LPM) requirements for entering
each idle substate are described in Platform Monitoring Technology (PMT)
telemetry entries. Provide a function for platform code to attempt to find
and read the requirements from the telemetry entries.
Signed-off-by: Xi Pardee <xi.pardee@intel.com >
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-18-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
Rajvi Jingar
0f601dec18
platform/x86/intel/pmc: Display LPM requirements for multiple PMCs
...
Update the substate_requirements attribute to display the requirements for
all the PMCs on a package.
Signed-off-by: Rajvi Jingar <rajvi.jingar@linux.intel.com >
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-17-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
David E. Box
104f74943f
platform/x86/intel/pmc: Find and register PMC telemetry entries
...
The PMC SSRAM device contains counters that are structured in Intel
Platform Monitoring Technology (PMT) telemetry regions. Look for and
register these telemetry regions from the driver so that they may be read
using the Intel PMT ABI.
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-16-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
David E. Box
642dd26f58
platform/x86/intel/pmc/mtl: Use return value from pmc_core_ssram_init()
...
Instead of checking for a NULL regbase, use the return value from
pmc_core_ssram_init() to check if PMC discovery was successful. If not, use
the legacy enumeration method (which only works for the primary PMC).
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-15-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
David E. Box
a01486dc4b
platform/x86/intel/pmc: Cleanup SSRAM discovery
...
Clean up the code handling SSRAM discovery. Handle all resource allocation
and cleanup in pmc_core_ssram_get_pmc(). Return the error status from this
function but only fail the init if we fail to discover the primary PMC.
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-14-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
David E. Box
9512920a6b
platform/x86/intel/pmc: Allow pmc_core_ssram_init to fail
...
Currently, if the PMC SSRAM initialization fails, no error is returned and
the only indication is that a PMC device has not been created. Instead,
allow an error to be returned and handled directly by the caller.
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-13-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
Xi Pardee
2e35e3aa9f
platform/x86:intel/pmc: Call pmc_get_low_power_modes from platform init
...
In order to setup a table of low power mode requirements for Meteor Lake,
pmc_core_get_low_power_modes() will need to be run from platform init code
so that the enabled modes are known, allowing the use of the
pmc_for_each_mode helper. Make the function global and call it from the
platform init code.
Signed-off-by: Xi Pardee <xi.pardee@intel.com >
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-12-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
David E. Box
416eeb2e1f
platform/x86/intel/pmt: telemetry: Export API to read telemetry
...
Export symbols to allow access to Intel PMT Telemetry data on available
devices. Provides APIs to search, register, and read telemetry using a
kref managed pointer that serves as a handle to a telemetry endpoint.
To simplify searching for present devices, have the IDA start at 1
instead of 0 so that 0 can be used to indicate end of search.
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-11-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
David E. Box
4d1b7efee3
platform/x86/intel/pmt: Add header to struct intel_pmt_entry
...
The PMT header is passed to several functions. Instead, store the header in
struct intel_pmt_entry which is also passed to these functions and shorten
the argument list. This simplifies the calls in preparation for later
changes. While here also perform a newline cleanup.
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-10-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
David E. Box
e97ec7f621
platform/x86/intel/vsec: Add base address field
...
Some devices may emulate PCI VSEC capabilities in MMIO. In such cases the
BAR is not readable from a config space. Provide a field for drivers to
indicate the base address to be used.
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-9-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:43 +01:00
Gayatri Kammela
4edbd117ba
platform/x86/intel/vsec: Add intel_vsec_register
...
Add and export intel_vsec_register() to allow the registration of Intel
extended capabilities from other drivers. Add check to look for memory
conflicts before registering a new capability. Since the vsec provider
may not be a PCI device, add a parent field to
intel_vsec_platform_info() to allow specifying the parent device for
device managed cleanup.
Signed-off-by: Gayatri Kammela <gayatri.kammela@linux.intel.com >
Signed-off-by: David E. Box <david.e.box@linux.intel.com >
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com >
Link: https://lore.kernel.org/r/20231129222132.2331261-8-david.e.box@linux.intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
2023-12-04 14:53:30 +01:00