Skip to content

Commit 679a163

Browse files
committed
Merge tag 'acpi-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki: "These include an ACPICA update (upstream revision 20250807 with a few fixes on top), fixes and cleanups of the ACPI processor driver, fixes and cleanups of the ACPI properties management code, one more ACPI IRQ resource management quirk, one more ACPI backlight quirk, an ACPI device enumeration quirk related to _DEP, a power resource quirk related to WWAN modem for HP EliteBook 855 G7, ACPI SPCR table parser extensions, an ACPI APEI EINJ driver update allowing it to handle more address types, and several assorted cleanups of ACPI drivers and PNP code. Specifics: - Add SoundWire File Table (SWFT) signature to ACPICA (Maciej Strozek) - Rearrange local variable definition involving #ifdef in ACPICA to avoid using uninitialized variables (Zhe Qiao) - Allow ACPICA to skip Global Lock initialization (Huacai Chen) - Apply ACPI_NONSTRING in more places in ACPICA and fix two regressions related to incorrect ACPI_NONSTRING usage (Ahmed Salem) - Fix printing CDAT table header when dissasebling CDAT AML (Ahmed Salem) - Use acpi_ds_clear_operands() in acpi_ds_call_control_method() in ACPICA (Hans de Goede) - Update dsmethod.c in ACPICA to address unused variable warning (Saket Dumbre) - Print error messages in ACPICA for too few or too many control method arguments (Saket Dumbre) - Update ACPICA version to 20250807 (Saket Dumbre) - Fix largest possible resource descriptor index in ACPICA (Dmitry Antipov) - Add Back-Invalidate restriction to CXL Window for CEDT in ACPICA (Davidlohr Bueso) - Add the package type to acceptable Arg3 types for _DSM in ACPICA because ACPI_TYPE_ANY does not cover it (Saket Dumbre) - Fix return values in ap_is_valid_checksum() in the acpidump utility in ACPICA (Kaushlendra Kumar) - Add Intel CVS ACPI HIDs to acpi_ignore_dep_ids[] so it is not regarded as real dependency (Hans de Goede) - Use ACPI_FREE() for freeing an ACPI object in description_show() in the ACPI sysfs-related code (Kaushlendra Kumar) - Fix memory leak in the ACPI processor idle driver registration error code path and optimize ACPI idle driver registration (Huisong Li, Rafael Wysocki) - Add module import namespace to the ACPI processor idle driver (Rafael Wysocki) - Eliminate static variable flat_state_cnt from the ACPI processor idle driver (Rafael Wysocki) - Release cpufreq policy references using __free() in the ACPI processor thremal driver (Zihuan Zhang) - Remove unused empty stubs of some functions and rearrange function declarations in a header file in the ACPI processor driver (Huisong Li) - Redefine two functions as void in the ACPI processor driver (Rafael Wysocki) - Stop exposing global variable acpi_idle_driver in the ACPI processor driver (Huisong Li) - Fix ACPI buffer properties extraction for data-only subnodes represented as _DSD-equivalent packages (Rafael Wysocki) - Fix handling of ACPI data-only subnodes represented as _DSD-equivalent packages in the case when they are embedded in larger _DSD-equivalent packages and clean up acpi_nondev_subnode_extract() (Rafael Wysocki) - Skip ACPI IRQ override on ASUS Vivobook Pro N6506CU (Sam van Kampen) - Add power resource init function and use it for introducing an HP EliteBook 855 G7 WWAN modem power resource quirk (Maciej Szmigiero) - Add support for DBG2 RISC-V SBI port subtype and Precise Baud Rate field to the ACPI SPCR table parser (Chen Pei) - Eliminate a dummy local variable from the ACPI thermal driver (Rafael Wysocki) - Fold two simple functions into their only caller in the ACPI fan driver (Rafael Wysocki) - Force native backlight on Lenovo 82K8 in the ACPI backlight (video) driver (Mario Limonciello) - Add missing sysfs_remove_group() for ACPI_TAD_RT (Daniel Tang) - Skip PRM handlers with NULL handler_address or NULL VA in the ACPI PRM driver (Shang song) - Remove redundant assignments in erst_dbg_{ioctl|write}() in the ACPI APEI driver (Thorsten Blum) - Allow the ACPI APEI EINJ to handle more types of addresses than just MMIO (Jiaqi Yan) - Use str_low_high() helper in two places in the ACPI code (Chelsy Ratnawat) - Use str_plural() to simplify the PNP code (Xichao Zhao) - Fix signedness issues in read/write helpers in the ACPI AML debugger interface (Amir Mohammad)" * tag 'acpi-6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (50 commits) ACPI: debug: fix signedness issues in read/write helpers ACPI: processor: Do not expose global variable acpi_idle_driver ACPI: SPCR: Support Precise Baud Rate field ACPI: processor: idle: Redefine two functions as void ACPI: processor: Update cpuidle driver check in __acpi_processor_start() ACPI: processor: idle: Rearrange declarations in header file ACPI: processor: Remove unused empty stubs of some functions ACPI: property: Adjust failure handling in acpi_nondev_subnode_extract() ACPI: property: Do not pass NULL handles to acpi_attach_data() ACPI: property: Add code comments explaining what is going on ACPI: property: Disregard references in data-only subnode lists ACPI: property: Fix buffer properties extraction for subnodes ACPI: SPCR: Add support for DBG2 RISC-V SBI port subtype ACPI: APEI: EINJ: Allow more types of addresses except MMIO ACPI: APEI: Remove redundant assignments in erst_dbg_{ioctl|write}() ACPICA: acpidump: fix return values in ap_is_valid_checksum() ACPICA: ACPI_TYPE_ANY does not include the package type ACPICA: CEDT: Add Back-Invalidate restriction to CXL Window ACPICA: Fix largest possible resource descriptor index ACPICA: Update version to 20250807 ...
2 parents 9910531 + c870720 commit 679a163

38 files changed

Lines changed: 498 additions & 252 deletions

drivers/acpi/acpi_dbg.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,11 @@ static int acpi_aml_release(struct inode *inode, struct file *file)
569569
return 0;
570570
}
571571

572-
static int acpi_aml_read_user(char __user *buf, int len)
572+
static ssize_t acpi_aml_read_user(char __user *buf, size_t len)
573573
{
574-
int ret;
575574
struct circ_buf *crc = &acpi_aml_io.out_crc;
576-
int n;
575+
ssize_t ret;
576+
size_t n;
577577
char *p;
578578

579579
ret = acpi_aml_lock_read(crc, ACPI_AML_OUT_USER);
@@ -582,7 +582,7 @@ static int acpi_aml_read_user(char __user *buf, int len)
582582
/* sync head before removing logs */
583583
smp_rmb();
584584
p = &crc->buf[crc->tail];
585-
n = min(len, circ_count_to_end(crc));
585+
n = min_t(size_t, len, circ_count_to_end(crc));
586586
if (copy_to_user(buf, p, n)) {
587587
ret = -EFAULT;
588588
goto out;
@@ -599,8 +599,8 @@ static int acpi_aml_read_user(char __user *buf, int len)
599599
static ssize_t acpi_aml_read(struct file *file, char __user *buf,
600600
size_t count, loff_t *ppos)
601601
{
602-
int ret = 0;
603-
int size = 0;
602+
ssize_t ret = 0;
603+
ssize_t size = 0;
604604

605605
if (!count)
606606
return 0;
@@ -639,11 +639,11 @@ static ssize_t acpi_aml_read(struct file *file, char __user *buf,
639639
return size > 0 ? size : ret;
640640
}
641641

642-
static int acpi_aml_write_user(const char __user *buf, int len)
642+
static ssize_t acpi_aml_write_user(const char __user *buf, size_t len)
643643
{
644-
int ret;
645644
struct circ_buf *crc = &acpi_aml_io.in_crc;
646-
int n;
645+
ssize_t ret;
646+
size_t n;
647647
char *p;
648648

649649
ret = acpi_aml_lock_write(crc, ACPI_AML_IN_USER);
@@ -652,7 +652,7 @@ static int acpi_aml_write_user(const char __user *buf, int len)
652652
/* sync tail before inserting cmds */
653653
smp_mb();
654654
p = &crc->buf[crc->head];
655-
n = min(len, circ_space_to_end(crc));
655+
n = min_t(size_t, len, circ_space_to_end(crc));
656656
if (copy_from_user(p, buf, n)) {
657657
ret = -EFAULT;
658658
goto out;
@@ -663,14 +663,14 @@ static int acpi_aml_write_user(const char __user *buf, int len)
663663
ret = n;
664664
out:
665665
acpi_aml_unlock_fifo(ACPI_AML_IN_USER, ret >= 0);
666-
return n;
666+
return ret;
667667
}
668668

669669
static ssize_t acpi_aml_write(struct file *file, const char __user *buf,
670670
size_t count, loff_t *ppos)
671671
{
672-
int ret = 0;
673-
int size = 0;
672+
ssize_t ret = 0;
673+
ssize_t size = 0;
674674

675675
if (!count)
676676
return 0;

drivers/acpi/acpi_processor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,7 @@ bool acpi_processor_claim_cst_control(void)
815815
cst_control_claimed = true;
816816
return true;
817817
}
818-
EXPORT_SYMBOL_GPL(acpi_processor_claim_cst_control);
818+
EXPORT_SYMBOL_NS_GPL(acpi_processor_claim_cst_control, "ACPI_PROCESSOR_IDLE");
819819

820820
/**
821821
* acpi_processor_evaluate_cst - Evaluate the processor _CST control method.
@@ -994,5 +994,5 @@ int acpi_processor_evaluate_cst(acpi_handle handle, u32 cpu,
994994

995995
return ret;
996996
}
997-
EXPORT_SYMBOL_GPL(acpi_processor_evaluate_cst);
997+
EXPORT_SYMBOL_NS_GPL(acpi_processor_evaluate_cst, "ACPI_PROCESSOR_IDLE");
998998
#endif /* CONFIG_ACPI_PROCESSOR_CSTATE */

drivers/acpi/acpi_tad.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,9 @@ static void acpi_tad_remove(struct platform_device *pdev)
565565

566566
pm_runtime_get_sync(dev);
567567

568+
if (dd->capabilities & ACPI_TAD_RT)
569+
sysfs_remove_group(&dev->kobj, &acpi_tad_time_attr_group);
570+
568571
if (dd->capabilities & ACPI_TAD_DC_WAKE)
569572
sysfs_remove_group(&dev->kobj, &acpi_tad_dc_attr_group);
570573

drivers/acpi/acpica/acdebug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct acpi_db_argument_info {
3737
struct acpi_db_execute_walk {
3838
u32 count;
3939
u32 max_count;
40-
char name_seg[ACPI_NAMESEG_SIZE + 1] ACPI_NONSTRING;
40+
char name_seg[ACPI_NAMESEG_SIZE + 1];
4141
};
4242

4343
#define PARAM_LIST(pl) pl

drivers/acpi/acpica/aclocal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1141,7 +1141,7 @@ struct acpi_port_info {
11411141
#define ACPI_RESOURCE_NAME_PIN_GROUP_FUNCTION 0x91
11421142
#define ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG 0x92
11431143
#define ACPI_RESOURCE_NAME_CLOCK_INPUT 0x93
1144-
#define ACPI_RESOURCE_NAME_LARGE_MAX 0x94
1144+
#define ACPI_RESOURCE_NAME_LARGE_MAX 0x93
11451145

11461146
/*****************************************************************************
11471147
*

drivers/acpi/acpica/acpredef.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,8 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
450450

451451
{{"_DSM",
452452
METHOD_4ARGS(ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER,
453-
ACPI_TYPE_ANY) | ARG_COUNT_IS_MINIMUM,
453+
ACPI_TYPE_ANY | ACPI_TYPE_PACKAGE) |
454+
ARG_COUNT_IS_MINIMUM,
454455
METHOD_RETURNS(ACPI_RTYPE_ALL)}}, /* Must return a value, but it can be of any type */
455456

456457
{{"_DSS", METHOD_1ARGS(ACPI_TYPE_INTEGER),

drivers/acpi/acpica/dsmethod.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,6 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
462462
struct acpi_walk_state *next_walk_state = NULL;
463463
union acpi_operand_object *obj_desc;
464464
struct acpi_evaluate_info *info;
465-
u32 i;
466465

467466
ACPI_FUNCTION_TRACE_PTR(ds_call_control_method, this_walk_state);
468467

@@ -484,10 +483,17 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
484483
}
485484

486485
if (this_walk_state->num_operands < obj_desc->method.param_count) {
487-
ACPI_ERROR((AE_INFO, "Missing argument for method [%4.4s]",
486+
ACPI_ERROR((AE_INFO, "Missing argument(s) for method [%4.4s]",
488487
acpi_ut_get_node_name(method_node)));
489488

490-
return_ACPI_STATUS(AE_AML_UNINITIALIZED_ARG);
489+
return_ACPI_STATUS(AE_AML_TOO_FEW_ARGUMENTS);
490+
}
491+
492+
else if (this_walk_state->num_operands > obj_desc->method.param_count) {
493+
ACPI_ERROR((AE_INFO, "Too many arguments for method [%4.4s]",
494+
acpi_ut_get_node_name(method_node)));
495+
496+
return_ACPI_STATUS(AE_AML_TOO_MANY_ARGUMENTS);
491497
}
492498

493499
/* Init for new method, possibly wait on method mutex */
@@ -546,14 +552,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
546552
* Delete the operands on the previous walkstate operand stack
547553
* (they were copied to new objects)
548554
*/
549-
for (i = 0; i < obj_desc->method.param_count; i++) {
550-
acpi_ut_remove_reference(this_walk_state->operands[i]);
551-
this_walk_state->operands[i] = NULL;
552-
}
553-
554-
/* Clear the operand stack */
555-
556-
this_walk_state->num_operands = 0;
555+
acpi_ds_clear_operands(this_walk_state);
557556

558557
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
559558
"**** Begin nested execution of [%4.4s] **** WalkState=%p\n",

drivers/acpi/acpica/evglock.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ acpi_status acpi_ev_init_global_lock_handler(void)
4242
return_ACPI_STATUS(AE_OK);
4343
}
4444

45+
if (!acpi_gbl_use_global_lock) {
46+
return_ACPI_STATUS(AE_OK);
47+
}
48+
4549
/* Attempt installation of the global lock handler */
4650

4751
status = acpi_install_fixed_event_handler(ACPI_EVENT_GLOBAL,

drivers/acpi/acpica/psopinfo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static const u8 acpi_gbl_argument_count[] =
3434

3535
const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
3636
{
37-
#ifdef ACPI_DEBUG_OUTPUT
37+
#if defined ACPI_ASL_COMPILER && defined ACPI_DEBUG_OUTPUT
3838
const char *opcode_name = "Unknown AML opcode";
3939
#endif
4040

@@ -102,11 +102,11 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
102102
default:
103103
break;
104104
}
105-
#endif
106105

107106
/* Unknown AML opcode */
108107

109108
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "%s [%4.4X]\n", opcode_name, opcode));
109+
#endif
110110

111111
return (&acpi_gbl_aml_op_info[_UNK]);
112112
}

drivers/acpi/acpica/tbprint.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ acpi_tb_print_table_header(acpi_physical_address address,
121121
ACPI_CAST_PTR(struct acpi_table_rsdp,
122122
header)->revision,
123123
local_header.oem_id));
124+
} else if (acpi_gbl_CDAT && !acpi_ut_valid_nameseg(header->signature)) {
125+
126+
/* CDAT does not use the common ACPI table header */
127+
128+
ACPI_INFO(("%-4.4s 0x%8.8X%8.8X %06X",
129+
ACPI_SIG_CDAT, ACPI_FORMAT_UINT64(address),
130+
ACPI_CAST_PTR(struct acpi_table_cdat,
131+
header)->length));
124132
} else {
125133
/* Standard ACPI table with full common header */
126134

0 commit comments

Comments
 (0)