From patchwork Sun Feb 23 19:29:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qais Yousef X-Patchwork-Id: 11399035 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BF5914E3 for ; Sun, 23 Feb 2020 19:31:31 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F33220836 for ; Sun, 23 Feb 2020 19:31:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F33220836 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j5wxA-0004Fu-TL; Sun, 23 Feb 2020 19:30:12 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j5wx9-0004Fp-VJ for xen-devel@lists.xenproject.org; Sun, 23 Feb 2020 19:30:11 +0000 X-Inumbo-ID: e818dc4a-5672-11ea-b0fd-bc764e2007e4 Received: from foss.arm.com (unknown [217.140.110.172]) by us1-rack-iad1.inumbo.com (Halon) with ESMTP id e818dc4a-5672-11ea-b0fd-bc764e2007e4; Sun, 23 Feb 2020 19:30:10 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9E76CFEC; Sun, 23 Feb 2020 11:30:10 -0800 (PST) Received: from e107158-lin.cambridge.arm.com (e107158-lin.cambridge.arm.com [10.1.195.21]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 835CA3F6CF; Sun, 23 Feb 2020 11:30:09 -0800 (PST) From: Qais Yousef To: Thomas Gleixner Date: Sun, 23 Feb 2020 19:29:38 +0000 Message-Id: <20200223192942.18420-12-qais.yousef@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200223192942.18420-1-qais.yousef@arm.com> References: <20200223192942.18420-1-qais.yousef@arm.com> Subject: [Xen-devel] [PATCH v3 11/15] driver: xen: Replace cpu_up/down with device_online/offline X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Juergen Gross , Stefano Stabellini , "Paul E . McKenney" , linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, Boris Ostrovsky , Qais Yousef MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" 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 for anything but the cpu subsystem. Reviewed-by: Juergen Gross Signed-off-by: Qais Yousef CC: Boris Ostrovsky CC: Juergen Gross CC: Stefano Stabellini CC: xen-devel@lists.xenproject.org CC: linux-kernel@vger.kernel.org --- Juergen, there's a new add_cpu() which you should be CCed on. I wasn't sure if I could safely convert this to use it since I couldn't find whether the notifier already hold the lock or not. If you think remove_cpu() is safe, let me know and I can send an updated patch. drivers/xen/cpu_hotplug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/cpu_hotplug.c b/drivers/xen/cpu_hotplug.c index f192b6f42da9..ec975decb5de 100644 --- a/drivers/xen/cpu_hotplug.c +++ b/drivers/xen/cpu_hotplug.c @@ -94,7 +94,7 @@ static int setup_cpu_watcher(struct notifier_block *notifier, for_each_possible_cpu(cpu) { if (vcpu_online(cpu) == 0) { - (void)cpu_down(cpu); + device_offline(get_cpu_device(cpu)); set_cpu_present(cpu, false); } }