Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp546709ybb; Wed, 25 Mar 2020 05:08:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuxRbOhRwIjUhzKBTrh0QGHYemI0xbn84qLeKuk56Oq5kDVOVCxXQQ9/6bzXHkL1rElXErz X-Received: by 2002:aca:5d8a:: with SMTP id r132mr2245890oib.129.1585138110522; Wed, 25 Mar 2020 05:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585138110; cv=none; d=google.com; s=arc-20160816; b=n030zE/NLIJllpkS8jiyEuYrtAdqO782UyfHCQfUZjyN5poEC+qWsR9PZfZRfmwcCD 3XPjPyk8L2nvEsKT74FzSBxFe/R+7uT2Sf+Fq/cHQXjVIB/zksYx+bey9Wp9zgLshHmm +XyKT25Xc8ILyH8YgDevKaSyT5ilJqEBehi/mbfFCojlgWI4bOppdYrXpnK/1/bffA52 L2+9kT7g7L9VQX/h4H4XPfZKe+5u1KBdt7F+BmtrLzfEK/zR0cCTYMs+nOJpeauFwQkD sO2eQ0lhZAmXhIFrnhvF/Mz8p9vAiDGq7NwUcmTGMn0d0BvFKLy5xL2+/ftbuucegWMf HGHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=TgKhcZ8yzqNRzZo7e+GvLuTGT/E/sTXLgSLJbApJE5Y=; b=nURWi2oBwtzmcsHbg8uClWn3qzaH9hDfVdMKRu1xDHRvjoLkcJ2ilgqmQ6MnE5os/6 CzQ/3/+NY+rdUWTTmVkLO1CSnf3moHF/StL+tTuUutGouDMUxr1Tf/rfuRsrHoUafMma SiXf/eewT1x6mY6Wo8AVpU2N9srmeCxHExGSau/vKIqFeWpY9ZIEShVAIapYSaZ3DyJE QYkgJ5Org3Hy4TCt/74CLWR3cI3KOp4+InuZYDcvFF7wW/dH1SC52GvHsuNLOIirNl7T lb5W7rv62XVX2B9fqKCeG2BP7OGMxCL5uIPmVPYfvCUBisiGZe5YocNupu1fAZHHWxeC vcjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m25si3339587oic.230.2020.03.25.05.08.17; Wed, 25 Mar 2020 05:08:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727755AbgCYMG4 (ORCPT + 99 others); Wed, 25 Mar 2020 08:06:56 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:47735 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727316AbgCYMGI (ORCPT ); Wed, 25 Mar 2020 08:06:08 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jH4nM-0000kA-4e; Wed, 25 Mar 2020 13:06:04 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id C02251C0450; Wed, 25 Mar 2020 13:06:03 +0100 (CET) Date: Wed, 25 Mar 2020 12:06:03 -0000 From: "tip-bot2 for Qais Yousef" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] x86/smp: Replace cpu_up/down() with add/remove_cpu() Cc: Qais Yousef , Thomas Gleixner , x86 , LKML In-Reply-To: <20200323135110.30522-10-qais.yousef@arm.com> References: <20200323135110.30522-10-qais.yousef@arm.com> MIME-Version: 1.0 Message-ID: <158513796344.28353.14308383948160999670.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the smp/core branch of tip: Commit-ID: af7aa04683e85ccb9088e31fe67a0397167b7abd Gitweb: https://git.kernel.org/tip/af7aa04683e85ccb9088e31fe67a0397167b7abd Author: Qais Yousef AuthorDate: Mon, 23 Mar 2020 13:51:02 Committer: Thomas Gleixner CommitterDate: Wed, 25 Mar 2020 12:59:35 +01:00 x86/smp: Replace cpu_up/down() with add/remove_cpu() The core device API performs extra housekeeping bits that are missing from directly calling cpu_up/down(). See commit a6717c01ddc2 ("powerpc/rtas: use device model APIs and serialization during LPM") for an example description of what might go wrong. This also prepares to make cpu_up/down() a private interface of the CPU subsystem. Signed-off-by: Qais Yousef Signed-off-by: Thomas Gleixner Link: https://lkml.kernel.org/r/20200323135110.30522-10-qais.yousef@arm.com --- arch/x86/kernel/topology.c | 22 ++++++---------------- arch/x86/mm/mmio-mod.c | 4 ++-- arch/x86/xen/smp.c | 2 +- 3 files changed, 9 insertions(+), 19 deletions(-) diff --git a/arch/x86/kernel/topology.c b/arch/x86/kernel/topology.c index be5bc2e..b8810eb 100644 --- a/arch/x86/kernel/topology.c +++ b/arch/x86/kernel/topology.c @@ -59,39 +59,29 @@ __setup("cpu0_hotplug", enable_cpu0_hotplug); */ int _debug_hotplug_cpu(int cpu, int action) { - struct device *dev = get_cpu_device(cpu); int ret; if (!cpu_is_hotpluggable(cpu)) return -EINVAL; - lock_device_hotplug(); - switch (action) { case 0: - ret = cpu_down(cpu); - if (!ret) { + ret = remove_cpu(cpu); + if (!ret) pr_info("DEBUG_HOTPLUG_CPU0: CPU %u is now offline\n", cpu); - dev->offline = true; - kobject_uevent(&dev->kobj, KOBJ_OFFLINE); - } else + else pr_debug("Can't offline CPU%d.\n", cpu); break; case 1: - ret = cpu_up(cpu); - if (!ret) { - dev->offline = false; - kobject_uevent(&dev->kobj, KOBJ_ONLINE); - } else { + ret = add_cpu(cpu); + if (ret) pr_debug("Can't online CPU%d.\n", cpu); - } + break; default: ret = -EINVAL; } - unlock_device_hotplug(); - return ret; } diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c index 673de60..109325d 100644 --- a/arch/x86/mm/mmio-mod.c +++ b/arch/x86/mm/mmio-mod.c @@ -386,7 +386,7 @@ static void enter_uniprocessor(void) put_online_cpus(); for_each_cpu(cpu, downed_cpus) { - err = cpu_down(cpu); + err = remove_cpu(cpu); if (!err) pr_info("CPU%d is down.\n", cpu); else @@ -406,7 +406,7 @@ static void leave_uniprocessor(void) return; pr_notice("Re-enabling CPUs...\n"); for_each_cpu(cpu, downed_cpus) { - err = cpu_up(cpu); + err = add_cpu(cpu); if (!err) pr_info("enabled CPU%d.\n", cpu); else diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c index 7a43b2a..2097fa0 100644 --- a/arch/x86/xen/smp.c +++ b/arch/x86/xen/smp.c @@ -132,7 +132,7 @@ void __init xen_smp_cpus_done(unsigned int max_cpus) if (xen_vcpu_nr(cpu) < MAX_VIRT_CPUS) continue; - rc = cpu_down(cpu); + rc = remove_cpu(cpu); if (rc == 0) { /*