Skip to content

Commit 2b5f663

Browse files
committed
Merge tag 'acpi-6.18-rc1' into loongarch-next
LoongArch architecture changes for 6.18 need acpica changes to handle global lock initialization, so merge 'acpi-6.18-rc1' to create a base.
2 parents e5f0a69 + c870720 commit 2b5f663

38 files changed

+498
-252
lines changed

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)