mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "lihuisong (C)" <lihuisong@huawei.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: <lenb@kernel.org>, <linux-acpi@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <Sudeep.Holla@arm.com>,
	<linuxarm@huawei.com>, <jonathan.cameron@huawei.com>,
	<zhanjie9@hisilicon.com>, <zhenglifeng1@huawei.com>,
	<yubowen8@huawei.com>
Subject: Re: [PATCH v2 5/7] ACPI: processor: idle: Remove useless codes about the verification of cstate count
Date: Tue, 4 Nov 2025 18:03:36 +0800	[thread overview]
Message-ID: <e4ccdd1d-2ade-4fac-8296-3b6eebce1bfa@huawei.com> (raw)
In-Reply-To: <CAJZ5v0ifcuqF7=+NowYOfPbKfGq5XCe4+mg_9Sv8gRHyMZ0gNQ@mail.gmail.com>


在 2025/11/4 2:10, Rafael J. Wysocki 写道:
> On Mon, Nov 3, 2025 at 9:42 AM Huisong Li <lihuisong@huawei.com> wrote:
>> The acpi_processor_setup_cstates and acpi_processor_setup_cpuidle_cx will
>> be called after successfully obtaining the power information. These setup
>> functions have their own main role, but also verify the validity of cstate
>> count.
>>
>> Actually, the acpi_processor_get_power_info_cst will return failure if the
>> cstate count is zero and acpi_processor_get_power_info will return failure.
>>
>> So the verification of cstate count in these functions are useless.
>>
>> No intentional functional impact.
>>
>> Signed-off-by: Huisong Li <lihuisong@huawei.com>
>> ---
>>   drivers/acpi/processor_idle.c | 22 +++++++---------------
>>   1 file changed, 7 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
>> index 4627b00257e6..1f332f02d273 100644
>> --- a/drivers/acpi/processor_idle.c
>> +++ b/drivers/acpi/processor_idle.c
>> @@ -732,8 +732,8 @@ static int __cpuidle acpi_idle_enter_s2idle(struct cpuidle_device *dev,
>>          return 0;
>>   }
>>
>> -static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
>> -                                          struct cpuidle_device *dev)
>> +static void acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
>> +                                           struct cpuidle_device *dev)
>>   {
>>          int i, count = ACPI_IDLE_STATE_START;
>>          struct acpi_processor_cx *cx;
>> @@ -753,14 +753,9 @@ static int acpi_processor_setup_cpuidle_cx(struct acpi_processor *pr,
>>                  if (count == CPUIDLE_STATE_MAX)
>>                          break;
>>          }
>> -
>> -       if (!count)
>> -               return -EINVAL;
>> -
>> -       return 0;
>>   }
>>
>> -static int acpi_processor_setup_cstates(struct acpi_processor *pr)
>> +static void acpi_processor_setup_cstates(struct acpi_processor *pr)
>>   {
>>          int i, count;
>>          struct acpi_processor_cx *cx;
>> @@ -822,11 +817,6 @@ static int acpi_processor_setup_cstates(struct acpi_processor *pr)
>>          }
>>
>>          drv->state_count = count;
>> -
>> -       if (!count)
>> -               return -EINVAL;
>> -
>> -       return 0;
>>   }
>>
>>   static inline void acpi_processor_cstate_first_run_checks(void)
>> @@ -1248,7 +1238,8 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
>>          if (pr->flags.has_lpi)
>>                  return acpi_processor_setup_lpi_states(pr);
>>
>> -       return acpi_processor_setup_cstates(pr);
>> +       acpi_processor_setup_cstates(pr);
>> +       return 0;
>>   }
>>
>>   /**
>> @@ -1268,7 +1259,8 @@ static int acpi_processor_setup_cpuidle_dev(struct acpi_processor *pr,
>>          if (pr->flags.has_lpi)
>>                  return 0;
>>
>> -       return acpi_processor_setup_cpuidle_cx(pr, dev);
>> +       acpi_processor_setup_cpuidle_cx(pr, dev);
>> +       return 0;
>>   }
>>
>>   static int acpi_processor_get_power_info(struct acpi_processor *pr)
>> --
> Does this patch depend on the previous patches in the series?  If it
> doesn't, why don't you send it independently?
Good suggestion. Thanks, got it.
This patch doesn't depend on them.
But patch 6/7 and 7/7 depend on this patch and patch 3/7.
If they still need some times to discuss, I can send this patch first.
>
>

  reply	other threads:[~2025-11-04 10:03 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-03  8:42 [PATCH v2 0/7] ACPI: processor: idle: enhance and cleancode for cpuidle state Huisong Li
2025-11-03  8:42 ` [PATCH v2 1/7] ACPI: processor: idle: Mark the state as invalid if its entry method is illegal Huisong Li
2025-11-03 17:49   ` Rafael J. Wysocki
2025-11-04  9:30     ` lihuisong (C)
2025-11-04 15:00       ` Rafael J. Wysocki
2025-11-05  8:53         ` lihuisong (C)
2025-11-03  8:42 ` [PATCH v2 2/7] ACPI: processor: idle: Mark the state as invalid when get lpi_state->arch_flags failed Huisong Li
2025-11-03 17:53   ` Rafael J. Wysocki
2025-11-03  8:42 ` [PATCH v2 3/7] ACPI: processor: idle: Relocate and verify acpi_processor_ffh_lpi_probe Huisong Li
2025-11-03 17:56   ` Rafael J. Wysocki
2025-11-04  9:37     ` lihuisong (C)
2025-11-03  8:42 ` [PATCH v2 4/7] ACPI: processor: idle: Disable ACPI idle if get power information failed in power notify Huisong Li
2025-11-03 18:09   ` Rafael J. Wysocki
2025-11-04  9:54     ` lihuisong (C)
2025-11-04 16:19       ` Rafael J. Wysocki
2025-11-05  9:06         ` lihuisong (C)
2025-11-03  8:42 ` [PATCH v2 5/7] ACPI: processor: idle: Remove useless codes about the verification of cstate count Huisong Li
2025-11-03 18:10   ` Rafael J. Wysocki
2025-11-04 10:03     ` lihuisong (C) [this message]
2025-11-04 16:20       ` Rafael J. Wysocki
2025-11-03  8:42 ` [PATCH v2 6/7] ACPI: processor: idle: Redefine setup idle functions to void Huisong Li
2025-11-03  8:42 ` [PATCH v2 7/7] ACPI: processor: idle: Redefine acpi_processor_setup_cpuidle_dev " Huisong Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e4ccdd1d-2ade-4fac-8296-3b6eebce1bfa@huawei.com \
    --to=lihuisong@huawei.com \
    --cc=Sudeep.Holla@arm.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=rafael@kernel.org \
    --cc=yubowen8@huawei.com \
    --cc=zhanjie9@hisilicon.com \
    --cc=zhenglifeng1@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®