Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2862648imm; Tue, 4 Sep 2018 11:10:16 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaseGG7/VKI6dV43ilBDTBYugPHF8zev/Lm2pSztanWwUmQ1d28Q4sfao20+l0Q0M/Sgj0O X-Received: by 2002:a62:1d54:: with SMTP id d81-v6mr36326527pfd.139.1536084616095; Tue, 04 Sep 2018 11:10:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536084616; cv=none; d=google.com; s=arc-20160816; b=TkJeDvnFRbuTMx1BYY4hRwcewpXTinRuhXkAW+Rt32KlkBEedHt87Bq24nXjqbfmz0 RswHC4NpUDSPS+LyPCIxepp4DFCgYIZxRqcnqE6cfDEJ8okfyO0ZRtoWF7/2HH0kvRaE 5ar7dAl/xnuqyqG/T3N1I7VFa4EOEwHDM+ievWF0mYJE7lpEulF7wxoaRf/D2uB1d8ap j5ujPcUS3kxasaVXE0dfNfI+GyjEmVEmodU2vJUq40QbqI2F1a+1NaQBAYZuDw1NtKYb Feh0nKdzNyLS3Qw8gM6YID1Hg5rDkF6z/6RwqNhuO49pb9Nd5tpVA7YPBsQsrmPQErO6 oyzQ== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=sDR5lq1VuQmAzu0YAokwJFnJWSoq7M2uEWpZFr8iJVw=; b=cUIJBeyKQy5f8VVQHsNk+27Gg48ZjrntJEzqIRP0lUnVEEYbBci2MlUdUs3ZLaB48K wJOFYmFMX0T5cpd85rPOPSS07y1CJaBGMHVXL9ECAV0M6aU/nx36J2sZX8RcYkm6G75t FsmXi29dX1AvQ3B9wGcHtDzMQh3YlunmtQozjf06Ar0mXXDMVbHGBOtdgGaDEyLVRH0y vjJs8xLka4IPKVQyxhHRcazCKIFd64RmcnoaITB2E4SpZTK//0LGUOdYBbGSXWDCcAaj 7WZc7/P1MSzB5wy3E1M7KY4KY1A+aII2htQ6cZxMVnVQVVb0bN+1xN9+G1IV7VMuok1h wnEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=rMfS7P27; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i33-v6si9962432pld.306.2018.09.04.11.10.00; Tue, 04 Sep 2018 11:10:16 -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=@wdc.com header.s=dkim.wdc.com header.b=rMfS7P27; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727695AbeIDWet (ORCPT + 99 others); Tue, 4 Sep 2018 18:34:49 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:15937 "EHLO esa2.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726437AbeIDWet (ORCPT ); Tue, 4 Sep 2018 18:34:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1536084533; x=1567620533; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=u4l4GxPJcwl+AYCWX5A8MqnPygmQri6ytFL921wx0cU=; b=rMfS7P27KFSAALgZQHPxfFPwfPnFLIqevEAPOLmBH/i4D4K7UOaYSHfS VnnK/Z+mwhkERwaMVNQA8zaZv9EZ7RmZOmNzeP4f0D4kszWZvA6r7HQ8d IXHxhGoz9z/zkAxtEqn4j0zRn+HFleb9bzzAVGEq6KXBAX1s50GCWkszx AaXaP2cipTbe/SDQtTMpitJJ9Ly5jrQCQCuOAzoxspSmDo8D8dcQepewi DG2jL7By2cO65rlKNn5FmnfXskOGCd7uuYw6RrbJuApgxjZxogfEvofkE n4BJeTxnp4OPL89K8u0DlY9sgRZoeXyHj/VbbennujrVaNOsMeMLNbWdF g==; X-IronPort-AV: E=Sophos;i="5.53,330,1531756800"; d="scan'208";a="186525257" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 05 Sep 2018 02:08:52 +0800 Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP; 04 Sep 2018 10:55:21 -0700 Received: from use204589.ad.shared (HELO [10.86.59.178]) ([10.86.59.178]) by uls-op-cesaip02.wdc.com with ESMTP; 04 Sep 2018 11:08:36 -0700 Subject: Re: [PATCH v2 3/3] RISC-V: Support cpu hotplug. To: Christoph Hellwig Cc: "palmer@sifive.com" , "linux-riscv@lists.infradead.org" , "mark.rutland@arm.com" , "anup@brainfault.org" , "tglx@linutronix.de" , "linux-kernel@vger.kernel.org" , "damein@vger.kernel.org" References: <1535445370-19004-1-git-send-email-atish.patra@wdc.com> <1535445370-19004-4-git-send-email-atish.patra@wdc.com> <20180831061859.GC19292@infradead.org> From: Atish Patra Message-ID: <0d439b9d-b3d0-7d2c-117b-abb37adf769c@wdc.com> Date: Tue, 4 Sep 2018 11:08:35 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180831061859.GC19292@infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/30/18 11:19 PM, Christoph Hellwig wrote: >> +#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. Done. > >> #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. > ok. Done. >> 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. > I have kept it here to match all other arch. Same goes for all hotplug functions in smpboot.c I can move them to a separate file if you think that provides better code readability and structure. Regards, Atish