Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4801121imm; Tue, 21 Aug 2018 00:56:17 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxx1QAWsbnRNFUGfxe0WPCf4I6kA87i05T56Qbdg9WngDys8L0bucl5aeI4Y8SRrRm00JHf X-Received: by 2002:a17:902:5858:: with SMTP id f24-v6mr2452138plj.321.1534838177657; Tue, 21 Aug 2018 00:56:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534838177; cv=none; d=google.com; s=arc-20160816; b=b1LTOS15IycFAgQ1YHqmoKJD02rF2qcZLNtEFyqqPpZkZcjxkbVU0fsX5hShqWn+WX tlT7AUEVqK1H+CBcbu9wAkpy0JzYeb15+JJnVwf1U8PqjscxulpgAwxxUw5hxmAXOuHM SRK6pxfw7vhXZ+fBeZbZLFEpqtZtbo5Lb3Ogk7Riv1vP6aqJUjVLVoKP3+ZUWoPOgge5 FTkZZ1u5booeDFfYEabDtNZdDoQIlHtMTnx0asjhwhezmPxLePTAJHehlKYdnJiFTkFX ubLomE+IaNz5Y3PjhITcwPE8HzzJLu7WmQnP8FV8+I1esbXkciZJobhGcntHDBhgzXf0 ajWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=SIRw8Jlc1mnQWPRV/sciX68GhApdsm9OEVbOr3WxSgM=; b=DllNmTl1SJ+YcOkCcyouwEokZRc/JSBZvtnIgjlSaK2gk+FwuSj0vW3mVTlQE24JQc HISmfLZkYavzOOvRv4gsUj43mrBoj2XvqSdzU3Dbff3XMcsn7IxpWy2EMpZvqOj9JsRe 4uOm+FPVNxYVhnvVLByAu2MY1FKXPxVbu5aeeef712Q4ArAcNgWGk44zJhOe8D0Xp128 aIqyEE+94uGwJ/A4QOCcNNz2oCEK2PnZUu/BPbodTKTzE6zDoT8dXBFFYJoLgtRMQPnW UtD4TOgised8t0PoczPP2L9YRHOZ5OkzyWq6awtXJXW/mgLXs/YcWswQERdgmo28wsw0 mLQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gDO4KMDt; 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 d190-v6si13072814pfd.113.2018.08.21.00.56.01; Tue, 21 Aug 2018 00:56:17 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=gDO4KMDt; 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 S1726718AbeHULOB (ORCPT + 99 others); Tue, 21 Aug 2018 07:14:01 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:42990 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726557AbeHULOB (ORCPT ); Tue, 21 Aug 2018 07:14:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SIRw8Jlc1mnQWPRV/sciX68GhApdsm9OEVbOr3WxSgM=; b=gDO4KMDt36h4DU83LJZDzsD7d eLUGToWCqA7gLeAEYvcyWNDfOPv1sIqdyhRfNTfBEy1/nESabNh0iyuB3PX9XKq0ZjhjULPuxMF5b fwatKUX5T3F6cxASAhrztrcgmPe9xqJu/fqXhbWkvezPvI/3LTyNtLo9+c4viodakSNaEe0YE4Y17 Ff1xzFPA85GfbUNqzpIfg9a9s+DQn0b89BhnuN95ImDUYjNAbpIV8wLGPjk6oZmMUETQNMHkKa7hg v/eUO8JL5lTNCw6gNrsYvGJucf5WglrqmzdeT7yUORMK3H+EMl2iY+2B5SWAv4AFbN1mqinIvFG0+ xjWNxOVvw==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fs1V6-0002NM-UL; Tue, 21 Aug 2018 07:54:52 +0000 Date: Tue, 21 Aug 2018 00:54:52 -0700 From: Christoph Hellwig To: Atish Patra Cc: palmer@sifive.com, linux-riscv@lists.infradead.org, mark.rutland@arm.com, anup@brainfault.org, hch@infradead.org, tglx@linutronix.de, Damien.LeMoal@wdc.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 5/5] RISC-V: Support cpu hotplug. Message-ID: <20180821075452.GC28079@infradead.org> References: <1534377377-70108-1-git-send-email-atish.patra@wdc.com> <1534377377-70108-6-git-send-email-atish.patra@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1534377377-70108-6-git-send-email-atish.patra@wdc.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > if (!err) { > + > +#ifdef CONFIG_HOTPLUG_CPU > + arch_send_call_function_single_ipi(cpu); > +#endif Please just provide a stub version of arch_send_call_function_single_ipi for the !CONFIG_HOTPLUG_CPU case instead of the ifdef here. > +#ifdef CONFIG_HOTPLUG_CPU > +int can_hotplug_cpu(void) This should be a bool. > +{ > + if (cpu_ops.cpu_die) > + return 1; > + else > + return 0; > +} return cpu_ops.cpu_die != NULL; > +void default_cpu_die(unsigned int cpu) > +{ > + int sipval, sieval, scauseval; > + > + /* clear all pending flags */ > + csr_write(sip, 0); > + /* clear any previous scause data */ > + csr_write(scause, 0); > + > + do { > + wait_for_interrupt(); > + sipval = csr_read(sip); > + sieval = csr_read(sie); > + scauseval = csr_read(scause); > + /* only break if wfi returns for an enabled interrupt */ > + } while ((sipval & sieval) == 0 && > + scauseval != INTERRUPT_CAUSE_SOFTWARE); > + > + boot_sec_cpu(); > +} I suspect all of this except for the boot_sec_cpu() should go into a helper in irq.c. Also as-is this probably doesn't work as scauseval will have INTERRUPT_CAUSE_FLAG set, making the comparism never true.