Home Home > GIT Browse > openSUSE-42.3
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 15:43:53 +0100
commit739075b0936f567cf0a81c4500a99025f41d9e56 (patch)
tree9e0fa8ff6e967d8afd11887b19737a76380e797b
parenta9b1ee853ce92719a11aab43e7bc4afb91e948b1 (diff)
powerpc/rfi-flush: Move the logic to avoid a redo into the
sysfs code (bsc#1068032, bsc#1075087). suse-commit: 8c5573d02e74f3566445322c336e7d3258b49dd7
-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 ca50bdb0ad28..669a59792977 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -884,9 +884,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;
}