Home Home > GIT Browse > openSUSE-42.2
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-01-11 14:42:55 +0100
committerMichal Suchanek <msuchanek@suse.de>2018-01-11 16:18:14 +0100
commite0ec83bf83e5252928c030873b7dc936cbb9cfe4 (patch)
treefda26334604cc360fa52040734bb69db472e260d
parent50a9cbfdcc4037aad422be83fd5106f4a8d42633 (diff)
powerpc/rfi-flush: Move the logic to avoid a redo into the
sysfs code (bsc#1068032, bsc#1075087). suse-commit: 3b4e3c8c70f5df0b8cce6aee3a87409fa92e3555
-rw-r--r--arch/powerpc/kernel/setup_64.c3
-rw-r--r--arch/powerpc/kernel/sysfs.c9
2 files changed, 7 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index d468c6c0ba3a..398958999c34 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -875,9 +875,6 @@ static void do_nothing(void *unused)
void rfi_flush_enable(bool enable)
{
- if (rfi_flush == enable)
- return;
-
if (enable) {
do_rfi_flush_fixups(enabled_flush_types);
on_each_cpu(do_nothing, NULL, 1);
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
index 2266b1494756..d09710429411 100644
--- a/arch/powerpc/kernel/sysfs.c
+++ b/arch/powerpc/kernel/sysfs.c
@@ -509,6 +509,7 @@ static ssize_t __used store_rfi_flush(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{
+ bool enable;
int val;
int ret = 0;
@@ -517,12 +518,16 @@ static ssize_t __used store_rfi_flush(struct device *dev,
return -EINVAL;
if (val == 1)
- rfi_flush_enable(true);
+ enable = true;
else if (val == 0)
- rfi_flush_enable(false);
+ enable = false;
else
return -EINVAL;
+ /* Only do anything if we're changing state */
+ if (enable != rfi_flush)
+ rfi_flush_enable(enable);
+
return count;
}