From: oss@buserror.net (Scott Wood)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 5/5] arm64: arch_timer: Add command line parameter for A-008585
Date: Fri, 9 Sep 2016 20:03:33 -0500 [thread overview]
Message-ID: <1473469413-11019-5-git-send-email-oss@buserror.net> (raw)
In-Reply-To: <1473469413-11019-1-git-send-email-oss@buserror.net>
This allows KVM users to enable the workaround until a mechanism
is implemented to automatically communicate this information.
Signed-off-by: Scott Wood <oss@buserror.net>
---
Documentation/kernel-parameters.txt | 9 +++++++++
drivers/clocksource/arm_arch_timer.c | 20 +++++++++++++++++++-
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index a4f4d69..25037de 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -698,6 +698,15 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
loops can be debugged more effectively on production
systems.
+ clocksource.arm_arch_timer.fsl-a008585=
+ [ARM64]
+ Format: <bool>
+ Enable/disable the workaround of Freescale/NXP
+ erratum A-008585. This can be useful for KVM
+ guests, if the guest device tree doesn't show the
+ erratum. If unspecified, the workaround is
+ enabled based on the device tree.
+
clearcpuid=BITNUM [X86]
Disable CPUID feature X for the kernel. See
arch/x86/include/asm/cpufeatures.h for the valid bit
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 36d4ee1..e70e530 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -98,6 +98,22 @@ early_param("clocksource.arm_arch_timer.evtstrm", early_evtstrm_cfg);
DEFINE_STATIC_KEY_FALSE(arch_timer_read_ool_enabled);
EXPORT_SYMBOL_GPL(arch_timer_read_ool_enabled);
+static int fsl_a008585_enable = -1;
+
+static int __init early_fsl_a008585_cfg(char *buf)
+{
+ int ret;
+ bool val;
+
+ ret = strtobool(buf, &val);
+ if (ret)
+ return ret;
+
+ fsl_a008585_enable = val;
+ return 0;
+}
+early_param("clocksource.arm_arch_timer.fsl-a008585", early_fsl_a008585_cfg);
+
/*
* __always_inline is used to ensure that func() is not an actual function
* pointer, which would result in the register accesses potentially being too
@@ -895,7 +911,9 @@ static int __init arch_timer_of_init(struct device_node *np)
arch_timer_c3stop = !of_property_read_bool(np, "always-on");
#ifdef CONFIG_FSL_ERRATUM_A008585
- if (of_property_read_bool(np, "fsl,erratum-a008585"))
+ if (fsl_a008585_enable < 0)
+ fsl_a008585_enable = of_property_read_bool(np, "fsl,erratum-a008585");
+ if (fsl_a008585_enable)
static_branch_enable(&arch_timer_read_ool_enabled);
#endif
--
2.7.4
prev parent reply other threads:[~2016-09-10 1:03 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-10 1:03 [PATCH v5 1/5] arm64: arch_timer: Add device tree binding for A-008585 erratum Scott Wood
2016-09-10 1:03 ` [PATCH v5 2/5] arm64: dts: Add timer erratum property for LS2080A and LS1043A Scott Wood
2016-09-10 1:03 ` [PATCH v5 3/5] arm64: arch_timer: Work around QorIQ Erratum A-008585 Scott Wood
2016-09-12 11:36 ` Mark Rutland
2016-09-12 11:44 ` Will Deacon
2016-09-12 12:30 ` Mark Rutland
2016-09-12 12:59 ` Mark Rutland
2016-09-12 13:07 ` Marc Zyngier
2016-09-19 4:31 ` Scott Wood
2016-09-19 16:55 ` Mark Rutland
2016-09-19 4:28 ` Scott Wood
2016-09-19 7:44 ` Arnd Bergmann
2016-09-20 12:52 ` Shawn Guo
2016-09-19 4:41 ` Scott Wood
2016-09-19 16:52 ` Mark Rutland
2016-09-19 17:01 ` Scott Wood
2016-09-19 17:07 ` Mark Rutland
2016-09-19 19:16 ` Scott Wood
2016-09-20 9:35 ` Mark Rutland
2016-09-22 8:34 ` Scott Wood
2016-09-10 1:03 ` [PATCH v5 4/5] arm/arm64: arch_timer: Use archdata to indicate vdso suitability Scott Wood
2016-09-10 1:03 ` Scott Wood [this message]
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=1473469413-11019-5-git-send-email-oss@buserror.net \
--to=oss@buserror.net \
--cc=linux-arm-kernel@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 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).