Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp268554imm; Thu, 30 Aug 2018 23:20:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYz2Q2hQpI2iEE+RdENKbwkvrRH2GjNfQ1DlpuDQgBmkKGkMMQ4yQ17iSrLzxTDnFON1cbZ X-Received: by 2002:a62:4898:: with SMTP id q24-v6mr14425391pfi.22.1535696428491; Thu, 30 Aug 2018 23:20:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535696428; cv=none; d=google.com; s=arc-20160816; b=uUlwXA8WnR5jZb5BxvNN25PYUcT40NXX8gcb6uK7emTnnIR6yZh5xHz6hGXUdGqXob 15gOfFa6GhKct2/UgxibUrymQj/8sic844vTJ86jlRirnMXZRhW9pKMOuSwp4sB77DWB KTJRQtQINBd+xw7GFzZ2XsfHcoxT4x6Db4mMQAba9Q548oKw7+V4d3I3LZ3dLkf5I+hQ LyjJp37cQWdiMAdbB/+hfaaLcOgfQdzTEipEQ0arWpciCRcCrsNnp/nd01gjgeUUHEh1 79jtefRzWq9BYyUzO75w95KqdNSgba/MafkjOTT5zJbvLcwSEyLOI+L0O/5Q8zWQz2og 17UQ== 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=GDmX4l4gkRdsmPEFij6nXUvbXpPfJSVZbfHw862rKog=; b=S1QO1Oi7nxmPQphxtWrwzVWTYnSzTNMVzqExJux3PEhkeaSg3erJmIFPbgLFX3OH/B NwK4pk/c8JpUKunE0MEu3fD0RMNsvuGIbmdug+4s/C8r8RbIxHbpGe88uQKRbs8n/ku9 Cqo09gXzUlkXgEQid+Jce9M8ePwi/03+Qg0QJwyVJMq2PBwgITrCF/J1iDwyu70AyRz1 WPt3CAYcHg9tc/SEZ0Zi3iAaJELDy9J91VUGOnvAYCZNycHQm9CecOlalAXCNa+YvNkw MQmW/ry3BaLRv5Dz55Ex5BbNVlvwgEfRap1XTYwcKz1kK7H5KCjl0IGEBczOOYS1TMpO eQvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=QcV7TA0f; 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 e39-v6si8898001plg.386.2018.08.30.23.20.12; Thu, 30 Aug 2018 23:20:28 -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=QcV7TA0f; 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 S1727336AbeHaKY4 (ORCPT + 99 others); Fri, 31 Aug 2018 06:24:56 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:39180 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727202AbeHaKYz (ORCPT ); Fri, 31 Aug 2018 06:24:55 -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=GDmX4l4gkRdsmPEFij6nXUvbXpPfJSVZbfHw862rKog=; b=QcV7TA0fjnqi3nxzn300vovXy 9JrZZyktH6LQ0UqQnIKxURC7zOUVw48j8sKs4uq9zI+0XEXBRoq7gM1/aYXzqu0r7ItJWE5mRl9lz KfYmE569eIE99d/mdW9BtbOtxQdU/Yj6oz2PHVGtvA2Z+iXrWplWFlNI5g9tvZTIDfAuDcShYZM7S /rEVvQHH7zd6Ni2S3aqDsRJ7PBk5hE5P1hqPkzbd2iRYwA+dmoYkjULjduDdFAPl8feY6m5vLJRhU KepZ2hdSGo+Db6uD7rrTX9ITVPMPpSQuZY6kawbImFoUh1kyvmZl7c5YFoIBw1ATvwd14cGYZ90Ta G4j8h6/mQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvcln-0004dd-O9; Fri, 31 Aug 2018 06:18:59 +0000 Date: Thu, 30 Aug 2018 23:18:59 -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, linux-kernel@vger.kernel.org, damein@vger.kernel.org Subject: Re: [PATCH v2 3/3] RISC-V: Support cpu hotplug. Message-ID: <20180831061859.GC19292@infradead.org> References: <1535445370-19004-1-git-send-email-atish.patra@wdc.com> <1535445370-19004-4-git-send-email-atish.patra@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1535445370-19004-4-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 > +#else > +static inline bool can_hotplug_cpu(void) { return 0; } > +static inline void arch_send_call_wakeup_ipi(int cpu) { } Please use normal coding style for these stubs. > #define INTERRUPT_CAUSE_FLAG (1UL << (__riscv_xlen - 1)) > +#define get_scause(cause) (cause & ~INTERRUPT_CAUSE_FLAG) I think this helper is misleading - the cause includes the interrupt flag. I'd rather open code this in the other place as well. > diff --git a/arch/riscv/kernel/process.c b/arch/riscv/kernel/process.c > index d7c6ca7c..cb209139 100644 > --- a/arch/riscv/kernel/process.c > +++ b/arch/riscv/kernel/process.c > @@ -42,6 +42,13 @@ void arch_cpu_idle(void) > local_irq_enable(); > } > > +#ifdef CONFIG_HOTPLUG_CPU > +void arch_cpu_idle_dead(void) > +{ > + cpu_play_dead(); > +} > +#endif I wonder if it might be worth to introduce a small arch/riscv/kernel/cpu-hotplug.c file for the various CONFIG_HOTPLUG_CPU only functions.