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

Commit c483c471 authored by Neeraj Upadhyay's avatar Neeraj Upadhyay Committed by Gerrit - the friendly Code Review server
Browse files

drivers: base: cpu: Add a knob to suppress cpu uevents



Provide an interface to suppress cpu uevents. This allows
uevents to be supressed during CPU hotplug. This is needed
for cases, where userspace wants to ignore processing CPU
sysfs nodes during CPU online notifications, for CPUs which
were online during coldboot, but were later hotplugged out,
and for which sysfs nodes were persistent across hotplug.

Change-Id: Ib88e61725fcf589adc195a637c00836ca9155afe
Signed-off-by: default avatarNeeraj Upadhyay <neeraju@codeaurora.org>
parent ae5da9c9
Loading
Loading
Loading
Loading
+28 −0
Original line number Original line Diff line number Diff line
@@ -439,6 +439,33 @@ static struct attribute_group sched_qhmp_cpu_attr_group = {
};
};


#endif	/* CONFIG_SCHED_QHMP */
#endif	/* CONFIG_SCHED_QHMP */

static ssize_t uevent_suppress_store(struct device *dev,
				struct device_attribute *attr,
				const char *buf, size_t count)
{
	bool val;
	int ret;

	ret = strtobool(buf, &val);
	if (ret < 0)
		return ret;

	dev_set_uevent_suppress(dev, val);
	return count;
}

static DEVICE_ATTR_WO(uevent_suppress);

static struct attribute *uevent_suppress_cpu_attrs[] = {
	&dev_attr_uevent_suppress.attr,
	NULL
};

static struct attribute_group uevent_suppress_cpu_attr_group = {
	.attrs = uevent_suppress_cpu_attrs,
};

static const struct attribute_group *common_cpu_attr_groups[] = {
static const struct attribute_group *common_cpu_attr_groups[] = {
#ifdef CONFIG_KEXEC
#ifdef CONFIG_KEXEC
	&crash_note_cpu_attr_group,
	&crash_note_cpu_attr_group,
@@ -462,6 +489,7 @@ static const struct attribute_group *hotplugable_cpu_attr_groups[] = {
#ifdef CONFIG_SCHED_QHMP
#ifdef CONFIG_SCHED_QHMP
	&sched_qhmp_cpu_attr_group,
	&sched_qhmp_cpu_attr_group,
#endif
#endif
	&uevent_suppress_cpu_attr_group,
	NULL
	NULL
};
};