Skip to content

Commit

Permalink
Merge tag 'acpi-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
 "These update the ACPICA kernel code to upstream revision 20210730,
  clean up the ACPI companion binding code, optimize the I2C handling in
  the XPower PMIC driver, add 16550-compatible Serial Port Subtype
  support to the SPCR parsing code, add a few LoongArch support bits,
  add a ne quirk to the button driver, add new PCH FIVR methods to the
  DPTF code, replace deprecated CPU-hotplug functions in the processor
  driver, improve the acpi_os_map_memory() handling on non-x86 and do
  some assorted cleanups.

  Specifics:

   - Update ACPICA code in the kernel to upstream revision 20210730
     including the following changes:
       - Add support for the AEST table (data compiler) to iASL (Bob
         Moore)
       - Fix an if statement (add parens) (Bob Moore)
       - Drop trailing semicolon from some macros (Bob Moore)
       - Fix compilation of WPBT table with no command-line arguments in
         iASL (Bob Moore)
       - Add method name "_DIS" for use with aslmethod.c (Bob Moore)
       - Add new DBG2 Serial Port Subtypes (Marcin Wojtas)

   - Add new PCH FIVR methods to the DPTF code (Srinivas Pandruvada)

   - Add support for the new 16550-compatible Serial Port Subtype to the
     SPCR table parsing code (Marcin Wojtas)

   - Add DMI quirk for Lenovo Yoga 9 (14INTL5) to the ACPI button driver
     (Ulrich Huber)

   - Add LoongArch support for ACPI_PROCESSOR/ACPI_NUMA (Huacai Chen)

   - Add memory semantics to acpi_os_map_memory() (Lorenzo Pieralisi)

   - Replace deprecated CPU-hotplug functions in the ACPI processor
     driver (Sebastian Andrzej Siewior)

   - Optimize I2C-bus handling in the XPower PMIC driver (Hans de Goede)

   - Make platform-profile catch profile changes initiated by user space
     and notify user processes of them (Hans de Goede)

   - Clean up the ACPI companion binding and unbinding code and update
     debug messaging in the ACPI power resources code (Rafael Wysocki)

   - Clean up a couple of code pieces related to configfs (Andy
     Shevchenko)

   - Rearrange the FPDT table parsing code to avoid printing warning
     messages for reserved record types (Adrian Huang)"

* tag 'acpi-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (27 commits)
  ACPI: power: Drop name from struct acpi_power_resource
  ACPI: power: Use acpi_handle_debug() to print debug messages
  ACPI: tables: FPDT: Do not print FW_BUG message if record types are reserved
  ACPI: button: Add DMI quirk for Lenovo Yoga 9 (14INTL5)
  ACPI: Add memory semantics to acpi_os_map_memory()
  ACPI: SPCR: Add support for the new 16550-compatible Serial Port Subtype
  ACPI: platform-profile: call sysfs_notify() from platform_profile_store()
  ACPICA: Update version to 20210730
  ACPICA: Add method name "_DIS" For use with aslmethod.c
  ACPICA: iASL: Fix for WPBT table with no command-line arguments
  ACPICA: Headers: Add new DBG2 Serial Port Subtypes
  ACPICA: Macros should not use a trailing semicolon
  ACPICA: Fix an if statement (add parens)
  ACPICA: iASL: Add support for the AEST table (data compiler)
  ACPI: processor: Replace deprecated CPU-hotplug functions
  ACPI: DPTF: Add new PCH FIVR methods
  ACPI: configfs: Make get_header() to return error pointer
  ACPI: configfs: Use sysfs_emit() in "show" functions
  driver core: Split device_platform_notify()
  software nodes: Split software_node_notify()
  ...
  • Loading branch information
torvalds committed Aug 31, 2021
2 parents 5cbba60 + 2cbd407 commit 6f1e8b1
Show file tree
Hide file tree
Showing 34 changed files with 491 additions and 179 deletions.
40 changes: 40 additions & 0 deletions Documentation/ABI/testing/sysfs-platform-dptf
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,43 @@ Contact: linux-acpi@vger.kernel.org
Description:
(RW) The PCH FIVR (Fully Integrated Voltage Regulator) switching frequency in MHz,
when FIVR clock is 38.4MHz.

What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/fivr_switching_freq_mhz
Date: September, 2021
KernelVersion: v5.15
Contact: linux-acpi@vger.kernel.org
Description:
(RO) Get the FIVR switching control frequency in MHz.

What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/fivr_switching_fault_status
Date: September, 2021
KernelVersion: v5.15
Contact: linux-acpi@vger.kernel.org
Description:
(RO) Read the FIVR switching frequency control fault status.

What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/ssc_clock_info
Date: September, 2021
KernelVersion: v5.15
Contact: linux-acpi@vger.kernel.org
Description:
(RO) Presents SSC (spread spectrum clock) information for EMI
(Electro magnetic interference) control. This is a bit mask.
Bits Description
[7:0] Sets clock spectrum spread percentage:
0x00=0.2% , 0x3F=10%
1 LSB = 0.1% increase in spread (for
settings 0x01 thru 0x1C)
1 LSB = 0.2% increase in spread (for
settings 0x1E thru 0x3F)
[8] When set to 1, enables spread
spectrum clock
[9] 0: Triangle mode. FFC frequency
walks around the Fcenter in a linear
fashion
1: Random walk mode. FFC frequency
changes randomly within the SSC
(Spread spectrum clock) range
[10] 0: No white noise. 1: Add white noise
to spread waveform
[11] When 1, future writes are ignored.
7 changes: 7 additions & 0 deletions Documentation/ABI/testing/sysfs-platform_profile
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ Contact: Hans de Goede <hdegoede@redhat.com>
Description: Reading this file gives the current selected profile for this
device. Writing this file with one of the strings from
platform_profile_choices changes the profile to the new value.

This file can be monitored for changes by polling for POLLPRI,
POLLPRI will be signalled on any changes, independent of those
changes coming from a userspace write; or coming from another
source such as e.g. a hotkey triggered profile change handled
either directly by the embedded-controller or fully handled
inside the kernel.
3 changes: 3 additions & 0 deletions arch/arm64/include/asm/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr);
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
#define acpi_os_ioremap acpi_os_ioremap

void __iomem *acpi_os_memmap(acpi_physical_address phys, acpi_size size);
#define acpi_os_memmap acpi_os_memmap

typedef u64 phys_cpuid_t;
#define PHYS_CPUID_INVALID INVALID_HWID

Expand Down
19 changes: 16 additions & 3 deletions arch/arm64/kernel/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,8 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)
return __pgprot(PROT_DEVICE_nGnRnE);
}

void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
static void __iomem *__acpi_os_ioremap(acpi_physical_address phys,
acpi_size size, bool memory)
{
efi_memory_desc_t *md, *region = NULL;
pgprot_t prot;
Expand All @@ -299,9 +300,11 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
* It is fine for AML to remap regions that are not represented in the
* EFI memory map at all, as it only describes normal memory, and MMIO
* regions that require a virtual mapping to make them accessible to
* the EFI runtime services.
* the EFI runtime services. Determine the region default
* attributes by checking the requested memory semantics.
*/
prot = __pgprot(PROT_DEVICE_nGnRnE);
prot = memory ? __pgprot(PROT_NORMAL_NC) :
__pgprot(PROT_DEVICE_nGnRnE);
if (region) {
switch (region->type) {
case EFI_LOADER_CODE:
Expand Down Expand Up @@ -361,6 +364,16 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
return __ioremap(phys, size, prot);
}

void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
{
return __acpi_os_ioremap(phys, size, false);
}

void __iomem *acpi_os_memmap(acpi_physical_address phys, acpi_size size)
{
return __acpi_os_ioremap(phys, size, true);
}

/*
* Claim Synchronous External Aborts as a firmware first notification.
*
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,9 @@ config ACPI_CPPC_LIB

config ACPI_PROCESSOR
tristate "Processor"
depends on X86 || IA64 || ARM64
depends on X86 || IA64 || ARM64 || LOONGARCH
select ACPI_PROCESSOR_IDLE
select ACPI_CPU_FREQ_PSS if X86 || IA64
select ACPI_CPU_FREQ_PSS if X86 || IA64 || LOONGARCH
default y
help
This driver adds support for the ACPI Processor package. It is required
Expand Down
54 changes: 27 additions & 27 deletions drivers/acpi/acpi_configfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ static inline struct acpi_table_header *get_header(struct config_item *cfg)
if (!table->header)
pr_err("table not loaded\n");

return table->header;
return table->header ?: ERR_PTR(-EINVAL);
}

static ssize_t acpi_table_aml_read(struct config_item *cfg,
void *data, size_t size)
{
struct acpi_table_header *h = get_header(cfg);

if (!h)
return -EINVAL;
if (IS_ERR(h))
return PTR_ERR(h);

if (data)
memcpy(data, h, h->length);
Expand All @@ -100,82 +100,82 @@ static ssize_t acpi_table_signature_show(struct config_item *cfg, char *str)
{
struct acpi_table_header *h = get_header(cfg);

if (!h)
return -EINVAL;
if (IS_ERR(h))
return PTR_ERR(h);

return sprintf(str, "%.*s\n", ACPI_NAMESEG_SIZE, h->signature);
return sysfs_emit(str, "%.*s\n", ACPI_NAMESEG_SIZE, h->signature);
}

static ssize_t acpi_table_length_show(struct config_item *cfg, char *str)
{
struct acpi_table_header *h = get_header(cfg);

if (!h)
return -EINVAL;
if (IS_ERR(h))
return PTR_ERR(h);

return sprintf(str, "%d\n", h->length);
return sysfs_emit(str, "%d\n", h->length);
}

static ssize_t acpi_table_revision_show(struct config_item *cfg, char *str)
{
struct acpi_table_header *h = get_header(cfg);

if (!h)
return -EINVAL;
if (IS_ERR(h))
return PTR_ERR(h);

return sprintf(str, "%d\n", h->revision);
return sysfs_emit(str, "%d\n", h->revision);
}

static ssize_t acpi_table_oem_id_show(struct config_item *cfg, char *str)
{
struct acpi_table_header *h = get_header(cfg);

if (!h)
return -EINVAL;
if (IS_ERR(h))
return PTR_ERR(h);

return sprintf(str, "%.*s\n", ACPI_OEM_ID_SIZE, h->oem_id);
return sysfs_emit(str, "%.*s\n", ACPI_OEM_ID_SIZE, h->oem_id);
}

static ssize_t acpi_table_oem_table_id_show(struct config_item *cfg, char *str)
{
struct acpi_table_header *h = get_header(cfg);

if (!h)
return -EINVAL;
if (IS_ERR(h))
return PTR_ERR(h);

return sprintf(str, "%.*s\n", ACPI_OEM_TABLE_ID_SIZE, h->oem_table_id);
return sysfs_emit(str, "%.*s\n", ACPI_OEM_TABLE_ID_SIZE, h->oem_table_id);
}

static ssize_t acpi_table_oem_revision_show(struct config_item *cfg, char *str)
{
struct acpi_table_header *h = get_header(cfg);

if (!h)
return -EINVAL;
if (IS_ERR(h))
return PTR_ERR(h);

return sprintf(str, "%d\n", h->oem_revision);
return sysfs_emit(str, "%d\n", h->oem_revision);
}

static ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg,
char *str)
{
struct acpi_table_header *h = get_header(cfg);

if (!h)
return -EINVAL;
if (IS_ERR(h))
return PTR_ERR(h);

return sprintf(str, "%.*s\n", ACPI_NAMESEG_SIZE, h->asl_compiler_id);
return sysfs_emit(str, "%.*s\n", ACPI_NAMESEG_SIZE, h->asl_compiler_id);
}

static ssize_t acpi_table_asl_compiler_revision_show(struct config_item *cfg,
char *str)
{
struct acpi_table_header *h = get_header(cfg);

if (!h)
return -EINVAL;
if (IS_ERR(h))
return PTR_ERR(h);

return sprintf(str, "%d\n", h->asl_compiler_revision);
return sysfs_emit(str, "%d\n", h->asl_compiler_revision);
}

CONFIGFS_ATTR_RO(acpi_table_, signature);
Expand Down
7 changes: 3 additions & 4 deletions drivers/acpi/acpi_fpdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ static int fpdt_process_subtable(u64 address, u32 subtable_type)
break;

default:
pr_err(FW_BUG "Invalid record %d found.\n", record_header->type);
return -EINVAL;
/* Other types are reserved in ACPI 6.4 spec. */
break;
}
}
return 0;
Expand Down Expand Up @@ -254,8 +254,7 @@ static int __init acpi_init_fpdt(void)
subtable->type);
break;
default:
pr_info(FW_BUG "Invalid subtable type %d found.\n",
subtable->type);
/* Other types are reserved in ACPI 6.4 spec. */
break;
}
offset += sizeof(*subtable);
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpi_pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ static void set_power_saving_task_num(unsigned int num)

static void acpi_pad_idle_cpus(unsigned int num_cpus)
{
get_online_cpus();
cpus_read_lock();

num_cpus = min_t(unsigned int, num_cpus, num_online_cpus());
set_power_saving_task_num(num_cpus);

put_online_cpus();
cpus_read_unlock();
}

static uint32_t acpi_pad_idle_cpus_num(void)
Expand Down
8 changes: 4 additions & 4 deletions drivers/acpi/acpi_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
return -ENODEV;

cpu_maps_update_begin();
cpu_hotplug_begin();
cpus_write_lock();

ret = acpi_map_cpu(pr->handle, pr->phys_id, pr->acpi_id, &pr->id);
if (ret)
Expand All @@ -203,7 +203,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
pr->flags.need_hotplug_init = 1;

out:
cpu_hotplug_done();
cpus_write_unlock();
cpu_maps_update_done();
return ret;
}
Expand Down Expand Up @@ -454,13 +454,13 @@ static void acpi_processor_remove(struct acpi_device *device)
per_cpu(processors, pr->id) = NULL;

cpu_maps_update_begin();
cpu_hotplug_begin();
cpus_write_lock();

/* Remove the CPU. */
arch_unregister_cpu(pr->id);
acpi_unmap_cpu(pr->id);

cpu_hotplug_done();
cpus_write_unlock();
cpu_maps_update_done();

try_offline_node(cpu_to_node(pr->id));
Expand Down
5 changes: 2 additions & 3 deletions drivers/acpi/acpica/dswexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,10 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
op->common.
node->object,
NULL);
if ACPI_FAILURE
(status) {
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"While writing to buffer field"));
}
}
}
ACPI_FREE(namepath);
status = AE_OK;
Expand Down
12 changes: 6 additions & 6 deletions drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,24 +498,24 @@ static void acpi_bus_notify(acpi_handle handle, u32 type, void *data)
acpi_evaluate_ost(handle, type, ost_code, NULL);
}

static void acpi_device_notify(acpi_handle handle, u32 event, void *data)
static void acpi_notify_device(acpi_handle handle, u32 event, void *data)
{
struct acpi_device *device = data;

device->driver->ops.notify(device, event);
}

static void acpi_device_notify_fixed(void *data)
static void acpi_notify_device_fixed(void *data)
{
struct acpi_device *device = data;

/* Fixed hardware devices have no handles */
acpi_device_notify(NULL, ACPI_FIXED_HARDWARE_EVENT, device);
acpi_notify_device(NULL, ACPI_FIXED_HARDWARE_EVENT, device);
}

static u32 acpi_device_fixed_event(void *data)
{
acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_device_notify_fixed, data);
acpi_os_execute(OSL_NOTIFY_HANDLER, acpi_notify_device_fixed, data);
return ACPI_INTERRUPT_HANDLED;
}

Expand All @@ -536,7 +536,7 @@ static int acpi_device_install_notify_handler(struct acpi_device *device)
else
status = acpi_install_notify_handler(device->handle,
ACPI_DEVICE_NOTIFY,
acpi_device_notify,
acpi_notify_device,
device);

if (ACPI_FAILURE(status))
Expand All @@ -554,7 +554,7 @@ static void acpi_device_remove_notify_handler(struct acpi_device *device)
acpi_device_fixed_event);
else
acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY,
acpi_device_notify);
acpi_notify_device);
}

/* Handle events targeting \_SB device (at present only graceful shutdown) */
Expand Down
11 changes: 11 additions & 0 deletions drivers/acpi/button.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ static const struct dmi_system_id dmi_lid_quirks[] = {
},
.driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_DISABLED,
},
{
/*
* Lenovo Yoga 9 14ITL5, initial notification of the LID device
* never happens.
*/
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
DMI_MATCH(DMI_PRODUCT_NAME, "82BG"),
},
.driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN,
},
{
/*
* Medion Akoya E2215T, notification of the LID device only
Expand Down

0 comments on commit 6f1e8b1

Please sign in to comment.