linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Atish Patra <atish.patra@wdc.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: "palmer@sifive.com" <palmer@sifive.com>,
	"linux-riscv@lists.infradead.org"
	<linux-riscv@lists.infradead.org>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"anup@brainfault.org" <anup@brainfault.org>,
	"tglx@linutronix.de" <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"damein@vger.kernel.org" <damein@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] RISC-V: Use Linux logical cpu number instead of hartid
Date: Tue, 4 Sep 2018 13:35:10 -0700	[thread overview]
Message-ID: <ec0819d5-9dc6-6b25-47a9-cd9d9e5099a8@wdc.com> (raw)
In-Reply-To: <20180831061104.GB19292@infradead.org>

On 8/30/18 11:11 PM, Christoph Hellwig wrote:
>> -#define flush_tlb_all() sbi_remote_sfence_vma(NULL, 0, -1)
>> +static inline void remote_sfence_vma(struct cpumask *cmask, unsigned long start,
>> +				     unsigned long size)
>> +{
>> +	struct cpumask hmask;
>> +
>> +	riscv_cpuid_to_hartid_mask(cmask, &hmask);
>> +	sbi_remote_sfence_vma(hmask.bits, start, size);
>> +}
>> +
>> +#define flush_tlb_all() remote_sfence_vma(NULL, 0, -1)
> 
> flush_tlb_all passed NULL to sbi_remote_sfence_vma before, so this
> changes what we pass.  I think we should keep the existing behavior.
> 

sure. How about this ?


--- a/arch/riscv/include/asm/tlbflush.h
+++ b/arch/riscv/include/asm/tlbflush.h
@@ -55,8 +55,13 @@ static inline void remote_sfence_vma(struct cpumask 
*cmask, unsigned long start,
  {
         struct cpumask hmask;

-       riscv_cpuid_to_hartid_mask(cmask, &hmask);
-       sbi_remote_sfence_vma(hmask.bits, start, size);
+       if (cmask == NULL) {
+               sbi_remote_sfence_vma(NULL, start, size);
+       } else {
+               cpumask_clear(&hmask);
+               riscv_cpuid_to_hartid_mask(cmask, &hmask);
+               sbi_remote_sfence_vma(hmask.bits, start, size);
+       }
  }

>> @@ -93,10 +94,11 @@ static inline void plic_toggle(int ctxid, int hwirq, int enable)
>>   static inline void plic_irq_toggle(struct irq_data *d, int enable)
>>   {
>>   	int cpu;
>> +	struct plic_handler *handler;
>>   
>>   	writel(enable, plic_regs + PRIORITY_BASE + d->hwirq * PRIORITY_PER_ID);
>>   	for_each_cpu(cpu, irq_data_get_affinity_mask(d)) {
>> -		struct plic_handler *handler = per_cpu_ptr(&plic_handlers, cpu);
>> +		handler = per_cpu_ptr(&plic_handlers, cpu);
> 
> This looks like a spurious change.
> 

I think I did this to avoid possible compiler warnings. Will revert it.

Regards,
Atish


  reply	other threads:[~2018-09-04 20:35 UTC|newest]

Thread overview: 20+ 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-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-09-04 20:35     ` Atish Patra [this message]
2018-09-04 21:36       ` Christoph Hellwig
2018-09-04 21:43         ` Atish Patra
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
2018-09-04 18:08     ` Atish Patra
2018-09-04 21:36       ` Christoph Hellwig
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 14:11   ` Christoph Hellwig
2018-08-30 14:15     ` Anup Patel
2018-08-30 14:18     ` Anup Patel
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=ec0819d5-9dc6-6b25-47a9-cd9d9e5099a8@wdc.com \
    --to=atish.patra@wdc.com \
    --cc=anup@brainfault.org \
    --cc=damein@vger.kernel.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=mark.rutland@arm.com \
    --cc=palmer@sifive.com \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).