From: Oliver O'Halloran <oohall@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: mikey@neuling.org, Oliver O'Halloran <oohall@gmail.com>
Subject: [PATCH] powerpc/time: clear LPCR.LD when unneeded
Date: Fri, 16 Dec 2016 13:34:54 +1100 [thread overview]
Message-ID: <1481855694-17230-1-git-send-email-oohall@gmail.com> (raw)
Currently the kernel will enable LD mode at boot when required. However,
when using kexec the second kernel may not want to have the LD enabled.
This patch ensures the second kernel will explicitly clear the LD flag
when not required by the current kernel.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
arch/powerpc/kernel/time.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index be9751f1cb2a..816700e8a475 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -925,18 +925,16 @@ static void register_decrementer_clockevent(int cpu)
static void enable_large_decrementer(void)
{
- if (!cpu_has_feature(CPU_FTR_ARCH_300))
- return;
-
- if (decrementer_max <= DECREMENTER_DEFAULT_MAX)
- return;
-
/*
* If we're running as the hypervisor we need to enable the LD manually
* otherwise firmware should have done it for us.
*/
- if (cpu_has_feature(CPU_FTR_HVMODE))
+ if (decrementer_max > DECREMENTER_DEFAULT_MAX
+ && cpu_has_feature(CPU_FTR_HVMODE)
+ && cpu_has_feature(CPU_FTR_ARCH_300))
mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) | LPCR_LD);
+ else
+ mtspr(SPRN_LPCR, mfspr(SPRN_LPCR) & ~LPCR_LD);
}
static void __init set_decrementer_max(void)
--
2.7.4
reply other threads:[~2016-12-16 2:35 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1481855694-17230-1-git-send-email-oohall@gmail.com \
--to=oohall@gmail.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mikey@neuling.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;
as well as URLs for NNTP newsgroup(s).