Commit 793582ff authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ACPI updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to upstream revision
  20230331, fix the ACPI SBS driver and the evaluation of the _PDC
  method on Xen dom0 in the ACPI processor driver, update the ACPI
  driver for Intel SoCs and clean up code in multiple places.

  Specifics:

   - Update the ACPICA code in the kernel to upstream revision 20230331
     including the following changes:
       * Delete bogus node_array array of pointers from AEST table
         (Jessica Clarke)
       * Add support for trace buffer extension in GICC to the ACPI MADT
         parser (Xiongfeng Wang)
       * Add missing macro ACPI_FUNCTION_TRACE() for
         acpi_ns_repair_HID() (Xiongfeng Wang)
       * Add missing tables to astable (Pedro Falcato)
       * Add support for 64 bit loong_arch compilation to ACPICA (Huacai
         Chen)
       * Add support for ASPT table in disassembler to ACPICA (Jeremi
         Piotrowski)
       * Add support for Arm's MPAM ACPI table version 2 (Hesham
         Almatary)
       * Update all copyrights/signons in ACPICA to 2023 (Bob Moore)
       * Add support for ClockInput resource (v6.5) (Niyas Sait)
       * Add RISC-V INTC interrupt controller definition to the list of
         supported interrupt controllers for MADT (Sunil V L)
       * Add structure definitions for the RISC-V RHCT ACPI table (Sunil
         V L)
       * Address several cases in which the ACPICA code might lead to
         undefined behavior (Tamir Duberstein)
       * Make ACPICA code support flexible arrays properly (Kees Cook)
       * Check null return of ACPI_ALLOCATE_ZEROED in
         acpi_db_display_objects() (void0red)
       * Add os specific support for Zephyr RTOS to ACPICA (Najumon)
       * Update version to 20230331 (Bob Moore)

   - Fix evaluating the _PDC ACPI control method when running as Xen
     dom0 (Roger Pau Monne)

   - Use platform devices to load ACPI PPC and PCC drivers (Petr Pavlu)

   - Check for null return of devm_kzalloc() in fch_misc_setup() (Kang
     Chen)

   - Log a message if enable_irq_wake() fails for the ACPI SCI (Simon
     Gaiser)

   - Initialize the correct IOMMU fwspec while parsing ACPI VIOT
     (Jean-Philippe Brucker)

   - Amend indentation and prefix error messages with FW_BUG in the ACPI
     SPCR parsing code (Andy Shevchenko)

   - Enable ACPI sysfs support for CCEL records (Kuppuswamy
     Sathyanarayanan)

   - Make the APEI error injection code warn on invalid arguments when
     explicitly indicated by platform (Shuai Xue)

   - Add CXL error types to the error injection code in APEI (Tony Luck)

   - Refactor acpi_data_prop_read_single() (Andy Shevchenko)

   - Fix two issues in the ACPI SBS driver (Armin Wolf)

   - Replace ternary operator with min_t() in the generic ACPI thermal
     zone driver (Jiangshan Yi)

   - Ensure that ACPI notify handlers are not running after removal and
     clean up code in acpi_sb_notify() (Rafael Wysocki)

   - Remove register_backlight_delay module option and code and remove
     quirks for false-positive backlight control support advertised on
     desktop boards (Hans de Goede)

   - Replace irqdomain.h include with struct declarations in ACPI
     headers and update several pieces of code previously including of.h
     implicitly through those headers (Rob Herring)

   - Fix acpi_evaluate_dsm_typed() redefinition error (Kiran K)

   - Update the pm_profile sysfs attribute documentation (Rafael
     Wysocki)

   - Add 80862289 ACPI _HID for second PWM controller on Cherry Trail to
     the ACPI driver for Intel SoCs (Hans de Goede)"

* tag 'acpi-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (64 commits)
  ACPI: LPSS: Add 80862289 ACPI _HID for second PWM controller on Cherry Trail
  ACPI: bus: Ensure that notify handlers are not running after removal
  ACPI: bus: Add missing braces to acpi_sb_notify()
  ACPI: video: Remove desktops without backlight DMI quirks
  ACPI: video: Remove register_backlight_delay module option and code
  ACPI: Replace irqdomain.h include with struct declarations
  fpga: lattice-sysconfig-spi: Add explicit include for of.h
  tpm: atmel: Add explicit include for of.h
  virtio-mmio: Add explicit include for of.h
  pata: ixp4xx: Add explicit include for of.h
  ata: pata_macio: Add explicit include of irqdomain.h
  serial: 8250_tegra: Add explicit include for of.h
  net: rfkill-gpio: Add explicit include for of.h
  staging: iio: resolver: ad2s1210: Add explicit include for of.h
  iio: adc: ad7292: Add explicit include for of.h
  ACPICA: Update version to 20230331
  ACPICA: add os specific support for Zephyr RTOS
  ACPICA: ACPICA: check null return of ACPI_ALLOCATE_ZEROED in acpi_db_display_objects
  ACPICA: acpi_resource_irq: Replace 1-element arrays with flexible array
  ACPICA: acpi_madt_oem_data: Fix flexible array member definition
  ...
parents 5e0ca0bf 4f810294
Loading
Loading
Loading
Loading
+11 −9
Original line number Diff line number Diff line
@@ -2,16 +2,17 @@ What: /sys/firmware/acpi/pm_profile
Date:		03-Nov-2011
KernelVersion:	v3.2
Contact:	linux-acpi@vger.kernel.org
Description:	The ACPI pm_profile sysfs interface exports the platform
		power management (and performance) requirement expectations
		as provided by BIOS. The integer value is directly passed as
		retrieved from the FADT ACPI table.
Description:	The ACPI pm_profile sysfs interface exposes the preferred
		power management (and performance) profile of the platform
		as provided in the ACPI FADT Preferred_PM_Profile field.

Values:	        For possible values see ACPI specification:
		5.2.9 Fixed ACPI Description Table (FADT)
		Field: Preferred_PM_Profile
		The integer value is directly passed as retrieved from the FADT.

		Currently these values are defined by spec:
Values:	        For the possible values refer to the Preferred_PM_Profile field
		definition in Table 5.9 "FADT Format", Section 5.2.9 "Fixed ACPI
		Description Table (FADT)" of the ACPI specification.

		As of ACPI 6.5, the following values are defined:

		== =================
		0  Unspecified
@@ -22,5 +23,6 @@ Values: For possible values see ACPI specification:
		5  SOHO Server
		6  Appliance PC
		7  Performance Server
		>7 Reserved
		8  Tablet
		>8 Reserved
		== =================
+2 −0
Original line number Diff line number Diff line
@@ -83,6 +83,8 @@ static int fch_misc_setup(struct apd_private_data *pdata)
	if (!acpi_dev_get_property(adev, "clk-name", ACPI_TYPE_STRING, &obj)) {
		clk_data->name = devm_kzalloc(&adev->dev, obj->string.length,
					      GFP_KERNEL);
		if (!clk_data->name)
			return -ENOMEM;

		strcpy(clk_data->name, obj->string.pointer);
	} else {
+7 −0
Original line number Diff line number Diff line
@@ -271,6 +271,12 @@ static const struct lpss_device_desc bsw_pwm_dev_desc = {
	.resume_from_noirq = true,
};

static const struct lpss_device_desc bsw_pwm2_dev_desc = {
	.flags = LPSS_SAVE_CTX_ONCE | LPSS_NO_D3_DELAY,
	.prv_offset = 0x800,
	.resume_from_noirq = true,
};

static const struct lpss_device_desc byt_uart_dev_desc = {
	.flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_SAVE_CTX,
	.clk_con_id = "baudclk",
@@ -368,6 +374,7 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
	/* Braswell LPSS devices */
	{ "80862286", LPSS_ADDR(lpss_dma_desc) },
	{ "80862288", LPSS_ADDR(bsw_pwm_dev_desc) },
	{ "80862289", LPSS_ADDR(bsw_pwm2_dev_desc) },
	{ "8086228A", LPSS_ADDR(bsw_uart_dev_desc) },
	{ "8086228E", LPSS_ADDR(bsw_spi_dev_desc) },
	{ "808622C0", LPSS_ADDR(lpss_dma_desc) },
+40 −2
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/platform_device.h>

#include <acpi/processor.h>

@@ -148,6 +149,34 @@ static int acpi_processor_errata(void)
	return result;
}

/* Create a platform device to represent a CPU frequency control mechanism. */
static void cpufreq_add_device(const char *name)
{
	struct platform_device *pdev;

	pdev = platform_device_register_simple(name, PLATFORM_DEVID_NONE, NULL, 0);
	if (IS_ERR(pdev))
		pr_info("%s device creation failed: %ld\n", name, PTR_ERR(pdev));
}

#ifdef CONFIG_X86
/* Check presence of Processor Clocking Control by searching for \_SB.PCCH. */
static void __init acpi_pcc_cpufreq_init(void)
{
	acpi_status status;
	acpi_handle handle;

	status = acpi_get_handle(NULL, "\\_SB", &handle);
	if (ACPI_FAILURE(status))
		return;

	if (acpi_has_method(handle, "PCCH"))
		cpufreq_add_device("pcc-cpufreq");
}
#else
static void __init acpi_pcc_cpufreq_init(void) {}
#endif /* CONFIG_X86 */

/* Initialization */
#ifdef CONFIG_ACPI_HOTPLUG_CPU
int __weak acpi_map_cpu(acpi_handle handle,
@@ -280,14 +309,22 @@ static int acpi_processor_get_info(struct acpi_device *device)
		dev_dbg(&device->dev, "Failed to get CPU physical ID.\n");

	pr->id = acpi_map_cpuid(pr->phys_id, pr->acpi_id);
	if (!cpu0_initialized && !acpi_has_cpu_in_madt()) {
	if (!cpu0_initialized) {
		cpu0_initialized = 1;
		/*
		 * Handle UP system running SMP kernel, with no CPU
		 * entry in MADT
		 */
		if (invalid_logical_cpuid(pr->id) && (num_online_cpus() == 1))
		if (!acpi_has_cpu_in_madt() && invalid_logical_cpuid(pr->id) &&
		    (num_online_cpus() == 1))
			pr->id = 0;
		/*
		 * Check availability of Processor Performance Control by
		 * looking at the presence of the _PCT object under the first
		 * processor definition.
		 */
		if (acpi_has_method(pr->handle, "_PCT"))
			cpufreq_add_device("acpi-cpufreq");
	}

	/*
@@ -686,6 +723,7 @@ void __init acpi_processor_init(void)
	acpi_processor_check_duplicates();
	acpi_scan_add_handler_with_hotplug(&processor_handler, "processor");
	acpi_scan_add_handler(&processor_container_handler);
	acpi_pcc_cpufreq_init();
}

#ifdef CONFIG_ACPI_PROCESSOR_CSTATE
+0 −38
Original line number Diff line number Diff line
@@ -70,12 +70,6 @@ module_param(device_id_scheme, bool, 0444);
static int only_lcd = -1;
module_param(only_lcd, int, 0444);

static int register_backlight_delay;
module_param(register_backlight_delay, int, 0444);
MODULE_PARM_DESC(register_backlight_delay,
	"Delay in seconds before doing fallback (non GPU driver triggered) "
	"backlight registration, set to 0 to disable.");

static bool may_report_brightness_keys;
static int register_count;
static DEFINE_MUTEX(register_count_mutex);
@@ -84,9 +78,6 @@ static LIST_HEAD(video_bus_head);
static int acpi_video_bus_add(struct acpi_device *device);
static void acpi_video_bus_remove(struct acpi_device *device);
static void acpi_video_bus_notify(struct acpi_device *device, u32 event);
static void acpi_video_bus_register_backlight_work(struct work_struct *ignored);
static DECLARE_DELAYED_WORK(video_bus_register_backlight_work,
			    acpi_video_bus_register_backlight_work);

/*
 * Indices in the _BCL method response: the first two items are special,
@@ -2096,11 +2087,6 @@ static void acpi_video_bus_remove(struct acpi_device *device)
	kfree(video);
}

static void acpi_video_bus_register_backlight_work(struct work_struct *ignored)
{
	acpi_video_register_backlight();
}

static int __init is_i740(struct pci_dev *dev)
{
	if (dev->device == 0x00D1)
@@ -2183,17 +2169,6 @@ static bool should_check_lcd_flag(void)
	return false;
}

/*
 * At least one graphics driver has reported that no LCD is connected
 * via the native interface. cancel the registration for fallback acpi_video0.
 * If another driver still deems this necessary, it can explicitly register it.
 */
void acpi_video_report_nolcd(void)
{
	cancel_delayed_work(&video_bus_register_backlight_work);
}
EXPORT_SYMBOL(acpi_video_report_nolcd);

int acpi_video_register(void)
{
	int ret = 0;
@@ -2222,18 +2197,6 @@ int acpi_video_register(void)
	 */
	register_count = 1;

	/*
	 * acpi_video_bus_add() skips registering the userspace visible
	 * backlight_device. The intend is for this to be registered by the
	 * drm/kms driver calling acpi_video_register_backlight() *after* it is
	 * done setting up its own native backlight device. The delayed work
	 * ensures that acpi_video_register_backlight() always gets called
	 * eventually, in case there is no drm/kms driver or it is disabled.
	 */
	if (register_backlight_delay)
		schedule_delayed_work(&video_bus_register_backlight_work,
				      register_backlight_delay * HZ);

leave:
	mutex_unlock(&register_count_mutex);
	return ret;
@@ -2244,7 +2207,6 @@ void acpi_video_unregister(void)
{
	mutex_lock(&register_count_mutex);
	if (register_count) {
		cancel_delayed_work_sync(&video_bus_register_backlight_work);
		acpi_bus_unregister_driver(&acpi_video_bus);
		register_count = 0;
		may_report_brightness_keys = false;
Loading