Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 05fc46b8 authored by Olav Haugan's avatar Olav Haugan Committed by Satya Durga Srinivasu Prabhala
Browse files

driver-core: cpu: Make isolate node read-only



We no longer support isolating a core using the isolate node. Remove
write-access to this node.

Change-Id: I89d7b0d7f1c560fefac833e1fc165312a61cf3aa
Signed-off-by: default avatarOlav Haugan <ohaugan@codeaurora.org>
Signed-off-by: default avatarSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
parent 5e0925de
Loading
Loading
Loading
Loading
+3 −27
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ static struct attribute_group crash_note_cpu_attr_group = {

#ifdef CONFIG_HOTPLUG_CPU

static ssize_t show_cpu_isolated(struct device *dev,
static ssize_t isolate_show(struct device *dev,
			    struct device_attribute *attr, char *buf)
{
	struct cpu *cpu = container_of(dev, struct cpu, dev);
@@ -198,31 +198,7 @@ static ssize_t show_cpu_isolated(struct device *dev,
	return rc;
}

static ssize_t __ref store_cpu_isolated(struct device *dev,
				struct device_attribute *attr,
				const char *buf, size_t count)
{
	struct cpu *cpu = container_of(dev, struct cpu, dev);
	int err;
	int cpuid = cpu->dev.id;
	unsigned int isolated;

	err = kstrtouint(strstrip((char *)buf), 0, &isolated);
	if (err)
		return err;

	if (isolated > 1)
		return -EINVAL;

	if (isolated)
		sched_isolate_cpu(cpuid);
	else
		sched_unisolate_cpu(cpuid);

	return count;
}

static DEVICE_ATTR(isolate, 0644, show_cpu_isolated, store_cpu_isolated);
static DEVICE_ATTR_RO(isolate);

static struct attribute *cpu_isolated_attrs[] = {
	&dev_attr_isolate.attr,