Skip to content

Commit

Permalink
Merge tag 'driver-core-3.6-rc1' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/gregkh/driver-core

Pull driver core changes from Greg Kroah-Hartman:
 "Here's the big driver core pull request for 3.6-rc1.

  Unlike 3.5, this kernel should be a lot tamer, with the printk changes
  now settled down.  All we have here is some extcon driver updates, w1
  driver updates, a few printk cleanups that weren't needed for 3.5, but
  are good to have now, and some other minor fixes/changes in the driver
  core.

  All of these have been in the linux-next releases for a while now.

  Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"

* tag 'driver-core-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (38 commits)
  printk: Export struct log size and member offsets through vmcoreinfo
  Drivers: hv: Change the hex constant to a decimal constant
  driver core: don't trigger uevent after failure
  extcon: MAX77693: Add extcon-max77693 driver to support Maxim MAX77693 MUIC device
  sysfs: fail dentry revalidation after namespace change fix
  sysfs: fail dentry revalidation after namespace change
  extcon: spelling of detach in function doc
  extcon: arizona: Stop microphone detection if we give up on it
  extcon: arizona: Update cable reporting calls and split headset
  PM / Runtime: Do not increment device usage counts before probing
  kmsg - do not flush partial lines when the console is busy
  kmsg - export "continuation record" flag to /dev/kmsg
  kmsg - avoid warning for CONFIG_PRINTK=n compilations
  kmsg - properly print over-long continuation lines
  driver-core: Use kobj_to_dev instead of re-implementing it
  driver-core: Move kobj_to_dev from genhd.h to device.h
  driver core: Move deferred devices to the end of dpm_list before probing
  driver core: move uevent call to driver_register
  driver core: fix shutdown races with probe/remove(v3)
  Extcon: Arizona: Add driver for Wolfson Arizona class devices
  ...
  • Loading branch information
Linus Torvalds committed Jul 26, 2012
2 parents b13bc8d + 6791457 commit fa93669
Show file tree
Hide file tree
Showing 47 changed files with 2,159 additions and 227 deletions.
15 changes: 15 additions & 0 deletions Documentation/ABI/stable/sysfs-driver-w1_ds28e04
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
What: /sys/bus/w1/devices/.../pio
Date: May 2012
Contact: Markus Franke <franm@hrz.tu-chemnitz.de>
Description: read/write the contents of the two PIO's of the DS28E04-100
see Documentation/w1/slaves/w1_ds28e04 for detailed information
Users: any user space application which wants to communicate with DS28E04-100



What: /sys/bus/w1/devices/.../eeprom
Date: May 2012
Contact: Markus Franke <franm@hrz.tu-chemnitz.de>
Description: read/write the contents of the EEPROM memory of the DS28E04-100
see Documentation/w1/slaves/w1_ds28e04 for detailed information
Users: any user space application which wants to communicate with DS28E04-100
29 changes: 20 additions & 9 deletions Documentation/ABI/testing/dev-kmsg
Original file line number Diff line number Diff line change
Expand Up @@ -58,33 +58,44 @@ Description: The /dev/kmsg character device node provides userspace access

The output format consists of a prefix carrying the syslog
prefix including priority and facility, the 64 bit message
sequence number and the monotonic timestamp in microseconds.
The values are separated by a ','. Future extensions might
add more comma separated values before the terminating ';'.
Unknown values should be gracefully ignored.
sequence number and the monotonic timestamp in microseconds,
and a flag field. All fields are separated by a ','.

Future extensions might add more comma separated values before
the terminating ';'. Unknown fields and values should be
gracefully ignored.

The human readable text string starts directly after the ';'
and is terminated by a '\n'. Untrusted values derived from
hardware or other facilities are printed, therefore
all non-printable characters in the log message are escaped
by "\x00" C-style hex encoding.
all non-printable characters and '\' itself in the log message
are escaped by "\x00" C-style hex encoding.

A line starting with ' ', is a continuation line, adding
key/value pairs to the log message, which provide the machine
readable context of the message, for reliable processing in
userspace.

Example:
7,160,424069;pci_root PNP0A03:00: host bridge window [io 0x0000-0x0cf7] (ignored)
7,160,424069,-;pci_root PNP0A03:00: host bridge window [io 0x0000-0x0cf7] (ignored)
SUBSYSTEM=acpi
DEVICE=+acpi:PNP0A03:00
6,339,5140900;NET: Registered protocol family 10
30,340,5690716;udevd[80]: starting version 181
6,339,5140900,-;NET: Registered protocol family 10
30,340,5690716,-;udevd[80]: starting version 181

The DEVICE= key uniquely identifies devices the following way:
b12:8 - block dev_t
c127:3 - char dev_t
n8 - netdev ifindex
+sound:card0 - subsystem:devname

The flags field carries '-' by default. A 'c' indicates a
fragment of a line. All following fragments are flagged with
'+'. Note, that these hints about continuation lines are not
neccessarily correct, and the stream could be interleaved with
unrelated messages, but merging the lines in the output
usually produces better human readable results. A similar
logic is used internally when messages are printed to the
console, /proc/kmsg or the syslog() syscall.

Users: dmesg(1), userspace kernel log consumers
19 changes: 14 additions & 5 deletions Documentation/stable_kernel_rules.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Everything you ever wanted to know about Linux 2.6 -stable releases.
Everything you ever wanted to know about Linux -stable releases.

Rules on what kind of patches are accepted, and which ones are not, into the
"-stable" tree:
Expand Down Expand Up @@ -42,10 +42,10 @@ Procedure for submitting patches to the -stable tree:
cherry-picked than this can be specified in the following format in
the sign-off area:

Cc: <stable@vger.kernel.org> # .32.x: a1f84a3: sched: Check for idle
Cc: <stable@vger.kernel.org> # .32.x: 1b9508f: sched: Rate-limit newidle
Cc: <stable@vger.kernel.org> # .32.x: fd21073: sched: Fix affinity logic
Cc: <stable@vger.kernel.org> # .32.x
Cc: <stable@vger.kernel.org> # 3.3.x: a1f84a3: sched: Check for idle
Cc: <stable@vger.kernel.org> # 3.3.x: 1b9508f: sched: Rate-limit newidle
Cc: <stable@vger.kernel.org> # 3.3.x: fd21073: sched: Fix affinity logic
Cc: <stable@vger.kernel.org> # 3.3.x
Signed-off-by: Ingo Molnar <mingo@elte.hu>

The tag sequence has the meaning of:
Expand Down Expand Up @@ -79,6 +79,15 @@ Review cycle:
security kernel team, and not go through the normal review cycle.
Contact the kernel security team for more details on this procedure.

Trees:

- The queues of patches, for both completed versions and in progress
versions can be found at:
http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
- The finalized and tagged releases of all stable kernels can be found
in separate branches per version at:
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git


Review committee:

Expand Down
36 changes: 36 additions & 0 deletions Documentation/w1/slaves/w1_ds28e04
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Kernel driver w1_ds28e04
========================

Supported chips:
* Maxim DS28E04-100 4096-Bit Addressable 1-Wire EEPROM with PIO

supported family codes:
W1_FAMILY_DS28E04 0x1C

Author: Markus Franke, <franke.m@sebakmt.com> <franm@hrz.tu-chemnitz.de>

Description
-----------

Support is provided through the sysfs files "eeprom" and "pio". CRC checking
during memory accesses can optionally be enabled/disabled via the device
attribute "crccheck". The strong pull-up can optionally be enabled/disabled
via the module parameter "w1_strong_pullup".

Memory Access

A read operation on the "eeprom" file reads the given amount of bytes
from the EEPROM of the DS28E04.

A write operation on the "eeprom" file writes the given byte sequence
to the EEPROM of the DS28E04. If CRC checking mode is enabled only
fully alligned blocks of 32 bytes with valid CRC16 values (in bytes 30
and 31) are allowed to be written.

PIO Access

The 2 PIOs of the DS28E04-100 are accessible via the "pio" sysfs file.

The current status of the PIO's is returned as an 8 bit value. Bit 0/1
represent the state of PIO_0/PIO_1. Bits 2..7 do not care. The PIO's are
driven low-active, i.e. the driver delivers/expects low-active values.
8 changes: 8 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2728,6 +2728,14 @@ M: Mimi Zohar <zohar@us.ibm.com>
S: Supported
F: security/integrity/evm/

EXTERNAL CONNECTOR SUBSYSTEM (EXTCON)
M: MyungJoo Ham <myungjoo.ham@samsung.com>
M: Chanwoo Choi <cw00.choi@samsung.com>
L: linux-kernel@vger.kernel.org
S: Maintained
F: drivers/extcon/
F: Documentation/extcon/

EXYNOS DP DRIVER
M: Jingoo Han <jg1.han@samsung.com>
L: linux-fbdev@vger.kernel.org
Expand Down
1 change: 0 additions & 1 deletion drivers/base/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,6 @@ int bus_add_driver(struct device_driver *drv)
}
}

kobject_uevent(&priv->kobj, KOBJ_ADD);
return 0;

out_unregister:
Expand Down
71 changes: 44 additions & 27 deletions drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,13 @@ const char *dev_driver_string(const struct device *dev)
}
EXPORT_SYMBOL(dev_driver_string);

#define to_dev(obj) container_of(obj, struct device, kobj)
#define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)

static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
char *buf)
{
struct device_attribute *dev_attr = to_dev_attr(attr);
struct device *dev = to_dev(kobj);
struct device *dev = kobj_to_dev(kobj);
ssize_t ret = -EIO;

if (dev_attr->show)
Expand All @@ -108,7 +107,7 @@ static ssize_t dev_attr_store(struct kobject *kobj, struct attribute *attr,
const char *buf, size_t count)
{
struct device_attribute *dev_attr = to_dev_attr(attr);
struct device *dev = to_dev(kobj);
struct device *dev = kobj_to_dev(kobj);
ssize_t ret = -EIO;

if (dev_attr->store)
Expand Down Expand Up @@ -182,7 +181,7 @@ EXPORT_SYMBOL_GPL(device_show_int);
*/
static void device_release(struct kobject *kobj)
{
struct device *dev = to_dev(kobj);
struct device *dev = kobj_to_dev(kobj);
struct device_private *p = dev->p;

if (dev->release)
Expand All @@ -200,7 +199,7 @@ static void device_release(struct kobject *kobj)

static const void *device_namespace(struct kobject *kobj)
{
struct device *dev = to_dev(kobj);
struct device *dev = kobj_to_dev(kobj);
const void *ns = NULL;

if (dev->class && dev->class->ns_type)
Expand All @@ -221,7 +220,7 @@ static int dev_uevent_filter(struct kset *kset, struct kobject *kobj)
struct kobj_type *ktype = get_ktype(kobj);

if (ktype == &device_ktype) {
struct device *dev = to_dev(kobj);
struct device *dev = kobj_to_dev(kobj);
if (dev->bus)
return 1;
if (dev->class)
Expand All @@ -232,7 +231,7 @@ static int dev_uevent_filter(struct kset *kset, struct kobject *kobj)

static const char *dev_uevent_name(struct kset *kset, struct kobject *kobj)
{
struct device *dev = to_dev(kobj);
struct device *dev = kobj_to_dev(kobj);

if (dev->bus)
return dev->bus->name;
Expand All @@ -244,7 +243,7 @@ static const char *dev_uevent_name(struct kset *kset, struct kobject *kobj)
static int dev_uevent(struct kset *kset, struct kobject *kobj,
struct kobj_uevent_env *env)
{
struct device *dev = to_dev(kobj);
struct device *dev = kobj_to_dev(kobj);
int retval = 0;

/* add device node properties if present */
Expand Down Expand Up @@ -1132,7 +1131,7 @@ int device_register(struct device *dev)
*/
struct device *get_device(struct device *dev)
{
return dev ? to_dev(kobject_get(&dev->kobj)) : NULL;
return dev ? kobj_to_dev(kobject_get(&dev->kobj)) : NULL;
}

/**
Expand Down Expand Up @@ -1754,25 +1753,25 @@ int device_move(struct device *dev, struct device *new_parent,
set_dev_node(dev, dev_to_node(new_parent));
}

if (!dev->class)
goto out_put;
error = device_move_class_links(dev, old_parent, new_parent);
if (error) {
/* We ignore errors on cleanup since we're hosed anyway... */
device_move_class_links(dev, new_parent, old_parent);
if (!kobject_move(&dev->kobj, &old_parent->kobj)) {
if (new_parent)
klist_remove(&dev->p->knode_parent);
dev->parent = old_parent;
if (old_parent) {
klist_add_tail(&dev->p->knode_parent,
&old_parent->p->klist_children);
set_dev_node(dev, dev_to_node(old_parent));
if (dev->class) {
error = device_move_class_links(dev, old_parent, new_parent);
if (error) {
/* We ignore errors on cleanup since we're hosed anyway... */
device_move_class_links(dev, new_parent, old_parent);
if (!kobject_move(&dev->kobj, &old_parent->kobj)) {
if (new_parent)
klist_remove(&dev->p->knode_parent);
dev->parent = old_parent;
if (old_parent) {
klist_add_tail(&dev->p->knode_parent,
&old_parent->p->klist_children);
set_dev_node(dev, dev_to_node(old_parent));
}
}
cleanup_glue_dir(dev, new_parent_kobj);
put_device(new_parent);
goto out;
}
cleanup_glue_dir(dev, new_parent_kobj);
put_device(new_parent);
goto out;
}
switch (dpm_order) {
case DPM_ORDER_NONE:
Expand All @@ -1787,7 +1786,7 @@ int device_move(struct device *dev, struct device *new_parent,
device_pm_move_last(dev);
break;
}
out_put:

put_device(old_parent);
out:
device_pm_unlock();
Expand All @@ -1812,6 +1811,13 @@ void device_shutdown(void)
while (!list_empty(&devices_kset->list)) {
dev = list_entry(devices_kset->list.prev, struct device,
kobj.entry);

/*
* hold reference count of device's parent to
* prevent it from being freed because parent's
* lock is to be held
*/
get_device(dev->parent);
get_device(dev);
/*
* Make sure the device is off the kset list, in the
Expand All @@ -1820,6 +1826,11 @@ void device_shutdown(void)
list_del_init(&dev->kobj.entry);
spin_unlock(&devices_kset->list_lock);

/* hold lock to avoid race with probe/release */
if (dev->parent)
device_lock(dev->parent);
device_lock(dev);

/* Don't allow any more runtime suspends */
pm_runtime_get_noresume(dev);
pm_runtime_barrier(dev);
Expand All @@ -1831,7 +1842,13 @@ void device_shutdown(void)
dev_dbg(dev, "shutdown\n");
dev->driver->shutdown(dev);
}

device_unlock(dev);
if (dev->parent)
device_unlock(dev->parent);

put_device(dev);
put_device(dev->parent);

spin_lock(&devices_kset->list_lock);
}
Expand Down
20 changes: 16 additions & 4 deletions drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,20 @@ static void deferred_probe_work_func(struct work_struct *work)
* manipulate the deferred list
*/
mutex_unlock(&deferred_probe_mutex);

/*
* Force the device to the end of the dpm_list since
* the PM code assumes that the order we add things to
* the list is a good order for suspend but deferred
* probe makes that very unsafe.
*/
device_pm_lock();
device_pm_move_last(dev);
device_pm_unlock();

dev_dbg(dev, "Retrying from deferred list\n");
bus_probe_device(dev);

mutex_lock(&deferred_probe_mutex);

put_device(dev);
Expand Down Expand Up @@ -283,6 +295,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
devres_release_all(dev);
driver_sysfs_remove(dev);
dev->driver = NULL;
dev_set_drvdata(dev, NULL);

if (ret == -EPROBE_DEFER) {
/* Driver requested deferred probing */
Expand Down Expand Up @@ -356,10 +369,9 @@ int driver_probe_device(struct device_driver *drv, struct device *dev)
pr_debug("bus: '%s': %s: matched device %s with driver %s\n",
drv->bus->name, __func__, dev_name(dev), drv->name);

pm_runtime_get_noresume(dev);
pm_runtime_barrier(dev);
ret = really_probe(dev, drv);
pm_runtime_put_sync(dev);
pm_runtime_idle(dev);

return ret;
}
Expand Down Expand Up @@ -406,9 +418,8 @@ int device_attach(struct device *dev)
ret = 0;
}
} else {
pm_runtime_get_noresume(dev);
ret = bus_for_each_drv(dev->bus, NULL, dev, __device_attach);
pm_runtime_put_sync(dev);
pm_runtime_idle(dev);
}
out_unlock:
device_unlock(dev);
Expand Down Expand Up @@ -487,6 +498,7 @@ static void __device_release_driver(struct device *dev)
drv->remove(dev);
devres_release_all(dev);
dev->driver = NULL;
dev_set_drvdata(dev, NULL);
klist_remove(&dev->p->knode_driver);
if (dev->bus)
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,
Expand Down
Loading

0 comments on commit fa93669

Please sign in to comment.