[PATCH v2 1/7] ACPI: processor: idle: Mark the state as invalid if its entry method is illegal

Huisong Li posted 7 patches 1 month, 2 weeks ago
[PATCH v2 1/7] ACPI: processor: idle: Mark the state as invalid if its entry method is illegal
Posted by Huisong Li 1 month, 2 weeks ago
According to ACPI spec, entry method in LPI sub-package must be buffer
or integer. And the entry method is very key in cpuidle. So mark the state
as invalid.

Fixes: a36a7fecfe60 ("ACPI / processor_idle: Add support for Low Power Idle(LPI) states")
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
 drivers/acpi/processor_idle.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 341825e8ac63..9f1040eac051 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -956,6 +956,9 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle,
 			lpi_state->entry_method = ACPI_CSTATE_INTEGER;
 			lpi_state->address = obj->integer.value;
 		} else {
+			pr_debug("Entry method of state-%d is illegal, disable it.\n",
+				 state_idx);
+			lpi_state->flags = 0;
 			continue;
 		}
 
-- 
2.33.0
Re: [PATCH v2 1/7] ACPI: processor: idle: Mark the state as invalid if its entry method is illegal
Posted by Rafael J. Wysocki 1 month, 2 weeks ago
On Mon, Nov 3, 2025 at 9:42 AM Huisong Li <lihuisong@huawei.com> wrote:
>
> According to ACPI spec, entry method in LPI sub-package must be buffer
> or integer. And the entry method is very key in cpuidle. So mark the state
> as invalid.
>
> Fixes: a36a7fecfe60 ("ACPI / processor_idle: Add support for Low Power Idle(LPI) states")
> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> ---
>  drivers/acpi/processor_idle.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index 341825e8ac63..9f1040eac051 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -956,6 +956,9 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle,
>                         lpi_state->entry_method = ACPI_CSTATE_INTEGER;
>                         lpi_state->address = obj->integer.value;
>                 } else {
> +                       pr_debug("Entry method of state-%d is illegal, disable it.\n",
> +                                state_idx);
> +                       lpi_state->flags = 0;

Why does lpi_state->flags need to be cleared, isn't it 0 already?

>                         continue;
>                 }
>
> --
Re: [PATCH v2 1/7] ACPI: processor: idle: Mark the state as invalid if its entry method is illegal
Posted by lihuisong (C) 1 month, 1 week ago
在 2025/11/4 1:49, Rafael J. Wysocki 写道:
> On Mon, Nov 3, 2025 at 9:42 AM Huisong Li <lihuisong@huawei.com> wrote:
>> According to ACPI spec, entry method in LPI sub-package must be buffer
>> or integer. And the entry method is very key in cpuidle. So mark the state
>> as invalid.
>>
>> Fixes: a36a7fecfe60 ("ACPI / processor_idle: Add support for Low Power Idle(LPI) states")
>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>> ---
>>   drivers/acpi/processor_idle.c | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
>> index 341825e8ac63..9f1040eac051 100644
>> --- a/drivers/acpi/processor_idle.c
>> +++ b/drivers/acpi/processor_idle.c
>> @@ -956,6 +956,9 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle,
>>                          lpi_state->entry_method = ACPI_CSTATE_INTEGER;
>>                          lpi_state->address = obj->integer.value;
>>                  } else {
>> +                       pr_debug("Entry method of state-%d is illegal, disable it.\n",
>> +                                state_idx);
>> +                       lpi_state->flags = 0;
> Why does lpi_state->flags need to be cleared, isn't it 0 already?
Good point.
Do we need to add debug log?
>
>>                          continue;
>>                  }
>>
>> --
Re: [PATCH v2 1/7] ACPI: processor: idle: Mark the state as invalid if its entry method is illegal
Posted by Rafael J. Wysocki 1 month, 1 week ago
On Tue, Nov 4, 2025 at 10:30 AM lihuisong (C) <lihuisong@huawei.com> wrote:
>
>
> 在 2025/11/4 1:49, Rafael J. Wysocki 写道:
> > On Mon, Nov 3, 2025 at 9:42 AM Huisong Li <lihuisong@huawei.com> wrote:
> >> According to ACPI spec, entry method in LPI sub-package must be buffer
> >> or integer. And the entry method is very key in cpuidle. So mark the state
> >> as invalid.
> >>
> >> Fixes: a36a7fecfe60 ("ACPI / processor_idle: Add support for Low Power Idle(LPI) states")
> >> Signed-off-by: Huisong Li <lihuisong@huawei.com>
> >> ---
> >>   drivers/acpi/processor_idle.c | 3 +++
> >>   1 file changed, 3 insertions(+)
> >>
> >> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> >> index 341825e8ac63..9f1040eac051 100644
> >> --- a/drivers/acpi/processor_idle.c
> >> +++ b/drivers/acpi/processor_idle.c
> >> @@ -956,6 +956,9 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle,
> >>                          lpi_state->entry_method = ACPI_CSTATE_INTEGER;
> >>                          lpi_state->address = obj->integer.value;
> >>                  } else {
> >> +                       pr_debug("Entry method of state-%d is illegal, disable it.\n",
> >> +                                state_idx);
> >> +                       lpi_state->flags = 0;
> > Why does lpi_state->flags need to be cleared, isn't it 0 already?
> Good point.
> Do we need to add debug log?

Well, is it helpful?
Re: [PATCH v2 1/7] ACPI: processor: idle: Mark the state as invalid if its entry method is illegal
Posted by lihuisong (C) 1 month, 1 week ago
在 2025/11/4 23:00, Rafael J. Wysocki 写道:
> On Tue, Nov 4, 2025 at 10:30 AM lihuisong (C) <lihuisong@huawei.com> wrote:
>>
>> 在 2025/11/4 1:49, Rafael J. Wysocki 写道:
>>> On Mon, Nov 3, 2025 at 9:42 AM Huisong Li <lihuisong@huawei.com> wrote:
>>>> According to ACPI spec, entry method in LPI sub-package must be buffer
>>>> or integer. And the entry method is very key in cpuidle. So mark the state
>>>> as invalid.
>>>>
>>>> Fixes: a36a7fecfe60 ("ACPI / processor_idle: Add support for Low Power Idle(LPI) states")
>>>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>>>> ---
>>>>    drivers/acpi/processor_idle.c | 3 +++
>>>>    1 file changed, 3 insertions(+)
>>>>
>>>> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
>>>> index 341825e8ac63..9f1040eac051 100644
>>>> --- a/drivers/acpi/processor_idle.c
>>>> +++ b/drivers/acpi/processor_idle.c
>>>> @@ -956,6 +956,9 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle,
>>>>                           lpi_state->entry_method = ACPI_CSTATE_INTEGER;
>>>>                           lpi_state->address = obj->integer.value;
>>>>                   } else {
>>>> +                       pr_debug("Entry method of state-%d is illegal, disable it.\n",
>>>> +                                state_idx);
>>>> +                       lpi_state->flags = 0;
>>> Why does lpi_state->flags need to be cleared, isn't it 0 already?
>> Good point.
>> Do we need to add debug log?
> Well, is it helpful?
I think it is useful for developers.
They have a way to know why a state is disabled.
>