Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1643449ybv; Sun, 23 Feb 2020 11:31:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzS4zYhAtwxTD7gnihJO/Jkyi2cG+oJ7LLKGYwoeCmVG6Omq1SVSnIingNje7ErSwp0KIv9 X-Received: by 2002:aca:b183:: with SMTP id a125mr10084542oif.83.1582486261788; Sun, 23 Feb 2020 11:31:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582486261; cv=none; d=google.com; s=arc-20160816; b=cInWLqLR1Xf0mxTkQlLhJg00ji+2F0YPbPAg18CZA+38kmnTWqhUICjJS/W7nuxkp6 moHib1IOVhUXWBq3QdTkoqp6UaGiJg4qacl2waleFaKUAYnarmEMglpNcyOwgqGzGWod E5YB4kQ74iJJZV1Q11O9ApUHd9LsUXLKQSgAg8uCm1WImntXg6ua66nQDuz0WyP6NdaC epX7CbmSVFzbWpkwVO4nCjclMu0Pm8rJad5MtwqHnWYW7xcGTjpKuCZhQn6ZYHd0b9kY uoe6cfql75Ip6fMWUGT9xXqLu5ntoE+bvVKneCRn7jGvxi+k4dLeV00vXwXHU5vOTZVg jdSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=CPzssu49BOPeO3eWFkYgcL4G6MvVEsoKaH0T2e1l7Vs=; b=nfgEo2Gz1l440mqIWCzYUq4S7KUTypY7XzSB229niTg/gi4/g9aukvEyDOd5KOCKZ/ xnQgb9OZ5B6FycyZaEhN85W2VorZqahGBM1gsaoBg0UWK4siSjqV+4HJiTkU4W69oopn btyr5xrp9SV12QmLJKakLyWx72igkfVXdHFyNd/+LKF6+b5pRDw1ZuXxOObqxcGQLmVs WuJdxe2bymI9T7eTmAPit1d4A8uFhN6fA/7njxudi83Kpep6eH4U/G6vIiXI6FCFs5Q7 b+Mi25C1rk0GwGUpSCGT/ohXhNjFXemdUPOoDLrB9B2vXbzGaeCXAxwgEK1QQryXfiBk Irrg== 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 z15si5134579oti.126.2020.02.23.11.30.50; Sun, 23 Feb 2020 11:31:01 -0800 (PST) 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 S1727328AbgBWTaQ (ORCPT + 99 others); Sun, 23 Feb 2020 14:30:16 -0500 Received: from foss.arm.com ([217.140.110.172]:51462 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727286AbgBWTaL (ORCPT ); Sun, 23 Feb 2020 14:30:11 -0500 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 Cc: "Paul E . McKenney" , Qais Yousef , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 11/15] driver: xen: Replace cpu_up/down with device_online/offline 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); } } -- 2.17.1