Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: linux-mips@linux-mips.org
Cc: ralf@linux-mips.org, james.hogan@imgtec.com,
	paul.burton@imgtec.com, marcin.nowakowski@imgtec.com,
	justinpopo6@gmail.com, bcm-kernel-feedback-list@broadcom.com,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH 2/2] MIPS: c-r4k: Do not SMP function call during kexec
Date: Tue,  7 Mar 2017 17:46:41 -0800	[thread overview]
Message-ID: <20170308014641.16267-3-f.fainelli@gmail.com> (raw)
In-Reply-To: <20170308014641.16267-1-f.fainelli@gmail.com>

On SMP r4k cache style systems, we cannot issue a
smp_function_call_many() like what __flush_cache_all() does *after* we
have disabled interrupts for the calling CPU. Add a special check, and
do a local cache operation instead.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 arch/mips/mm/c-r4k.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index e7f798d55fbc..ea2998f1f5c5 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -19,6 +19,7 @@
 #include <linux/mm.h>
 #include <linux/export.h>
 #include <linux/bitops.h>
+#include <linux/kexec.h>
 
 #include <asm/bcache.h>
 #include <asm/bootinfo.h>
@@ -494,7 +495,10 @@ static inline void local_r4k___flush_cache_all(void * args)
 
 static void r4k___flush_cache_all(void)
 {
-	r4k_on_each_cpu(R4K_INDEX, local_r4k___flush_cache_all, NULL);
+	if (!kexec_in_progress)
+		r4k_on_each_cpu(R4K_INDEX, local_r4k___flush_cache_all, NULL);
+	else
+		local_r4k___flush_cache_all(NULL);
 }
 
 /**
-- 
2.9.3

  parent reply	other threads:[~2017-03-08  1:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-08  1:46 [PATCH 0/2] MIPS: Couple kexec related fixes Florian Fainelli
2017-03-08  1:46 ` [PATCH 1/2] MIPS: kexec: Provide bootloader arguments by default Florian Fainelli
2017-03-10 12:16   ` Ralf Baechle
2017-03-08  1:46 ` Florian Fainelli [this message]
2017-03-10 10:31   ` [PATCH 2/2] MIPS: c-r4k: Do not SMP function call during kexec Ralf Baechle

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=20170308014641.16267-3-f.fainelli@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=james.hogan@imgtec.com \
    --cc=justinpopo6@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=marcin.nowakowski@imgtec.com \
    --cc=paul.burton@imgtec.com \
    --cc=ralf@linux-mips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox