linux-2.6-block.git
6 months agox86/platform/atom: Check state of Punit managed devices on s2idle
Johannes Stezenbach [Tue, 5 Mar 2024 10:59:15 +0000 (11:59 +0100)]
x86/platform/atom: Check state of Punit managed devices on s2idle

For the Bay Trail or Cherry Trail SoC to enter the S0i3 power-level
at s2idle suspend requires most of the hw-blocks / devices in the SoC
to be in D3 when entering s2idle suspend.

If some devices are not in D3 then the SoC will stay in a higher
power state, consuming much more power from the battery then in S0i3.

Use the new acpi_s2idle_dev_ops and acpi_register_lps0_dev()
functionality to register a new s2idle check function which checks that
all hardware blocks in the North complex (controlled by Punit) are in
a state that allows the SoC to enter S0i3 and prints an error message
for any device in D0.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Acked-by: "Borislav Petkov (AMD)" <bp@alien8.de>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[hdegoede: Use acpi_s2idle_dev_ops]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240305105915.76242-6-hdegoede@redhat.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoplatform/x86: pmc_atom: Check state of PMC clocks on s2idle
Hans de Goede [Tue, 5 Mar 2024 10:59:14 +0000 (11:59 +0100)]
platform/x86: pmc_atom: Check state of PMC clocks on s2idle

Extend the s2idle check with checking that none of the PMC clocks
is in the forced-on state. If one of the clocks is in forced on
state then S0i3 cannot be reached.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240305105915.76242-5-hdegoede@redhat.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoplatform/x86: pmc_atom: Check state of PMC managed devices on s2idle
Johannes Stezenbach [Tue, 5 Mar 2024 10:59:13 +0000 (11:59 +0100)]
platform/x86: pmc_atom: Check state of PMC managed devices on s2idle

For the Bay Trail or Cherry Trail SoC to enter the S0i3 power-level
at s2idle suspend requires most of the hw-blocks / devices in the SoC
to be in D3 when entering s2idle suspend.

If some devices are not in D3 then the SoC will stay in a higher
power state, consuming much more power from the battery then in S0i3.

Use the new acpi_s2idle_dev_ops and acpi_register_lps0_dev()
functionality to register a new s2idle check function which checks that
all hardware blocks in the South complex (controlled by the PMC)
are in a state that allows the SoC to enter S0i3 and prints an error
message for any device in D0.

Some blocks are not used on lower-featured versions of the SoC and
these blocks will always report being in D0 on SoCs were they are
not used. A false-positive mask is used to identify these blocks
and for blocks in this mask the error is turned into a debug message
to avoid false-positive error messages.

Note the pmc_atom code is enabled by CONFIG_X86_INTEL_LPSS which
already depends on ACPI.

Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[hdegoede: Use acpi_s2idle_dev_ops, ignore fused off blocks, PMIC I2C]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240305105915.76242-4-hdegoede@redhat.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoplatform/x86: pmc_atom: Annotate d3_sts register bit defines
Hans de Goede [Tue, 5 Mar 2024 10:59:12 +0000 (11:59 +0100)]
platform/x86: pmc_atom: Annotate d3_sts register bit defines

The include/linux/platform_data/x86/pmc_atom.h d3_sts register bit defines
are named after how these bits are used on Bay Trail devices.

On Cherry Trail (CHT) devices some of these bits have a different meaning
according to the datasheet.

At a comment to the defines for bits which have a different meaning
on Cherry Trail devices.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240305105915.76242-3-hdegoede@redhat.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoclk: x86: Move clk-pmc-atom register defines to include/linux/platform_data/x86/pmc_a...
Hans de Goede [Tue, 5 Mar 2024 10:59:11 +0000 (11:59 +0100)]
clk: x86: Move clk-pmc-atom register defines to include/linux/platform_data/x86/pmc_atom.h

Move the register defines for the Atom (Bay Trail, Cherry Trail) PMC
clocks to include/linux/platform_data/x86/pmc_atom.h.

This is a preparation patch to extend the S0i3 readiness checks
in drivers/platform/x86/pmc_atom.c with checking that the PMC
clocks are off on suspend entry.

Note these are added to include/linux/platform_data/x86/pmc_atom.h rather
then to include/linux/platform_data/x86/clk-pmc-atom.h because the former
already has all the other Atom PMC register defines.

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240305105915.76242-2-hdegoede@redhat.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoplatform/x86: make fw_attr_class constant
Ricardo B. Marliere [Tue, 5 Mar 2024 18:55:04 +0000 (15:55 -0300)]
platform/x86: make fw_attr_class constant

Since commit 43a7206b0963 ("driver core: class: make class_register() take
a const *"), the driver core allows for struct class to be in read-only
memory, so move the fw_attr_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at boot time.

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/20240305-class_cleanup-platform-v1-1-9085c97b9355@marliere.net
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoplatform/x86/intel/tpmi: Change vsec offset to u64
Srinivas Pandruvada [Tue, 5 Mar 2024 19:46:44 +0000 (11:46 -0800)]
platform/x86/intel/tpmi: Change vsec offset to u64

The vsec offset can be 64 bit long depending on the PFS start. So change
type to u64. Also use 64 bit formatting for seq_printf.

Fixes: 47731fd2865f ("platform/x86/intel: Intel TPMI enumeration driver")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: stable@vger.kernel.org # v6.3+
Link: https://lore.kernel.org/r/20240305194644.2077867-1-srinivas.pandruvada@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoplatform/x86: intel_scu_pcidrv: Remove unused intel-mid.h
Andy Shevchenko [Tue, 5 Mar 2024 16:14:59 +0000 (18:14 +0200)]
platform/x86: intel_scu_pcidrv: Remove unused intel-mid.h

intel-mid.h is providing some core parts of the South Complex PM,
which are usually not used by individual drivers. In particular,
this driver doesn't use it, so simply remove the unused header.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Link: https://lore.kernel.org/r/20240305161539.1364717-3-andriy.shevchenko@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoplatform/x86: intel_scu_wdt: Remove unused intel-mid.h
Andy Shevchenko [Tue, 5 Mar 2024 16:14:58 +0000 (18:14 +0200)]
platform/x86: intel_scu_wdt: Remove unused intel-mid.h

intel-mid.h is providing some core parts of the South Complex PM,
which are usually not used by individual drivers. In particular,
this driver doesn't use it, so simply remove the unused header.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Link: https://lore.kernel.org/r/20240305161539.1364717-2-andriy.shevchenko@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoplatform/x86/amd/pmf: Fix possible out-of-bound memory accesses
Armin Wolf [Mon, 4 Mar 2024 20:50:05 +0000 (21:50 +0100)]
platform/x86/amd/pmf: Fix possible out-of-bound memory accesses

The length of the policy buffer is not validated before accessing it,
which means that multiple out-of-bounds memory accesses can occur.

This is especially bad since userspace can load policy binaries over
debugfs.

Compile-tested only.

Fixes: 7c45534afa44 ("platform/x86/amd/pmf: Add support for PMF Policy Binary")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20240304205005.10078-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>
6 months agoplatform/x86/amd/pmf: Use struct for cookie header
Armin Wolf [Mon, 4 Mar 2024 20:50:04 +0000 (21:50 +0100)]
platform/x86/amd/pmf: Use struct for cookie header

The cookie header consists of a sign field and a length field.
Combine both in a single struct to make accesses simpler.

Compile-tested only.

Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20240304205005.10078-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>
6 months agoplatform/x86/amd/pmf: Do not use readl() for policy buffer access
Armin Wolf [Mon, 4 Mar 2024 20:50:03 +0000 (21:50 +0100)]
platform/x86/amd/pmf: Do not use readl() for policy buffer access

The policy buffer is allocated using normal memory allocation
functions, so readl() should not be used on it.

Compile-tested only.

Fixes: 7c45534afa44 ("platform/x86/amd/pmf: Add support for PMF Policy Binary")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20240304205005.10078-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>
6 months agoplatform/x86/amd/pmf: Fix return value of amd_pmf_start_policy_engine()
Armin Wolf [Mon, 4 Mar 2024 20:50:02 +0000 (21:50 +0100)]
platform/x86/amd/pmf: Fix return value of amd_pmf_start_policy_engine()

amd_pmf_start_policy_engine() returns an negative error code upon
failure, so the TA_PMF_* error codes cannot be used here.

Return -EIO instead. Also stop shadowing the return code in
amd_pmf_get_pb_data().

Compile-tested only.

Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Fixes: 7c45534afa44 ("platform/x86/amd/pmf: Add support for PMF Policy Binary")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20240304205005.10078-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>
6 months agoplatform/mellanox: mlxbf-pmc: fix signedness bugs
Dan Carpenter [Thu, 29 Feb 2024 13:11:36 +0000 (16:11 +0300)]
platform/mellanox: mlxbf-pmc: fix signedness bugs

These need to be signed for the error handling to work.  The
mlxbf_pmc_get_event_num() function returns int so int type is correct.

Fixes: 1ae9ffd303c2 ("platform/mellanox: mlxbf-pmc: Cleanup signed/unsigned mix-up")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/a4af764e-990b-4ebd-b342-852844374032@moroto.mountain
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoplatform/x86: ISST: Allow reading core-power state on HWP disabled systems
Srinivas Pandruvada [Thu, 29 Feb 2024 00:26:59 +0000 (16:26 -0800)]
platform/x86: ISST: Allow reading core-power state on HWP disabled systems

When HWP (Hardware P-states) is disabled, dynamic SST features are
disabled. But user should still be able to read the current core-power
state, with legacy P-states. This will allow users to read current
configuration with static SST enabled from BIOS.

To address this, do not call disable_dynamic_sst_features() when the
request is for reading the state.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Link: https://lore.kernel.org/r/20240229002659.1416623-1-srinivas.pandruvada@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoplatform/x86: thinkpad_acpi: Add more ThinkPads with non-standard reg address for fan
Vishnu Sankar [Wed, 28 Feb 2024 15:01:49 +0000 (00:01 +0900)]
platform/x86: thinkpad_acpi: Add more ThinkPads with non-standard reg address for fan

Add more ThinkPads with non-standard register addresses to read fan values.

ThinkPads added are L13 Yoga Gen1, X13 Yoga Gen1, L380, L390, 11e Gen5 GL,
11e Gen5 GL-R, 11e Gen5 KL-Y.

Signed-off-by: Vishnu Sankar <vishnuocv@gmail.com>
Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240228150149.4799-1-vishnuocv@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoplatform/x86: touchscreen_dmi: Add an extra entry for a variant of the Chuwi Vi8...
Alban Boyé [Tue, 27 Feb 2024 22:40:17 +0000 (22:40 +0000)]
platform/x86: touchscreen_dmi: Add an extra entry for a variant of the Chuwi Vi8 tablet

Signed-off-by: Alban Boyé <alban.boye@protonmail.com>
Link: https://lore.kernel.org/r/20240227223919.11587-1-alban.boye@protonmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
6 months agoplatform/x86/intel/pmc/arl: Put GNA device in D3
David E. Box [Tue, 27 Feb 2024 19:01:34 +0000 (11:01 -0800)]
platform/x86/intel/pmc/arl: Put GNA device in D3

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: 83f168a1a437 ("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>
6 months agoplatform/x86/intel/pmc/lnl: Remove SSRAM support
David E. Box [Tue, 27 Feb 2024 19:01:33 +0000 (11:01 -0800)]
platform/x86/intel/pmc/lnl: Remove SSRAM support

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: 3748dfdae2a6 ("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>
6 months agoplatform/x86/intel/vsec: Remove nuisance message
David E. Box [Tue, 27 Feb 2024 19:01:32 +0000 (11:01 -0800)]
platform/x86/intel/vsec: Remove nuisance message

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>
6 months agoplatform/x86: acer-wmi: Add predator_v4 module parameter
SungHwan Jung [Tue, 20 Feb 2024 08:04:16 +0000 (17:04 +0900)]
platform/x86: acer-wmi: Add predator_v4 module parameter

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>
6 months agoplatform/x86: acer-wmi: Add support for Acer PH16-71
SungHwan Jung [Tue, 20 Feb 2024 05:52:31 +0000 (14:52 +0900)]
platform/x86: acer-wmi: Add support for Acer PH16-71

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>
6 months agoplatform/x86: intel_scu_ipcutil: Make scu static
Armin Wolf [Fri, 23 Feb 2024 16:39:01 +0000 (17:39 +0100)]
platform/x86: intel_scu_ipcutil: Make scu static

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>
6 months agoplatform/x86/amd/pmf: Add missing __iomem attribute to policy_base
Armin Wolf [Fri, 23 Feb 2024 16:38:59 +0000 (17:38 +0100)]
platform/x86/amd/pmf: Add missing __iomem attribute to policy_base

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>
6 months agoplatform/x86: wmi: Remove obsolete duplicate GUID allowlist
Armin Wolf [Mon, 26 Feb 2024 19:35:57 +0000 (20:35 +0100)]
platform/x86: wmi: Remove obsolete duplicate GUID allowlist

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>
6 months agoplatform/x86: wmi: Do not instantiate older WMI drivers multiple times
Armin Wolf [Mon, 26 Feb 2024 19:35:56 +0000 (20:35 +0100)]
platform/x86: wmi: Do not instantiate older WMI drivers multiple times

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>
6 months agoplatform/x86: wmi: Ignore duplicated GUIDs in legacy matches
Armin Wolf [Mon, 26 Feb 2024 19:35:55 +0000 (20:35 +0100)]
platform/x86: wmi: Ignore duplicated GUIDs in legacy matches

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>
6 months agoplatform/x86: ideapad-laptop: map Fn + R key to KEY_REFRESH_RATE_TOGGLE
Gergo Koteles [Sun, 10 Mar 2024 11:31:42 +0000 (12:31 +0100)]
platform/x86: ideapad-laptop: map Fn + R key to KEY_REFRESH_RATE_TOGGLE

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>
6 months agoInput: allocate keycode for Display refresh rate toggle
Gergo Koteles [Sun, 10 Mar 2024 11:31:41 +0000 (12:31 +0100)]
Input: allocate keycode for Display refresh rate toggle

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>
7 months agoplatform/mellanox: mlxbf-pmc: Ignore unsupported performance blocks
Luiz Capitulino [Thu, 22 Feb 2024 20:57:30 +0000 (15:57 -0500)]
platform/mellanox: mlxbf-pmc: Ignore unsupported performance blocks

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>
7 months agoplatform/mellanox: mlxbf-pmc: mlxbf_pmc_event_list(): make size ptr optional
Luiz Capitulino [Thu, 22 Feb 2024 20:57:29 +0000 (15:57 -0500)]
platform/mellanox: mlxbf-pmc: mlxbf_pmc_event_list(): make size ptr optional

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>
7 months agoplatform/x86: dell-privacy: Remove usage of wmi_has_guid()
Armin Wolf [Fri, 23 Feb 2024 16:29:05 +0000 (17:29 +0100)]
platform/x86: dell-privacy: Remove usage of wmi_has_guid()

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>
7 months agoRevert "platform/x86: asus-wmi: Support WMI event queue"
Armin Wolf [Mon, 19 Feb 2024 11:59:19 +0000 (12:59 +0100)]
Revert "platform/x86: asus-wmi: Support WMI event queue"

This reverts commit 1a373d15e283937b51eaf5debf4fc31474c31436.

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>
7 months agoplatform/x86: wmi: Update documentation regarding _WED
Armin Wolf [Mon, 19 Feb 2024 11:59:18 +0000 (12:59 +0100)]
platform/x86: wmi: Update documentation regarding _WED

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>
7 months agoplatform/x86: wmi: Always evaluate _WED when receiving an event
Armin Wolf [Mon, 19 Feb 2024 11:59:17 +0000 (12:59 +0100)]
platform/x86: wmi: Always evaluate _WED when receiving an event

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>
7 months agoplatform/x86: wmi: Check if event data is not NULL
Armin Wolf [Mon, 19 Feb 2024 11:59:16 +0000 (12:59 +0100)]
platform/x86: wmi: Check if event data is not NULL

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>
7 months agoplatform/x86: wmi: Prevent incompatible event driver from probing
Armin Wolf [Mon, 19 Feb 2024 11:59:15 +0000 (12:59 +0100)]
platform/x86: wmi: Prevent incompatible event driver from probing

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>
7 months agoplatform/x86/fujitsu-laptop: Add battery charge control support
Szilard Fabian [Thu, 15 Feb 2024 20:31:43 +0000 (20:31 +0000)]
platform/x86/fujitsu-laptop: Add battery charge control support

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>
7 months agoplatform/x86: thinkpad_acpi: Fix to correct wrong temp reporting on some ThinkPads
Vishnu Sankar [Thu, 15 Feb 2024 13:41:02 +0000 (22:41 +0900)]
platform/x86: thinkpad_acpi: Fix to correct wrong temp reporting on some ThinkPads

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>
7 months agoplatform/x86: thinkpad_acpi: Simplify thermal mode checking
Vishnu Sankar [Thu, 15 Feb 2024 13:41:01 +0000 (22:41 +0900)]
platform/x86: thinkpad_acpi: Simplify thermal mode checking

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>
7 months agoplatform/x86: ideapad-laptop: support Fn+R dual-function key
Gergo Koteles [Sat, 10 Feb 2024 22:51:57 +0000 (23:51 +0100)]
platform/x86: ideapad-laptop: support Fn+R dual-function key

According to the manual, Fn+R adjusts the display refresh rate.
Map Fn+R to KEY_DISPLAYTOGGLE.

Signed-off-by: Gergo Koteles <soyer@irl.hu>
Link: https://lore.kernel.org/r/0cdbc0e6eb65e160384ae0ed152e7de3ded1d9d5.1707604991.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>
7 months agoplatform/mellanox: mlxbf-pmc: Cleanup signed/unsigned mix-up
Shravan Kumar Ramani [Tue, 13 Feb 2024 11:15:26 +0000 (06:15 -0500)]
platform/mellanox: mlxbf-pmc: Cleanup signed/unsigned mix-up

Use unsigned integer types for register values and array indices.
Use %u instead of %d accordingly.

Signed-off-by: Shravan Kumar Ramani <shravankr@nvidia.com>
Link: https://lore.kernel.org/r/d8548c70339a29258a906b2b518e5c48f669795c.1707808180.git.shravankr@nvidia.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
7 months agoplatform/mellanox: mlxbf-pmc: Replace uintN_t with kernel-style types
Shravan Kumar Ramani [Tue, 13 Feb 2024 11:15:25 +0000 (06:15 -0500)]
platform/mellanox: mlxbf-pmc: Replace uintN_t with kernel-style types

Use u8, u32 and u64 instead of respective uintN_t types.
Remove unnecessary newlines for function argument lists.

Signed-off-by: Shravan Kumar Ramani <shravankr@nvidia.com>
Link: https://lore.kernel.org/r/39be055af3506ce6f843d11e45d71620f2a96e26.1707808180.git.shravankr@nvidia.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
7 months agoplatform/x86: wmi: Make input buffer mandatory when evaluating methods
Armin Wolf [Mon, 12 Feb 2024 18:50:16 +0000 (19:50 +0100)]
platform/x86: wmi: Make input buffer mandatory when evaluating methods

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>
7 months agoMerge tag 'platform-drivers-x86-v6.8-2' into pdx/for-next
Ilpo Järvinen [Thu, 8 Feb 2024 11:49:31 +0000 (13:49 +0200)]
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.

7 months agoplatform/x86: wmi: Replace pr_err() with dev_err()
Armin Wolf [Tue, 6 Feb 2024 22:04:47 +0000 (23:04 +0100)]
platform/x86: wmi: Replace pr_err() with dev_err()

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>
7 months agoplatform/x86: wmi: Remove unnecessary out-of-memory message
Armin Wolf [Tue, 6 Feb 2024 22:04:46 +0000 (23:04 +0100)]
platform/x86: wmi: Remove unnecessary out-of-memory message

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>
7 months agoplatform/x86: wmi: Use FW_BUG when warning about missing control methods
Armin Wolf [Tue, 6 Feb 2024 22:04:45 +0000 (23:04 +0100)]
platform/x86: wmi: Use FW_BUG when warning about missing control methods

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>
7 months agoplatform/x86: wmi: Check if WMxx control method exists
Armin Wolf [Tue, 6 Feb 2024 22:04:44 +0000 (23:04 +0100)]
platform/x86: wmi: Check if WMxx control method exists

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>
7 months agoplatform/surface: aggregator_registry: add entry for fan speed
Ivor Wanders [Wed, 31 Jan 2024 00:58:56 +0000 (19:58 -0500)]
platform/surface: aggregator_registry: add entry for fan speed

Add an entry for the fan speed function.
Add this new entry to the Surface Pro 9 group.

Signed-off-by: Ivor Wanders <ivor@iwanders.net>
Link: https://github.com/linux-surface/kernel/pull/144
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Link: https://lore.kernel.org/r/20240131005856.10180-3-ivor@iwanders.net
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
7 months agoplatform: x86: ibm_rtl: make rtl_subsys const
Ricardo B. Marliere [Sun, 4 Feb 2024 14:40:17 +0000 (11:40 -0300)]
platform: x86: ibm_rtl: make rtl_subsys const

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>
7 months agoplatform: x86: wmi: make wmi_bus_type const
Ricardo B. Marliere [Sun, 4 Feb 2024 14:40:16 +0000 (11:40 -0300)]
platform: x86: wmi: make wmi_bus_type const

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>
7 months agoplatform/x86: hp-wmi: Add thermal profile support for 8BAD boards
Alexis Belmonte [Thu, 1 Feb 2024 13:29:33 +0000 (14:29 +0100)]
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>
7 months agoplatform/x86: hp-wmi: Tidy up module source code
Alexis Belmonte [Thu, 1 Feb 2024 13:29:16 +0000 (14:29 +0100)]
platform/x86: hp-wmi: Tidy up module source code

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>
7 months agoplatform/x86: wmi: Stop using ACPI device class
Armin Wolf [Tue, 30 Jan 2024 22:19:42 +0000 (23:19 +0100)]
platform/x86: wmi: Stop using ACPI device class

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>
7 months agoplatform/x86/intel/ifs: Remove unnecessary initialization of 'ret'
Ilpo Järvinen [Thu, 25 Jan 2024 13:03:28 +0000 (15:03 +0200)]
platform/x86/intel/ifs: Remove unnecessary initialization of 'ret'

The ret variable is unconditionally assigned in ifs_load_firmware().
Therefore, remove its unnecessary initialization.

Reviewed-by: Ashok Raj <ashok.raj@intel.com>
Link: https://lore.kernel.org/r/20240125130328.11253-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
7 months agoplatform/x86/intel/ifs: Add an entry rendezvous for SAF
Ashok Raj [Thu, 25 Jan 2024 08:22:54 +0000 (00:22 -0800)]
platform/x86/intel/ifs: Add an entry rendezvous for SAF

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>
7 months agoplatform/x86/intel/ifs: Replace the exit rendezvous with an entry rendezvous for...
Ashok Raj [Thu, 25 Jan 2024 08:22:53 +0000 (00:22 -0800)]
platform/x86/intel/ifs: Replace the exit rendezvous with an entry rendezvous for ARRAY_BIST

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>
7 months agoplatform/x86/intel/ifs: Add current batch number to trace output
Ashok Raj [Thu, 25 Jan 2024 08:22:52 +0000 (00:22 -0800)]
platform/x86/intel/ifs: Add current batch number to trace output

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>
7 months agoplatform/x86/intel/ifs: Trace on all HT threads when executing a test
Ashok Raj [Thu, 25 Jan 2024 08:22:51 +0000 (00:22 -0800)]
platform/x86/intel/ifs: Trace on all HT threads when executing a test

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>
7 months agoplatform/x86/amd/hsmp: Change devm_kzalloc() to devm_kcalloc()
Suma Hegde [Thu, 25 Jan 2024 12:54:01 +0000 (12:54 +0000)]
platform/x86/amd/hsmp: Change devm_kzalloc() to devm_kcalloc()

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>
7 months agoplatform/x86/amd/hsmp: Remove extra parenthesis and add a space
Suma Hegde [Sat, 6 Jan 2024 02:25:32 +0000 (02:25 +0000)]
platform/x86/amd/hsmp: Remove extra parenthesis and add a space

Remove unnecessary parenthesis around hsmp_get_tbl_dram_base().

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-11-suma.hegde@amd.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
7 months agoplatform/x86/amd/hsmp: Check num_sockets against MAX_AMD_SOCKETS
Suma Hegde [Sat, 6 Jan 2024 02:25:30 +0000 (02:25 +0000)]
platform/x86/amd/hsmp: Check num_sockets against MAX_AMD_SOCKETS

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>
7 months agoplatform/x86/amd/hsmp: Non-ACPI support for AMD F1A_M00~0Fh
Suma Hegde [Sat, 6 Jan 2024 02:25:29 +0000 (02:25 +0000)]
platform/x86/amd/hsmp: Non-ACPI support for AMD F1A_M00~0Fh

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>
7 months agoplatform/x86/amd/hsmp: Add support for ACPI based probing
Suma Hegde [Sat, 6 Jan 2024 02:25:28 +0000 (02:25 +0000)]
platform/x86/amd/hsmp: Add support for ACPI based probing

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>
7 months agoplatform/x86/amd/hsmp: Restructure sysfs group creation
Suma Hegde [Sat, 6 Jan 2024 02:25:27 +0000 (02:25 +0000)]
platform/x86/amd/hsmp: Restructure sysfs group creation

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>
7 months agoplatform/x86/amd/hsmp: Move dev from platdev to hsmp_socket
Suma Hegde [Sat, 6 Jan 2024 02:25:26 +0000 (02:25 +0000)]
platform/x86/amd/hsmp: Move dev from platdev to hsmp_socket

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>
8 months agoplatform/x86: touchscreen_dmi: Add info for the TECLAST X16 Plus tablet
Phoenix Chen [Fri, 26 Jan 2024 09:53:08 +0000 (17:53 +0800)]
platform/x86: touchscreen_dmi: Add info for the TECLAST X16 Plus tablet

Add touch screen info for TECLAST X16 Plus tablet.

Signed-off-by: Phoenix Chen <asbeltogf@gmail.com>
Link: https://lore.kernel.org/r/20240126095308.5042-1-asbeltogf@gmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86/intel/ifs: Call release_firmware() when handling errors.
Jithu Joseph [Thu, 25 Jan 2024 08:22:50 +0000 (00:22 -0800)]
platform/x86/intel/ifs: Call release_firmware() when handling errors.

Missing release_firmware() due to error handling blocked any future image
loading.

Fix the return code and release_fiwmare() to release the bad image.

Fixes: 25a76dbb36dd ("platform/x86/intel/ifs: Validate image size")
Reported-by: Pengfei Xu <pengfei.xu@intel.com>
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Tested-by: Pengfei Xu <pengfei.xu@intel.com>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240125082254.424859-2-ashok.raj@intel.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86/amd/pmf: Fix memory leak in amd_pmf_get_pb_data()
Cong Liu [Wed, 24 Jan 2024 01:29:38 +0000 (09:29 +0800)]
platform/x86/amd/pmf: Fix memory leak in amd_pmf_get_pb_data()

amd_pmf_get_pb_data() will allocate memory for the policy buffer,
but does not free it if copy_from_user() fails. This leads to a memory
leak.

Fixes: 10817f28e533 ("platform/x86/amd/pmf: Add capability to sideload of policy binary")
Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Signed-off-by: Cong Liu <liucong2@kylinos.cn>
Link: https://lore.kernel.org/r/20240124012939.6550-1-liucong2@kylinos.cn
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86/amd/pmf: Get ambient light information from AMD SFH driver
Shyam Sundar S K [Tue, 23 Jan 2024 14:14:58 +0000 (19:44 +0530)]
platform/x86/amd/pmf: Get ambient light information from AMD SFH driver

AMD SFH driver has APIs defined to export the ambient light information;
use this within the PMF driver to send inputs to the PMF TA, so that PMF
driver can enact to the actions coming from the TA.

Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20240123141458.3715211-2-Shyam-sundar.S-k@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86/amd/pmf: Get Human presence information from AMD SFH driver
Shyam Sundar S K [Tue, 23 Jan 2024 14:14:57 +0000 (19:44 +0530)]
platform/x86/amd/pmf: Get Human presence information from AMD SFH driver

AMD SFH driver has APIs defined to export the human presence information;
use this within the PMF driver to send inputs to the PMF TA, so that PMF
driver can enact to the actions coming from the TA.

Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20240123141458.3715211-1-Shyam-sundar.S-k@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86/amd/hsmp: Define a struct to hold mailbox regs
Suma Hegde [Sat, 6 Jan 2024 02:25:25 +0000 (02:25 +0000)]
platform/x86/amd/hsmp: Define a struct to hold mailbox regs

Define struct hsmp_mbaddr_info with register offsets and populate
them during probe, which avoids the usage of macros in core functions.

During ACPI probe, the same fields can be populated from ACPI table.

Also move plat dev init to a static function.

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-4-suma.hegde@amd.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
8 months agoplatform/x86/amd/hsmp: Create static func to handle platdev
Suma Hegde [Sat, 6 Jan 2024 02:25:24 +0000 (02:25 +0000)]
platform/x86/amd/hsmp: Create static func to handle platdev

Create a static function and call platform device alloc and add device,
which will simplify handling acpi and plat device probing.

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-3-suma.hegde@amd.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
8 months agoplatform/x86/amd/hsmp: Cache pci_dev in struct hsmp_socket
Suma Hegde [Sat, 6 Jan 2024 02:25:23 +0000 (02:25 +0000)]
platform/x86/amd/hsmp: Cache pci_dev in struct hsmp_socket

Cache pci_dev obj during probe as part of struct hsmp_socket
and use in amd_hsmp_rdwr(). This change will make it easier to
support both non-ACPI and ACPI devices.

Also add a check for sock_index agsint number of sockets
in the hsmp_send_message().

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-2-suma.hegde@amd.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
8 months agoplatform/x86/amd/hsmp: Move hsmp_test to probe
Suma Hegde [Sat, 6 Jan 2024 02:25:22 +0000 (02:25 +0000)]
platform/x86/amd/hsmp: Move hsmp_test to probe

This is in advance to supporting ACPI based probe.

In case of non-ACPI driver, hsmp_test() can be
performed either in plat init() or in probe().

however, in case of ACPI probing, hsmp_test() cannot
be called in init(), as the mailbox reg offsets and
base addresses are read from ACPI table in the probe().

Hence, move hsmp_test() to probe as preparation for
ACPI support.

Also use hsmp_send_message() directly in hsmp_test()
as the semaphore is already initialized in probe.

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-1-suma.hegde@amd.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
8 months agoplatform/x86: wmi: Use ACPI device name in netlink event
Armin Wolf [Sun, 21 Jan 2024 20:08:24 +0000 (21:08 +0100)]
platform/x86: wmi: Use ACPI device name in netlink event

The device name inside the ACPI netlink event is limited to
15 characters, so the WMI device name will get truncated.

This can be observed with kacpimon when receiving an event
from WMI device "9DBB5994-A997-11DA-B012-B622A1EF5492":

netlink:  9DBB5994-A997- 000000d0 00000000

Fix this by using the shorter device name from the ACPI
bus device instead. This still allows users to uniquely
identify the WMI device by using the notify id (0xd0).

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240121200824.2778-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>
8 months agodrivers/platform/mellanox: Convert snprintf to sysfs_emit
Li Zhijian [Tue, 16 Jan 2024 04:51:23 +0000 (12:51 +0800)]
drivers/platform/mellanox: Convert snprintf to sysfs_emit

Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

> ./drivers/platform/mellanox/mlxbf-bootctl.c:466:8-16: WARNING: please use sysfs_emit
> ./drivers/platform/mellanox/mlxbf-bootctl.c:584:8-16: WARNING: please use sysfs_emit
> ./drivers/platform/mellanox/mlxbf-bootctl.c:635:8-16: WARNING: please use sysfs_emit
> ./drivers/platform/mellanox/mlxbf-bootctl.c:686:8-16: WARNING: please use sysfs_emit
> ./drivers/platform/mellanox/mlxbf-bootctl.c:737:8-16: WARNING: please use sysfs_emit
> ./drivers/platform/mellanox/mlxbf-bootctl.c:788:8-16: WARNING: please use sysfs_emit
> ./drivers/platform/mellanox/mlxbf-bootctl.c:839:8-16: WARNING: please use sysfs_emit

No functional change intended

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Link: https://lore.kernel.org/r/20240116045151.3940401-12-lizhijian@fujitsu.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
8 months agoplatform/x86: Support for mode FN key
Mark Pearson [Sat, 20 Jan 2024 23:29:34 +0000 (18:29 -0500)]
platform/x86: Support for mode FN key

New Thinkpads have added a 'Mode' Function key that on Windows allows
you to choose the active profile (low-power, balanced, performance)

Added suppoort for this hotkey (F8), and have it cycle through the
options available.

Tested on X1 Carbon G12.

Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240120232949.317337-1-mpearson-lenovo@squebb.ca
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
8 months agoplatform/x86: remove obsolete calls to ledtrig_audio_get
Heiner Kallweit [Sun, 14 Jan 2024 17:14:54 +0000 (18:14 +0100)]
platform/x86: remove obsolete calls to ledtrig_audio_get

Since 64f67b5240db ("leds: trigger: audio: Add an activate callback to
ensure the initial brightness is set") the audio triggers have an
activate callback which sets the LED brightness as soon as the
(default) trigger is bound to the LED device. So we can remove the
call to ledtrig_audio_get.

Positive side effect: There's no code dependency to ledtrig-audio any
longer, what allows to remove some Kconfig dependencies.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/daef7331-dcb4-4b3a-802e-656629486b4c@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
8 months agoplatform/x86: silicom-platform: clean up a check
Dan Carpenter [Fri, 12 Jan 2024 06:56:25 +0000 (09:56 +0300)]
platform/x86: silicom-platform: clean up a check

The error message in this code can't be reached because value is either
zero or non-zero.  There isn't a third option.  Really, it's nicer to
write this as a one liner.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/a58bffb7-0a8b-4195-b273-f65a188ace7b@moroto.mountain
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
8 months agoplatform/x86: thinkpad_acpi: remove redundant assignment to variable i
Colin Ian King [Sat, 6 Jan 2024 15:47:40 +0000 (15:47 +0000)]
platform/x86: thinkpad_acpi: remove redundant assignment to variable i

The variable i is being initialized with the value 0 that is never
read, it is being re-assigned 0 again in a for-loop statement later
on. The initialization is redundant and can be removed.

The initialization of variable n can also be deferred after the
sanity check on pointer n and the declaration of all the int variables
can be combined as a final code clear-up.

Cleans up clang scan build warning:
warning: Value stored to 'i' is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240106154740.55202-1-colin.i.king@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
8 months agoplatform/mellanox: mlxbf-pmc: Fix offset calculation for crspace events
Shravan Kumar Ramani [Wed, 17 Jan 2024 10:01:34 +0000 (05:01 -0500)]
platform/mellanox: mlxbf-pmc: Fix offset calculation for crspace events

The event selector fields for 2 counters are contained in one
32-bit register and the current logic does not account for this.

Fixes: 423c3361855c ("platform/mellanox: mlxbf-pmc: Add support for BlueField-3")
Signed-off-by: Shravan Kumar Ramani <shravankr@nvidia.com>
Reviewed-by: David Thompson <davthompson@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/8834cfa496c97c7c2fcebcfca5a2aa007e20ae96.1705485095.git.shravankr@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full
Liming Sun [Thu, 11 Jan 2024 17:31:06 +0000 (12:31 -0500)]
platform/mellanox: mlxbf-tmfifo: Drop Tx network packet when Tx TmFIFO is full

Starting from Linux 5.16 kernel, Tx timeout mechanism was added
in the virtio_net driver which prints the "Tx timeout" warning
message when a packet stays in Tx queue for too long. Below is an
example of the reported message:

"[494105.316739] virtio_net virtio1 tmfifo_net0: TX timeout on
queue: 0, sq: output.0, vq: 0×1, name: output.0, usecs since
last trans: 3079892256".

This issue could happen when external host driver which drains the
FIFO is restared, stopped or upgraded. To avoid such confusing
"Tx timeout" messages, this commit adds logic to drop the outstanding
Tx packet if it's not able to transmit in two seconds due to Tx FIFO
full, which can be considered as congestion or out-of-resource drop.

This commit also handles the special case that the packet is half-
transmitted into the Tx FIFO. In such case, the packet is discarded
with remaining length stored in vring->rem_padding. So paddings with
zeros can be sent out when Tx space is available to maintain the
integrity of the packet format. The padded packet will be dropped on
the receiving side.

Signed-off-by: Liming Sun <limings@nvidia.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240111173106.96958-1-limings@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoMAINTAINERS: remove defunct acpi4asus project info from asus notebooks section
Hans de Goede [Tue, 16 Jan 2024 10:39:21 +0000 (11:39 +0100)]
MAINTAINERS: remove defunct acpi4asus project info from asus notebooks section

The acpi4asus project appears to be defunct, according to:
https://sourceforge.net/p/acpi4asus/mailman/acpi4asus-user/
the last posts to the list were done in May 2020 and even then
they were mostly spam.

And the http://acpi4asus.sf.net website still talks about 2.6.x kernels.

Drop the defunct mailing-list and update the W: entry to point to
the new up2date https://asus-linux.org/ site.

Cc: Corentin Chary <corentin.chary@gmail.com>
Cc: Luke D. Jones <luke@ljones.dev>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoMAINTAINERS: add Luke Jones as maintainer for asus notebooks
Luke D. Jones [Mon, 15 Jan 2024 21:18:29 +0000 (10:18 +1300)]
MAINTAINERS: add Luke Jones as maintainer for asus notebooks

Add myself as maintainer for "ASUS NOTEBOOKS AND EEEPC ACPI/WMI EXTRAS
DRIVERS" as suggested by Hans de Goede based on my history of
contributions.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20240115211829.48251-1-luke@ljones.dev
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoMAINTAINERS: Remove Perry Yuan as DELL WMI HARDWARE PRIVACY SUPPORT maintainer
Heiner Kallweit [Sun, 14 Jan 2024 16:53:16 +0000 (17:53 +0100)]
MAINTAINERS: Remove Perry Yuan as DELL WMI HARDWARE PRIVACY SUPPORT maintainer

Recent mails to his Dell address bounced with "user unknown".
So remove him as maintainer.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/c9757d0a-2046-464b-93e1-a2d9ab0ce36b@gmail.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86: silicom-platform: Add missing "Description:" for power_cycle sysfs...
Hans de Goede [Mon, 8 Jan 2024 14:06:55 +0000 (15:06 +0100)]
platform/x86: silicom-platform: Add missing "Description:" for power_cycle sysfs attr

The Documentation/ABI/testing/sysfs-platform-silicom entry
for the power_cycle sysfs attr is missing the "Description:" keyword,
add this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240108140655.547261-1-hdegoede@redhat.com
8 months agoplatform/x86: intel-wmi-sbl-fw-update: Fix function name in error message
Armin Wolf [Sat, 6 Jan 2024 22:41:26 +0000 (23:41 +0100)]
platform/x86: intel-wmi-sbl-fw-update: Fix function name in error message

Since when the driver was converted to use the bus-based WMI
interface, the old GUID-based WMI functions are not used anymore.
Update the error message to avoid confusing users.

Compile-tested only.

Fixes: 75c487fcb69c ("platform/x86: intel-wmi-sbl-fw-update: Use bus-based WMI interface")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240106224126.13803-1-W_Armin@gmx.de
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86: p2sb: Use pci_resource_n() in p2sb_read_bar0()
Shin'ichiro Kawasaki [Mon, 8 Jan 2024 06:20:59 +0000 (15:20 +0900)]
platform/x86: p2sb: Use pci_resource_n() in p2sb_read_bar0()

Accesses to resource[] member of struct pci_dev shall be wrapped with
pci_resource_n() for future compatibility. Call the helper function in
p2sb_read_bar0().

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240108062059.3583028-3-shinichiro.kawasaki@wdc.com
Tested-by Klara Modin <klarasmodin@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe
Shin'ichiro Kawasaki [Mon, 8 Jan 2024 06:20:58 +0000 (15:20 +0900)]
platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe

p2sb_bar() unhides P2SB device to get resources from the device. It
guards the operation by locking pci_rescan_remove_lock so that parallel
rescans do not find the P2SB device. However, this lock causes deadlock
when PCI bus rescan is triggered by /sys/bus/pci/rescan. The rescan
locks pci_rescan_remove_lock and probes PCI devices. When PCI devices
call p2sb_bar() during probe, it locks pci_rescan_remove_lock again.
Hence the deadlock.

To avoid the deadlock, do not lock pci_rescan_remove_lock in p2sb_bar().
Instead, do the lock at fs_initcall. Introduce p2sb_cache_resources()
for fs_initcall which gets and caches the P2SB resources. At p2sb_bar(),
refer the cache and return to the caller.

Before operating the device at P2SB DEVFN for resource cache, check
that its device class is PCI_CLASS_MEMORY_OTHER 0x0580 that PCH
specifications define. This avoids unexpected operation to other devices
at the same DEVFN.

Link: https://lore.kernel.org/linux-pci/6xb24fjmptxxn5js2fjrrddjae6twex5bjaftwqsuawuqqqydx@7cl3uik5ef6j/
Fixes: 9745fb07474f ("platform/x86/intel: Add Primary to Sideband (P2SB) bridge support")
Cc: stable@vger.kernel.org
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Link: https://lore.kernel.org/r/20240108062059.3583028-2-shinichiro.kawasaki@wdc.com
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tested-by Klara Modin <klarasmodin@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86: intel-uncore-freq: Fix types in sysfs callbacks
Nathan Chancellor [Thu, 4 Jan 2024 22:59:03 +0000 (15:59 -0700)]
platform/x86: intel-uncore-freq: Fix types in sysfs callbacks

When booting a kernel with CONFIG_CFI_CLANG, there is a CFI failure when
accessing any of the values under
/sys/devices/system/cpu/intel_uncore_frequency/package_00_die_00:

  $ cat /sys/devices/system/cpu/intel_uncore_frequency/package_00_die_00/max_freq_khz
  fish: Job 1, 'cat /sys/devices/system/cpu/int…' terminated by signal SIGSEGV (Address boundary error)

  $ sudo dmesg &| grep 'CFI failure'
  [  170.953925] CFI failure at kobj_attr_show+0x19/0x30 (target: show_max_freq_khz+0x0/0xc0 [intel_uncore_frequency_common]; expected type: 0xd34078c5

The sysfs callback functions such as show_domain_id() are written as if
they are going to be called by dev_attr_show() but as the above message
shows, they are instead called by kobj_attr_show(). kCFI checks that the
destination of an indirect jump has the exact same type as the prototype
of the function pointer it is called through and fails when they do not.

These callbacks are called through kobj_attr_show() because
uncore_root_kobj was initialized with kobject_create_and_add(), which
means uncore_root_kobj has a ->sysfs_ops of kobj_sysfs_ops from
kobject_create(), which uses kobj_attr_show() as its ->show() value.

The only reason there has not been a more noticeable problem until this
point is that 'struct kobj_attribute' and 'struct device_attribute' have
the same layout, so getting the callback from container_of() works the
same with either value.

Change all the callbacks and their uses to be compatible with
kobj_attr_show() and kobj_attr_store(), which resolves the kCFI failure
and allows the sysfs files to work properly.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1974
Fixes: ae7b2ce57851 ("platform/x86/intel/uncore-freq: Use sysfs API to create attributes")
Cc: stable@vger.kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Link: https://lore.kernel.org/r/20240104-intel-uncore-freq-kcfi-fix-v1-1-bf1e8939af40@kernel.org
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86: wmi: Fix wmi_dev_probe()
Dan Carpenter [Fri, 5 Jan 2024 13:47:54 +0000 (16:47 +0300)]
platform/x86: wmi: Fix wmi_dev_probe()

This has a reversed if statement so it accidentally disables the wmi
method before returning.

Fixes: 704af3a40747 ("platform/x86: wmi: Remove chardev interface")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/9c81251b-bc87-4ca3-bb86-843dc85e5145@moroto.mountain
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86: wmi: Fix notify callback locking
Armin Wolf [Wed, 3 Jan 2024 19:27:07 +0000 (20:27 +0100)]
platform/x86: wmi: Fix notify callback locking

When an legacy WMI event handler is removed, an WMI event could
have called the handler just before it was removed, meaning the
handler could still be running after wmi_remove_notify_handler()
returns.
Something similar could also happens when using the WMI bus, as
the WMI core might still call the notify() callback from an WMI
driver even if its remove() callback was just called.

Fix this by introducing a rw semaphore which ensures that the
event state of a WMI device does not change while the WMI core
is handling an event for it.

Tested on a Dell Inspiron 3505 and a Acer Aspire E1-731.

Fixes: 1686f5444546 ("platform/x86: wmi: Incorporate acpi_install_notify_handler")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240103192707.115512-5-W_Armin@gmx.de
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86: wmi: Decouple legacy WMI notify handlers from wmi_block_list
Armin Wolf [Wed, 3 Jan 2024 19:27:06 +0000 (20:27 +0100)]
platform/x86: wmi: Decouple legacy WMI notify handlers from wmi_block_list

Until now, legacy WMI notify handler functions where using the
wmi_block_list, which did no refcounting on the returned WMI device.
This meant that the WMI device could disappear at any moment,
potentially leading to various errors.
Fix this by using bus_find_device() which returns an actual
reference to the found WMI device.

Tested on a Dell Inspiron 3505 and a Acer Aspire E1-731.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240103192707.115512-4-W_Armin@gmx.de
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86: wmi: Return immediately if an suitable WMI event is found
Armin Wolf [Wed, 3 Jan 2024 19:27:05 +0000 (20:27 +0100)]
platform/x86: wmi: Return immediately if an suitable WMI event is found

Commit 58f6425eb92f ("WMI: Cater for multiple events with same GUID")
allowed legacy WMI notify handlers to be installed for multiple WMI
devices with the same GUID.
However this is useless since the legacy GUID-based interface is
blacklisted from seeing WMI devices with duplicated GUIDs.

Return immediately if a suitable WMI event is found in
wmi_install/remove_notify_handler() since searching for other suitable
events is pointless.

Tested on a Dell Inspiron 3505 and a Acer Aspire E1-731.

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240103192707.115512-3-W_Armin@gmx.de
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoplatform/x86: wmi: Fix error handling in legacy WMI notify handler functions
Armin Wolf [Wed, 3 Jan 2024 19:27:04 +0000 (20:27 +0100)]
platform/x86: wmi: Fix error handling in legacy WMI notify handler functions

When wmi_install_notify_handler()/wmi_remove_notify_handler() are
unable to enable/disable the WMI device, they unconditionally return
an error to the caller.
When registering legacy WMI notify handlers, this means that the
callback remains registered despite wmi_install_notify_handler()
having returned an error.
When removing legacy WMI notify handlers, this means that the
callback is removed despite wmi_remove_notify_handler() having
returned an error.

Fix this by only warning when the WMI device could not be enabled.
This behaviour matches the bus-based WMI interface.

Tested on a Dell Inspiron 3505 and a Acer Aspire E1-731.

Fixes: 58f6425eb92f ("WMI: Cater for multiple events with same GUID")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240103192707.115512-2-W_Armin@gmx.de
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
8 months agoLinux 6.8-rc1 v6.8-rc1
Linus Torvalds [Sun, 21 Jan 2024 22:11:32 +0000 (14:11 -0800)]
Linux 6.8-rc1

8 months agoMerge tag 'bcachefs-2024-01-21' of https://evilpiepirate.org/git/bcachefs
Linus Torvalds [Sun, 21 Jan 2024 22:01:12 +0000 (14:01 -0800)]
Merge tag 'bcachefs-2024-01-21' of https://evilpiepirate.org/git/bcachefs

Pull more bcachefs updates from Kent Overstreet:
 "Some fixes, Some refactoring, some minor features:

   - Assorted prep work for disk space accounting rewrite

   - BTREE_TRIGGER_ATOMIC: after combining our trigger callbacks, this
     makes our trigger context more explicit

   - A few fixes to avoid excessive transaction restarts on
     multithreaded workloads: fstests (in addition to ktest tests) are
     now checking slowpath counters, and that's shaking out a few bugs

   - Assorted tracepoint improvements

   - Starting to break up bcachefs_format.h and move on disk types so
     they're with the code they belong to; this will make room to start
     documenting the on disk format better.

   - A few minor fixes"

* tag 'bcachefs-2024-01-21' of https://evilpiepirate.org/git/bcachefs: (46 commits)
  bcachefs: Improve inode_to_text()
  bcachefs: logged_ops_format.h
  bcachefs: reflink_format.h
  bcachefs; extents_format.h
  bcachefs: ec_format.h
  bcachefs: subvolume_format.h
  bcachefs: snapshot_format.h
  bcachefs: alloc_background_format.h
  bcachefs: xattr_format.h
  bcachefs: dirent_format.h
  bcachefs: inode_format.h
  bcachefs; quota_format.h
  bcachefs: sb-counters_format.h
  bcachefs: counters.c -> sb-counters.c
  bcachefs: comment bch_subvolume
  bcachefs: bch_snapshot::btime
  bcachefs: add missing __GFP_NOWARN
  bcachefs: opts->compression can now also be applied in the background
  bcachefs: Prep work for variable size btree node buffers
  bcachefs: grab s_umount only if snapshotting
  ...

8 months agoMerge tag 'timers-core-2024-01-21' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 21 Jan 2024 19:14:40 +0000 (11:14 -0800)]
Merge tag 'timers-core-2024-01-21' of git://git./linux/kernel/git/tip/tip

Pull timer updates from Thomas Gleixner:
 "Updates for time and clocksources:

   - A fix for the idle and iowait time accounting vs CPU hotplug.

     The time is reset on CPU hotplug which makes the accumulated
     systemwide time jump backwards.

   - Assorted fixes and improvements for clocksource/event drivers"

* tag 'timers-core-2024-01-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug
  clocksource/drivers/ep93xx: Fix error handling during probe
  clocksource/drivers/cadence-ttc: Fix some kernel-doc warnings
  clocksource/drivers/timer-ti-dm: Fix make W=n kerneldoc warnings
  clocksource/timer-riscv: Add riscv_clock_shutdown callback
  dt-bindings: timer: Add StarFive JH8100 clint
  dt-bindings: timer: thead,c900-aclint-mtimer: separate mtime and mtimecmp regs