Skip to content

Commit fa93669

Browse files
committed
Merge tag 'driver-core-3.6-rc1' of git://git.kernel.org/pub/scm/linux/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 ...
2 parents b13bc8d + 6791457 commit fa93669

47 files changed

Lines changed: 2159 additions & 227 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
What: /sys/bus/w1/devices/.../pio
2+
Date: May 2012
3+
Contact: Markus Franke <franm@hrz.tu-chemnitz.de>
4+
Description: read/write the contents of the two PIO's of the DS28E04-100
5+
see Documentation/w1/slaves/w1_ds28e04 for detailed information
6+
Users: any user space application which wants to communicate with DS28E04-100
7+
8+
9+
10+
What: /sys/bus/w1/devices/.../eeprom
11+
Date: May 2012
12+
Contact: Markus Franke <franm@hrz.tu-chemnitz.de>
13+
Description: read/write the contents of the EEPROM memory of the DS28E04-100
14+
see Documentation/w1/slaves/w1_ds28e04 for detailed information
15+
Users: any user space application which wants to communicate with DS28E04-100

‎Documentation/ABI/testing/dev-kmsg‎

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,33 +58,44 @@ Description: The /dev/kmsg character device node provides userspace access
5858

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

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

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

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

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

92+
The flags field carries '-' by default. A 'c' indicates a
93+
fragment of a line. All following fragments are flagged with
94+
'+'. Note, that these hints about continuation lines are not
95+
neccessarily correct, and the stream could be interleaved with
96+
unrelated messages, but merging the lines in the output
97+
usually produces better human readable results. A similar
98+
logic is used internally when messages are printed to the
99+
console, /proc/kmsg or the syslog() syscall.
100+
90101
Users: dmesg(1), userspace kernel log consumers

‎Documentation/stable_kernel_rules.txt‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Everything you ever wanted to know about Linux 2.6 -stable releases.
1+
Everything you ever wanted to know about Linux -stable releases.
22

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

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

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

82+
Trees:
83+
84+
- The queues of patches, for both completed versions and in progress
85+
versions can be found at:
86+
http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
87+
- The finalized and tagged releases of all stable kernels can be found
88+
in separate branches per version at:
89+
http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git
90+
8291

8392
Review committee:
8493

‎Documentation/w1/slaves/w1_ds28e04‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Kernel driver w1_ds28e04
2+
========================
3+
4+
Supported chips:
5+
* Maxim DS28E04-100 4096-Bit Addressable 1-Wire EEPROM with PIO
6+
7+
supported family codes:
8+
W1_FAMILY_DS28E04 0x1C
9+
10+
Author: Markus Franke, <franke.m@sebakmt.com> <franm@hrz.tu-chemnitz.de>
11+
12+
Description
13+
-----------
14+
15+
Support is provided through the sysfs files "eeprom" and "pio". CRC checking
16+
during memory accesses can optionally be enabled/disabled via the device
17+
attribute "crccheck". The strong pull-up can optionally be enabled/disabled
18+
via the module parameter "w1_strong_pullup".
19+
20+
Memory Access
21+
22+
A read operation on the "eeprom" file reads the given amount of bytes
23+
from the EEPROM of the DS28E04.
24+
25+
A write operation on the "eeprom" file writes the given byte sequence
26+
to the EEPROM of the DS28E04. If CRC checking mode is enabled only
27+
fully alligned blocks of 32 bytes with valid CRC16 values (in bytes 30
28+
and 31) are allowed to be written.
29+
30+
PIO Access
31+
32+
The 2 PIOs of the DS28E04-100 are accessible via the "pio" sysfs file.
33+
34+
The current status of the PIO's is returned as an 8 bit value. Bit 0/1
35+
represent the state of PIO_0/PIO_1. Bits 2..7 do not care. The PIO's are
36+
driven low-active, i.e. the driver delivers/expects low-active values.

‎MAINTAINERS‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2728,6 +2728,14 @@ M: Mimi Zohar <zohar@us.ibm.com>
27282728
S: Supported
27292729
F: security/integrity/evm/
27302730

2731+
EXTERNAL CONNECTOR SUBSYSTEM (EXTCON)
2732+
M: MyungJoo Ham <myungjoo.ham@samsung.com>
2733+
M: Chanwoo Choi <cw00.choi@samsung.com>
2734+
L: linux-kernel@vger.kernel.org
2735+
S: Maintained
2736+
F: drivers/extcon/
2737+
F: Documentation/extcon/
2738+
27312739
EXYNOS DP DRIVER
27322740
M: Jingoo Han <jg1.han@samsung.com>
27332741
L: linux-fbdev@vger.kernel.org

‎drivers/base/bus.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,6 @@ int bus_add_driver(struct device_driver *drv)
743743
}
744744
}
745745

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

749748
out_unregister:

‎drivers/base/core.c‎

Lines changed: 44 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,13 @@ const char *dev_driver_string(const struct device *dev)
8585
}
8686
EXPORT_SYMBOL(dev_driver_string);
8787

88-
#define to_dev(obj) container_of(obj, struct device, kobj)
8988
#define to_dev_attr(_attr) container_of(_attr, struct device_attribute, attr)
9089

9190
static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
9291
char *buf)
9392
{
9493
struct device_attribute *dev_attr = to_dev_attr(attr);
95-
struct device *dev = to_dev(kobj);
94+
struct device *dev = kobj_to_dev(kobj);
9695
ssize_t ret = -EIO;
9796

9897
if (dev_attr->show)
@@ -108,7 +107,7 @@ static ssize_t dev_attr_store(struct kobject *kobj, struct attribute *attr,
108107
const char *buf, size_t count)
109108
{
110109
struct device_attribute *dev_attr = to_dev_attr(attr);
111-
struct device *dev = to_dev(kobj);
110+
struct device *dev = kobj_to_dev(kobj);
112111
ssize_t ret = -EIO;
113112

114113
if (dev_attr->store)
@@ -182,7 +181,7 @@ EXPORT_SYMBOL_GPL(device_show_int);
182181
*/
183182
static void device_release(struct kobject *kobj)
184183
{
185-
struct device *dev = to_dev(kobj);
184+
struct device *dev = kobj_to_dev(kobj);
186185
struct device_private *p = dev->p;
187186

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

201200
static const void *device_namespace(struct kobject *kobj)
202201
{
203-
struct device *dev = to_dev(kobj);
202+
struct device *dev = kobj_to_dev(kobj);
204203
const void *ns = NULL;
205204

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

223222
if (ktype == &device_ktype) {
224-
struct device *dev = to_dev(kobj);
223+
struct device *dev = kobj_to_dev(kobj);
225224
if (dev->bus)
226225
return 1;
227226
if (dev->class)
@@ -232,7 +231,7 @@ static int dev_uevent_filter(struct kset *kset, struct kobject *kobj)
232231

233232
static const char *dev_uevent_name(struct kset *kset, struct kobject *kobj)
234233
{
235-
struct device *dev = to_dev(kobj);
234+
struct device *dev = kobj_to_dev(kobj);
236235

237236
if (dev->bus)
238237
return dev->bus->name;
@@ -244,7 +243,7 @@ static const char *dev_uevent_name(struct kset *kset, struct kobject *kobj)
244243
static int dev_uevent(struct kset *kset, struct kobject *kobj,
245244
struct kobj_uevent_env *env)
246245
{
247-
struct device *dev = to_dev(kobj);
246+
struct device *dev = kobj_to_dev(kobj);
248247
int retval = 0;
249248

250249
/* add device node properties if present */
@@ -1132,7 +1131,7 @@ int device_register(struct device *dev)
11321131
*/
11331132
struct device *get_device(struct device *dev)
11341133
{
1135-
return dev ? to_dev(kobject_get(&dev->kobj)) : NULL;
1134+
return dev ? kobj_to_dev(kobject_get(&dev->kobj)) : NULL;
11361135
}
11371136

11381137
/**
@@ -1754,25 +1753,25 @@ int device_move(struct device *dev, struct device *new_parent,
17541753
set_dev_node(dev, dev_to_node(new_parent));
17551754
}
17561755

1757-
if (!dev->class)
1758-
goto out_put;
1759-
error = device_move_class_links(dev, old_parent, new_parent);
1760-
if (error) {
1761-
/* We ignore errors on cleanup since we're hosed anyway... */
1762-
device_move_class_links(dev, new_parent, old_parent);
1763-
if (!kobject_move(&dev->kobj, &old_parent->kobj)) {
1764-
if (new_parent)
1765-
klist_remove(&dev->p->knode_parent);
1766-
dev->parent = old_parent;
1767-
if (old_parent) {
1768-
klist_add_tail(&dev->p->knode_parent,
1769-
&old_parent->p->klist_children);
1770-
set_dev_node(dev, dev_to_node(old_parent));
1756+
if (dev->class) {
1757+
error = device_move_class_links(dev, old_parent, new_parent);
1758+
if (error) {
1759+
/* We ignore errors on cleanup since we're hosed anyway... */
1760+
device_move_class_links(dev, new_parent, old_parent);
1761+
if (!kobject_move(&dev->kobj, &old_parent->kobj)) {
1762+
if (new_parent)
1763+
klist_remove(&dev->p->knode_parent);
1764+
dev->parent = old_parent;
1765+
if (old_parent) {
1766+
klist_add_tail(&dev->p->knode_parent,
1767+
&old_parent->p->klist_children);
1768+
set_dev_node(dev, dev_to_node(old_parent));
1769+
}
17711770
}
1771+
cleanup_glue_dir(dev, new_parent_kobj);
1772+
put_device(new_parent);
1773+
goto out;
17721774
}
1773-
cleanup_glue_dir(dev, new_parent_kobj);
1774-
put_device(new_parent);
1775-
goto out;
17761775
}
17771776
switch (dpm_order) {
17781777
case DPM_ORDER_NONE:
@@ -1787,7 +1786,7 @@ int device_move(struct device *dev, struct device *new_parent,
17871786
device_pm_move_last(dev);
17881787
break;
17891788
}
1790-
out_put:
1789+
17911790
put_device(old_parent);
17921791
out:
17931792
device_pm_unlock();
@@ -1812,6 +1811,13 @@ void device_shutdown(void)
18121811
while (!list_empty(&devices_kset->list)) {
18131812
dev = list_entry(devices_kset->list.prev, struct device,
18141813
kobj.entry);
1814+
1815+
/*
1816+
* hold reference count of device's parent to
1817+
* prevent it from being freed because parent's
1818+
* lock is to be held
1819+
*/
1820+
get_device(dev->parent);
18151821
get_device(dev);
18161822
/*
18171823
* Make sure the device is off the kset list, in the
@@ -1820,6 +1826,11 @@ void device_shutdown(void)
18201826
list_del_init(&dev->kobj.entry);
18211827
spin_unlock(&devices_kset->list_lock);
18221828

1829+
/* hold lock to avoid race with probe/release */
1830+
if (dev->parent)
1831+
device_lock(dev->parent);
1832+
device_lock(dev);
1833+
18231834
/* Don't allow any more runtime suspends */
18241835
pm_runtime_get_noresume(dev);
18251836
pm_runtime_barrier(dev);
@@ -1831,7 +1842,13 @@ void device_shutdown(void)
18311842
dev_dbg(dev, "shutdown\n");
18321843
dev->driver->shutdown(dev);
18331844
}
1845+
1846+
device_unlock(dev);
1847+
if (dev->parent)
1848+
device_unlock(dev->parent);
1849+
18341850
put_device(dev);
1851+
put_device(dev->parent);
18351852

18361853
spin_lock(&devices_kset->list_lock);
18371854
}

‎drivers/base/dd.c‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,20 @@ static void deferred_probe_work_func(struct work_struct *work)
8585
* manipulate the deferred list
8686
*/
8787
mutex_unlock(&deferred_probe_mutex);
88+
89+
/*
90+
* Force the device to the end of the dpm_list since
91+
* the PM code assumes that the order we add things to
92+
* the list is a good order for suspend but deferred
93+
* probe makes that very unsafe.
94+
*/
95+
device_pm_lock();
96+
device_pm_move_last(dev);
97+
device_pm_unlock();
98+
8899
dev_dbg(dev, "Retrying from deferred list\n");
89100
bus_probe_device(dev);
101+
90102
mutex_lock(&deferred_probe_mutex);
91103

92104
put_device(dev);
@@ -283,6 +295,7 @@ static int really_probe(struct device *dev, struct device_driver *drv)
283295
devres_release_all(dev);
284296
driver_sysfs_remove(dev);
285297
dev->driver = NULL;
298+
dev_set_drvdata(dev, NULL);
286299

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

359-
pm_runtime_get_noresume(dev);
360372
pm_runtime_barrier(dev);
361373
ret = really_probe(dev, drv);
362-
pm_runtime_put_sync(dev);
374+
pm_runtime_idle(dev);
363375

364376
return ret;
365377
}
@@ -406,9 +418,8 @@ int device_attach(struct device *dev)
406418
ret = 0;
407419
}
408420
} else {
409-
pm_runtime_get_noresume(dev);
410421
ret = bus_for_each_drv(dev->bus, NULL, dev, __device_attach);
411-
pm_runtime_put_sync(dev);
422+
pm_runtime_idle(dev);
412423
}
413424
out_unlock:
414425
device_unlock(dev);
@@ -487,6 +498,7 @@ static void __device_release_driver(struct device *dev)
487498
drv->remove(dev);
488499
devres_release_all(dev);
489500
dev->driver = NULL;
501+
dev_set_drvdata(dev, NULL);
490502
klist_remove(&dev->p->knode_driver);
491503
if (dev->bus)
492504
blocking_notifier_call_chain(&dev->bus->p->bus_notifier,

0 commit comments

Comments
 (0)