From patchwork Tue Aug 3 14:16:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 12416507 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F130C4338F for ; Tue, 3 Aug 2021 14:17:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED8B460BD3 for ; Tue, 3 Aug 2021 14:17:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236722AbhHCORl (ORCPT ); Tue, 3 Aug 2021 10:17:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236632AbhHCOR2 (ORCPT ); Tue, 3 Aug 2021 10:17:28 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3746BC0617A1; Tue, 3 Aug 2021 07:17:15 -0700 (PDT) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1628000233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mMJPHZD2s+0akhWH3YgNv+6eVV1Mfo5CwlnWd2fY9Fc=; b=knDYNN7oqKQkW6EyhbgbzY3g1ZjOBj+WkUJTF2aZrOwtBfFMkSg/b31nhnU94waKtRjKp9 byuORjIFyjLmCDKrrp4WFq8IPcbOhlVPF5Ts8UACbvNghHzDPxAWWGqxwjlRQNzhOehj/Z 1sCFGsq4of84zwEN+vy2rNKxL3wA9Y0k1NPGTI4HMBhMDmwnbymSF7J/g35jf2Y9otyTxm UZlNaDdBc5BPDdBbmPzro08esnhbw74R2CYk4QDzlAH29nS5S+2t+oozooy63nyT39EjUm xKzO0KAg6w5hyfPvX1E9LKrwHIcMc23xHXLzI8X2Ghi/UpWXo0IkAcIPzhY3ew== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1628000233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mMJPHZD2s+0akhWH3YgNv+6eVV1Mfo5CwlnWd2fY9Fc=; b=LX8Rv+JvZctrjyb8bXnhBwSbulrlp7m2lysmW/lkz8bKG+I8RASI+y/WDO+y/fqjJzm9bR 3AbAjn+2fl319+Aw== To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, Peter Zijlstra , Sebastian Andrzej Siewior , "Rafael J. Wysocki" , Len Brown , linux-acpi@vger.kernel.org Subject: [PATCH 29/38] ACPI: processor: Replace deprecated CPU-hotplug functions. Date: Tue, 3 Aug 2021 16:16:12 +0200 Message-Id: <20210803141621.780504-30-bigeasy@linutronix.de> In-Reply-To: <20210803141621.780504-1-bigeasy@linutronix.de> References: <20210803141621.780504-1-bigeasy@linutronix.de> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The functions cpu_hotplug_begin, cpu_hotplug_done, get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_write_lock(), cpus_write_unlock, cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: "Rafael J. Wysocki" Cc: Len Brown Cc: linux-acpi@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- drivers/acpi/acpi_pad.c | 4 ++-- drivers/acpi/acpi_processor.c | 8 ++++---- drivers/acpi/processor_idle.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c index df4adeb335b24..f45979aa2d648 100644 --- a/drivers/acpi/acpi_pad.c +++ b/drivers/acpi/acpi_pad.c @@ -249,12 +249,12 @@ static void set_power_saving_task_num(unsigned int num) static void acpi_pad_idle_cpus(unsigned int num_cpus) { - get_online_cpus(); + cpus_read_lock(); num_cpus = min_t(unsigned int, num_cpus, num_online_cpus()); set_power_saving_task_num(num_cpus); - put_online_cpus(); + cpus_read_unlock(); } static uint32_t acpi_pad_idle_cpus_num(void) diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index 2d5bd2a6ddcef..6737b1cbf6d69 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c @@ -182,7 +182,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) return -ENODEV; cpu_maps_update_begin(); - cpu_hotplug_begin(); + cpus_write_lock(); ret = acpi_map_cpu(pr->handle, pr->phys_id, pr->acpi_id, &pr->id); if (ret) @@ -203,7 +203,7 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) pr->flags.need_hotplug_init = 1; out: - cpu_hotplug_done(); + cpus_write_unlock(); cpu_maps_update_done(); return ret; } @@ -454,13 +454,13 @@ static void acpi_processor_remove(struct acpi_device *device) per_cpu(processors, pr->id) = NULL; cpu_maps_update_begin(); - cpu_hotplug_begin(); + cpus_write_lock(); /* Remove the CPU. */ arch_unregister_cpu(pr->id); acpi_unmap_cpu(pr->id); - cpu_hotplug_done(); + cpus_write_unlock(); cpu_maps_update_done(); try_offline_node(cpu_to_node(pr->id)); diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 095c8aca141eb..f37fba9e5ba0b 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -1301,7 +1301,7 @@ int acpi_processor_power_state_has_changed(struct acpi_processor *pr) if (pr->id == 0 && cpuidle_get_driver() == &acpi_idle_driver) { /* Protect against cpu-hotplug */ - get_online_cpus(); + cpus_read_lock(); cpuidle_pause_and_lock(); /* Disable all cpuidle devices */ @@ -1330,7 +1330,7 @@ int acpi_processor_power_state_has_changed(struct acpi_processor *pr) } } cpuidle_resume_and_unlock(); - put_online_cpus(); + cpus_read_unlock(); } return 0;