diff mbox series

[30/38] ACPI: PM: s2idle: Replace deprecated CPU-hotplug functions.

Message ID 20210803141621.780504-31-bigeasy@linutronix.de
State Accepted
Commit d2c8cce647f3022d5960a3bf2b50a2da341d9c8b
Headers show
Series Replace deprecated CPU-hotplug | expand

Commit Message

Sebastian Andrzej Siewior Aug. 3, 2021, 2:16 p.m. UTC
The functions get_online_cpus() and put_online_cpus() have been
deprecated during the CPU hotplug rework. They map directly to
cpus_read_lock() and cpus_read_unlock().

Replace deprecated CPU-hotplug functions with the official version.
The behavior remains unchanged.

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Len Brown <len.brown@intel.com>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 kernel/power/suspend.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rafael J. Wysocki Aug. 4, 2021, 6:20 p.m. UTC | #1
On Tue, Aug 3, 2021 at 4:17 PM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>

> The functions get_online_cpus() and put_online_cpus() have been

> deprecated during the CPU hotplug rework. They map directly to

> cpus_read_lock() and cpus_read_unlock().

>

> Replace deprecated CPU-hotplug functions with the official version.

> The behavior remains unchanged.

>

> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>

> Cc: Pavel Machek <pavel@ucw.cz>

> Cc: Len Brown <len.brown@intel.com>

> Cc: linux-pm@vger.kernel.org

> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

> ---

>  kernel/power/suspend.c | 4 ++--

>  1 file changed, 2 insertions(+), 2 deletions(-)

>

> diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c

> index d8cae434f9eb5..eb75f394a0590 100644

> --- a/kernel/power/suspend.c

> +++ b/kernel/power/suspend.c

> @@ -96,7 +96,7 @@ static void s2idle_enter(void)

>         s2idle_state = S2IDLE_STATE_ENTER;

>         raw_spin_unlock_irq(&s2idle_lock);

>

> -       get_online_cpus();

> +       cpus_read_lock();

>         cpuidle_resume();

>

>         /* Push all the CPUs into the idle loop. */

> @@ -106,7 +106,7 @@ static void s2idle_enter(void)

>                     s2idle_state == S2IDLE_STATE_WAKE);

>

>         cpuidle_pause();

> -       put_online_cpus();

> +       cpus_read_unlock();

>

>         raw_spin_lock_irq(&s2idle_lock);

>

> --


Applied as 5.15 material, but the subject changed to "PM: sleep:
s2idle: Replace deprecated CPU-hotplug functions".

Thanks!
diff mbox series

Patch

diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index d8cae434f9eb5..eb75f394a0590 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -96,7 +96,7 @@  static void s2idle_enter(void)
 	s2idle_state = S2IDLE_STATE_ENTER;
 	raw_spin_unlock_irq(&s2idle_lock);
 
-	get_online_cpus();
+	cpus_read_lock();
 	cpuidle_resume();
 
 	/* Push all the CPUs into the idle loop. */
@@ -106,7 +106,7 @@  static void s2idle_enter(void)
 		    s2idle_state == S2IDLE_STATE_WAKE);
 
 	cpuidle_pause();
-	put_online_cpus();
+	cpus_read_unlock();
 
 	raw_spin_lock_irq(&s2idle_lock);