Skip to content

Commit 6f1e8b1

Browse files
committed
Merge tag 'acpi-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/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() ...
2 parents 5cbba60 + 2cbd407 commit 6f1e8b1

34 files changed

+491
-179
lines changed

Documentation/ABI/testing/sysfs-platform-dptf

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,43 @@ Contact: linux-acpi@vger.kernel.org
111111
Description:
112112
(RW) The PCH FIVR (Fully Integrated Voltage Regulator) switching frequency in MHz,
113113
when FIVR clock is 38.4MHz.
114+
115+
What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/fivr_switching_freq_mhz
116+
Date: September, 2021
117+
KernelVersion: v5.15
118+
Contact: linux-acpi@vger.kernel.org
119+
Description:
120+
(RO) Get the FIVR switching control frequency in MHz.
121+
122+
What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/fivr_switching_fault_status
123+
Date: September, 2021
124+
KernelVersion: v5.15
125+
Contact: linux-acpi@vger.kernel.org
126+
Description:
127+
(RO) Read the FIVR switching frequency control fault status.
128+
129+
What: /sys/bus/platform/devices/INTC1045:00/pch_fivr_switch_frequency/ssc_clock_info
130+
Date: September, 2021
131+
KernelVersion: v5.15
132+
Contact: linux-acpi@vger.kernel.org
133+
Description:
134+
(RO) Presents SSC (spread spectrum clock) information for EMI
135+
(Electro magnetic interference) control. This is a bit mask.
136+
Bits Description
137+
[7:0] Sets clock spectrum spread percentage:
138+
0x00=0.2% , 0x3F=10%
139+
1 LSB = 0.1% increase in spread (for
140+
settings 0x01 thru 0x1C)
141+
1 LSB = 0.2% increase in spread (for
142+
settings 0x1E thru 0x3F)
143+
[8] When set to 1, enables spread
144+
spectrum clock
145+
[9] 0: Triangle mode. FFC frequency
146+
walks around the Fcenter in a linear
147+
fashion
148+
1: Random walk mode. FFC frequency
149+
changes randomly within the SSC
150+
(Spread spectrum clock) range
151+
[10] 0: No white noise. 1: Add white noise
152+
to spread waveform
153+
[11] When 1, future writes are ignored.

Documentation/ABI/testing/sysfs-platform_profile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ Contact: Hans de Goede <hdegoede@redhat.com>
2626
Description: Reading this file gives the current selected profile for this
2727
device. Writing this file with one of the strings from
2828
platform_profile_choices changes the profile to the new value.
29+
30+
This file can be monitored for changes by polling for POLLPRI,
31+
POLLPRI will be signalled on any changes, independent of those
32+
changes coming from a userspace write; or coming from another
33+
source such as e.g. a hotkey triggered profile change handled
34+
either directly by the embedded-controller or fully handled
35+
inside the kernel.

arch/arm64/include/asm/acpi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr);
5050
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size);
5151
#define acpi_os_ioremap acpi_os_ioremap
5252

53+
void __iomem *acpi_os_memmap(acpi_physical_address phys, acpi_size size);
54+
#define acpi_os_memmap acpi_os_memmap
55+
5356
typedef u64 phys_cpuid_t;
5457
#define PHYS_CPUID_INVALID INVALID_HWID
5558

arch/arm64/kernel/acpi.c

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)
273273
return __pgprot(PROT_DEVICE_nGnRnE);
274274
}
275275

276-
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
276+
static void __iomem *__acpi_os_ioremap(acpi_physical_address phys,
277+
acpi_size size, bool memory)
277278
{
278279
efi_memory_desc_t *md, *region = NULL;
279280
pgprot_t prot;
@@ -299,9 +300,11 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
299300
* It is fine for AML to remap regions that are not represented in the
300301
* EFI memory map at all, as it only describes normal memory, and MMIO
301302
* regions that require a virtual mapping to make them accessible to
302-
* the EFI runtime services.
303+
* the EFI runtime services. Determine the region default
304+
* attributes by checking the requested memory semantics.
303305
*/
304-
prot = __pgprot(PROT_DEVICE_nGnRnE);
306+
prot = memory ? __pgprot(PROT_NORMAL_NC) :
307+
__pgprot(PROT_DEVICE_nGnRnE);
305308
if (region) {
306309
switch (region->type) {
307310
case EFI_LOADER_CODE:
@@ -361,6 +364,16 @@ void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
361364
return __ioremap(phys, size, prot);
362365
}
363366

367+
void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
368+
{
369+
return __acpi_os_ioremap(phys, size, false);
370+
}
371+
372+
void __iomem *acpi_os_memmap(acpi_physical_address phys, acpi_size size)
373+
{
374+
return __acpi_os_ioremap(phys, size, true);
375+
}
376+
364377
/*
365378
* Claim Synchronous External Aborts as a firmware first notification.
366379
*

drivers/acpi/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,9 @@ config ACPI_CPPC_LIB
280280

281281
config ACPI_PROCESSOR
282282
tristate "Processor"
283-
depends on X86 || IA64 || ARM64
283+
depends on X86 || IA64 || ARM64 || LOONGARCH
284284
select ACPI_PROCESSOR_IDLE
285-
select ACPI_CPU_FREQ_PSS if X86 || IA64
285+
select ACPI_CPU_FREQ_PSS if X86 || IA64 || LOONGARCH
286286
default y
287287
help
288288
This driver adds support for the ACPI Processor package. It is required

drivers/acpi/acpi_configfs.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,16 @@ static inline struct acpi_table_header *get_header(struct config_item *cfg)
7070
if (!table->header)
7171
pr_err("table not loaded\n");
7272

73-
return table->header;
73+
return table->header ?: ERR_PTR(-EINVAL);
7474
}
7575

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

81-
if (!h)
82-
return -EINVAL;
81+
if (IS_ERR(h))
82+
return PTR_ERR(h);
8383

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

103-
if (!h)
104-
return -EINVAL;
103+
if (IS_ERR(h))
104+
return PTR_ERR(h);
105105

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

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

113-
if (!h)
114-
return -EINVAL;
113+
if (IS_ERR(h))
114+
return PTR_ERR(h);
115115

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

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

123-
if (!h)
124-
return -EINVAL;
123+
if (IS_ERR(h))
124+
return PTR_ERR(h);
125125

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

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

133-
if (!h)
134-
return -EINVAL;
133+
if (IS_ERR(h))
134+
return PTR_ERR(h);
135135

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

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

143-
if (!h)
144-
return -EINVAL;
143+
if (IS_ERR(h))
144+
return PTR_ERR(h);
145145

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

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

153-
if (!h)
154-
return -EINVAL;
153+
if (IS_ERR(h))
154+
return PTR_ERR(h);
155155

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

159159
static ssize_t acpi_table_asl_compiler_id_show(struct config_item *cfg,
160160
char *str)
161161
{
162162
struct acpi_table_header *h = get_header(cfg);
163163

164-
if (!h)
165-
return -EINVAL;
164+
if (IS_ERR(h))
165+
return PTR_ERR(h);
166166

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

170170
static ssize_t acpi_table_asl_compiler_revision_show(struct config_item *cfg,
171171
char *str)
172172
{
173173
struct acpi_table_header *h = get_header(cfg);
174174

175-
if (!h)
176-
return -EINVAL;
175+
if (IS_ERR(h))
176+
return PTR_ERR(h);
177177

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

181181
CONFIGFS_ATTR_RO(acpi_table_, signature);

drivers/acpi/acpi_fpdt.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ static int fpdt_process_subtable(u64 address, u32 subtable_type)
220220
break;
221221

222222
default:
223-
pr_err(FW_BUG "Invalid record %d found.\n", record_header->type);
224-
return -EINVAL;
223+
/* Other types are reserved in ACPI 6.4 spec. */
224+
break;
225225
}
226226
}
227227
return 0;
@@ -254,8 +254,7 @@ static int __init acpi_init_fpdt(void)
254254
subtable->type);
255255
break;
256256
default:
257-
pr_info(FW_BUG "Invalid subtable type %d found.\n",
258-
subtable->type);
257+
/* Other types are reserved in ACPI 6.4 spec. */
259258
break;
260259
}
261260
offset += sizeof(*subtable);

drivers/acpi/acpi_pad.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ static void set_power_saving_task_num(unsigned int num)
249249

250250
static void acpi_pad_idle_cpus(unsigned int num_cpus)
251251
{
252-
get_online_cpus();
252+
cpus_read_lock();
253253

254254
num_cpus = min_t(unsigned int, num_cpus, num_online_cpus());
255255
set_power_saving_task_num(num_cpus);
256256

257-
put_online_cpus();
257+
cpus_read_unlock();
258258
}
259259

260260
static uint32_t acpi_pad_idle_cpus_num(void)

drivers/acpi/acpi_processor.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
182182
return -ENODEV;
183183

184184
cpu_maps_update_begin();
185-
cpu_hotplug_begin();
185+
cpus_write_lock();
186186

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

205205
out:
206-
cpu_hotplug_done();
206+
cpus_write_unlock();
207207
cpu_maps_update_done();
208208
return ret;
209209
}
@@ -454,13 +454,13 @@ static void acpi_processor_remove(struct acpi_device *device)
454454
per_cpu(processors, pr->id) = NULL;
455455

456456
cpu_maps_update_begin();
457-
cpu_hotplug_begin();
457+
cpus_write_lock();
458458

459459
/* Remove the CPU. */
460460
arch_unregister_cpu(pr->id);
461461
acpi_unmap_cpu(pr->id);
462462

463-
cpu_hotplug_done();
463+
cpus_write_unlock();
464464
cpu_maps_update_done();
465465

466466
try_offline_node(cpu_to_node(pr->id));

drivers/acpi/acpica/dswexec.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,11 +561,10 @@ acpi_status acpi_ds_exec_end_op(struct acpi_walk_state *walk_state)
561561
op->common.
562562
node->object,
563563
NULL);
564-
if ACPI_FAILURE
565-
(status) {
564+
if (ACPI_FAILURE(status)) {
566565
ACPI_EXCEPTION((AE_INFO, status,
567566
"While writing to buffer field"));
568-
}
567+
}
569568
}
570569
ACPI_FREE(namepath);
571570
status = AE_OK;

0 commit comments

Comments
 (0)