All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch@infradead.org (Christoph Hellwig)
To: linux-riscv@lists.infradead.org
Subject: [PATCH v2 3/3] RISC-V: Support cpu hotplug.
Date: Thu, 30 Aug 2018 23:18:59 -0700	[thread overview]
Message-ID: <20180831061859.GC19292@infradead.org> (raw)
In-Reply-To: <1535445370-19004-4-git-send-email-atish.patra@wdc.com>

> +#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.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@infradead.org>
To: Atish Patra <atish.patra@wdc.com>
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.
Date: Thu, 30 Aug 2018 23:18:59 -0700	[thread overview]
Message-ID: <20180831061859.GC19292@infradead.org> (raw)
In-Reply-To: <1535445370-19004-4-git-send-email-atish.patra@wdc.com>

> +#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.

  reply	other threads:[~2018-08-31  6:18 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28  8:36 [PATCH v2 0/3] RISC-V: Add new smp features Atish Patra
2018-08-28  8:36 ` [PATCH v2 1/3] RISC-V: Add logical CPU indexing for RISC-V Atish Patra
2018-08-31  6:03   ` Christoph Hellwig
2018-08-31  6:03     ` Christoph Hellwig
2018-09-04 17:59     ` Atish Patra
2018-09-04 17:59       ` Atish Patra
2018-08-28  8:36 ` [PATCH v2 2/3] RISC-V: Use Linux logical cpu number instead of hartid Atish Patra
2018-08-31  6:11   ` Christoph Hellwig
2018-08-31  6:11     ` Christoph Hellwig
2018-09-04 20:35     ` Atish Patra
2018-09-04 20:35       ` Atish Patra
2018-09-04 21:36       ` Christoph Hellwig
2018-09-04 21:36         ` Christoph Hellwig
2018-09-04 21:43         ` Atish Patra
2018-09-04 21:43           ` Atish Patra
2018-09-05 19:03           ` Christoph Hellwig
2018-09-05 19:03             ` Christoph Hellwig
2018-08-28  8:36 ` [PATCH v2 3/3] RISC-V: Support cpu hotplug Atish Patra
2018-08-31  6:18   ` Christoph Hellwig [this message]
2018-08-31  6:18     ` Christoph Hellwig
2018-09-04 18:08     ` Atish Patra
2018-09-04 18:08       ` Atish Patra
2018-09-04 21:36       ` Christoph Hellwig
2018-09-04 21:36         ` Christoph Hellwig
2018-09-04 21:40         ` Atish Patra
2018-09-04 21:40           ` Atish Patra
2018-08-30 13:53 ` [PATCH v2 0/3] RISC-V: Add new smp features Anup Patel
2018-08-30 13:53   ` Anup Patel
2018-08-30 14:11   ` Christoph Hellwig
2018-08-30 14:11     ` Christoph Hellwig
2018-08-30 14:15     ` Anup Patel
2018-08-30 14:15       ` Anup Patel
2018-08-30 14:18     ` Anup Patel
2018-08-30 14:18       ` Anup Patel
2018-08-30 16:04       ` Atish Patra
2018-08-30 16:04         ` Atish Patra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180831061859.GC19292@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-riscv@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.