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

Commit 2794b5d4 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'driver-core-3.10-rc1' of...

Merge tag 'driver-core-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core



Pull driver core update from Greg Kroah-Hartman:
 "Here's the merge request for the driver core tree for 3.10-rc1

  It's pretty small, just a number of driver core and sysfs updates and
  fixes, all of which have been in linux-next for a while now.

  Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org&gt;">

Fixed conflict in kernel/rtmutex-tester.c, the locking tree had a better
fix for the same sysfs file mode problem.

* tag 'driver-core-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  PM / Runtime: Idle devices asynchronously after probe|release
  driver core: handle user namespaces properly with the uid/gid devtmpfs change
  driver core: devtmpfs: fix compile failure with CONFIG_UIDGID_STRICT_TYPE_CHECKS
  devtmpfs: add base.h include
  driver core: add uid and gid to devtmpfs
  sysfs: check if one entry has been removed before freeing
  sysfs: fix crash_notes_size build warning
  sysfs: fix use after free in case of concurrent read/write and readdir
  rtmutex-tester: fix mode of sysfs files
  Documentation: Add ABI entry for crash_notes and crash_notes_size
  sysfs: Add crash_notes_size to export percpu note size
  driver core: platform_device.h: fix checkpatch errors and warnings
  driver core: platform.c: fix checkpatch errors and warnings
  driver core: warn that platform_driver_probe can not use deferred probing
  sysfs: use atomic_inc_unless_negative in sysfs_get_active
  base: core: WARN() about bogus permissions on device attributes
  device: separate all subsys mutexes
parents 4f567cbc 0d1d392f
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -173,3 +173,15 @@ Description: Processor frequency boosting control
		Boosting allows the CPU and the firmware to run at a frequency
		Boosting allows the CPU and the firmware to run at a frequency
		beyound it's nominal limit.
		beyound it's nominal limit.
		More details can be found in Documentation/cpu-freq/boost.txt
		More details can be found in Documentation/cpu-freq/boost.txt


What:		/sys/devices/system/cpu/cpu#/crash_notes
		/sys/devices/system/cpu/cpu#/crash_notes_size
Date:		April 2013
Contact:	kexec@lists.infradead.org
Description:	address and size of the percpu note.

		crash_notes: the physical address of the memory that holds the
		note of cpu#.

		crash_notes_size: size of the note of cpu#.
+2 −1
Original line number Original line Diff line number Diff line
@@ -1111,7 +1111,8 @@ struct class block_class = {
	.name		= "block",
	.name		= "block",
};
};


static char *block_devnode(struct device *dev, umode_t *mode)
static char *block_devnode(struct device *dev, umode_t *mode,
			   kuid_t *uid, kgid_t *gid)
{
{
	struct gendisk *disk = dev_to_disk(dev);
	struct gendisk *disk = dev_to_disk(dev);


+4 −4
Original line number Original line Diff line number Diff line
@@ -898,18 +898,18 @@ static ssize_t bus_uevent_store(struct bus_type *bus,
static BUS_ATTR(uevent, S_IWUSR, NULL, bus_uevent_store);
static BUS_ATTR(uevent, S_IWUSR, NULL, bus_uevent_store);


/**
/**
 * __bus_register - register a driver-core subsystem
 * bus_register - register a driver-core subsystem
 * @bus: bus to register
 * @bus: bus to register
 * @key: lockdep class key
 *
 *
 * Once we have that, we register the bus with the kobject
 * Once we have that, we register the bus with the kobject
 * infrastructure, then register the children subsystems it has:
 * infrastructure, then register the children subsystems it has:
 * the devices and drivers that belong to the subsystem.
 * the devices and drivers that belong to the subsystem.
 */
 */
int __bus_register(struct bus_type *bus, struct lock_class_key *key)
int bus_register(struct bus_type *bus)
{
{
	int retval;
	int retval;
	struct subsys_private *priv;
	struct subsys_private *priv;
	struct lock_class_key *key = &bus->lock_key;


	priv = kzalloc(sizeof(struct subsys_private), GFP_KERNEL);
	priv = kzalloc(sizeof(struct subsys_private), GFP_KERNEL);
	if (!priv)
	if (!priv)
@@ -981,7 +981,7 @@ out:
	bus->p = NULL;
	bus->p = NULL;
	return retval;
	return retval;
}
}
EXPORT_SYMBOL_GPL(__bus_register);
EXPORT_SYMBOL_GPL(bus_register);


/**
/**
 * bus_unregister - remove a bus from the system
 * bus_unregister - remove a bus from the system
+21 −5
Original line number Original line Diff line number Diff line
@@ -283,15 +283,21 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
		const char *tmp;
		const char *tmp;
		const char *name;
		const char *name;
		umode_t mode = 0;
		umode_t mode = 0;
		kuid_t uid = GLOBAL_ROOT_UID;
		kgid_t gid = GLOBAL_ROOT_GID;


		add_uevent_var(env, "MAJOR=%u", MAJOR(dev->devt));
		add_uevent_var(env, "MAJOR=%u", MAJOR(dev->devt));
		add_uevent_var(env, "MINOR=%u", MINOR(dev->devt));
		add_uevent_var(env, "MINOR=%u", MINOR(dev->devt));
		name = device_get_devnode(dev, &mode, &tmp);
		name = device_get_devnode(dev, &mode, &uid, &gid, &tmp);
		if (name) {
		if (name) {
			add_uevent_var(env, "DEVNAME=%s", name);
			add_uevent_var(env, "DEVNAME=%s", name);
			kfree(tmp);
			if (mode)
			if (mode)
				add_uevent_var(env, "DEVMODE=%#o", mode & 0777);
				add_uevent_var(env, "DEVMODE=%#o", mode & 0777);
			if (!uid_eq(uid, GLOBAL_ROOT_UID))
				add_uevent_var(env, "DEVUID=%u", from_kuid(&init_user_ns, uid));
			if (!gid_eq(gid, GLOBAL_ROOT_GID))
				add_uevent_var(env, "DEVGID=%u", from_kgid(&init_user_ns, gid));
			kfree(tmp);
		}
		}
	}
	}


@@ -563,8 +569,15 @@ int device_create_file(struct device *dev,
		       const struct device_attribute *attr)
		       const struct device_attribute *attr)
{
{
	int error = 0;
	int error = 0;
	if (dev)

	if (dev) {
		WARN(((attr->attr.mode & S_IWUGO) && !attr->store),
				"Write permission without 'store'\n");
		WARN(((attr->attr.mode & S_IRUGO) && !attr->show),
				"Read permission without 'show'\n");
		error = sysfs_create_file(&dev->kobj, &attr->attr);
		error = sysfs_create_file(&dev->kobj, &attr->attr);
	}

	return error;
	return error;
}
}


@@ -1274,6 +1287,8 @@ static struct device *next_device(struct klist_iter *i)
 * device_get_devnode - path of device node file
 * device_get_devnode - path of device node file
 * @dev: device
 * @dev: device
 * @mode: returned file access mode
 * @mode: returned file access mode
 * @uid: returned file owner
 * @gid: returned file group
 * @tmp: possibly allocated string
 * @tmp: possibly allocated string
 *
 *
 * Return the relative path of a possible device node.
 * Return the relative path of a possible device node.
@@ -1282,7 +1297,8 @@ static struct device *next_device(struct klist_iter *i)
 * freed by the caller.
 * freed by the caller.
 */
 */
const char *device_get_devnode(struct device *dev,
const char *device_get_devnode(struct device *dev,
			       umode_t *mode, const char **tmp)
			       umode_t *mode, kuid_t *uid, kgid_t *gid,
			       const char **tmp)
{
{
	char *s;
	char *s;


@@ -1290,7 +1306,7 @@ const char *device_get_devnode(struct device *dev,


	/* the device type may provide a specific name */
	/* the device type may provide a specific name */
	if (dev->type && dev->type->devnode)
	if (dev->type && dev->type->devnode)
		*tmp = dev->type->devnode(dev, mode);
		*tmp = dev->type->devnode(dev, mode, uid, gid);
	if (*tmp)
	if (*tmp)
		return *tmp;
		return *tmp;


+14 −0
Original line number Original line Diff line number Diff line
@@ -132,6 +132,17 @@ static ssize_t show_crash_notes(struct device *dev, struct device_attribute *att
	return rc;
	return rc;
}
}
static DEVICE_ATTR(crash_notes, 0400, show_crash_notes, NULL);
static DEVICE_ATTR(crash_notes, 0400, show_crash_notes, NULL);

static ssize_t show_crash_notes_size(struct device *dev,
				     struct device_attribute *attr,
				     char *buf)
{
	ssize_t rc;

	rc = sprintf(buf, "%zu\n", sizeof(note_buf_t));
	return rc;
}
static DEVICE_ATTR(crash_notes_size, 0400, show_crash_notes_size, NULL);
#endif
#endif


/*
/*
@@ -259,6 +270,9 @@ int __cpuinit register_cpu(struct cpu *cpu, int num)
#ifdef CONFIG_KEXEC
#ifdef CONFIG_KEXEC
	if (!error)
	if (!error)
		error = device_create_file(&cpu->dev, &dev_attr_crash_notes);
		error = device_create_file(&cpu->dev, &dev_attr_crash_notes);
	if (!error)
		error = device_create_file(&cpu->dev,
					   &dev_attr_crash_notes_size);
#endif
#endif
	return error;
	return error;
}
}
Loading