<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/core.c, branch v2.6.34</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.34</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.34'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2010-03-19T14:12:21Z</updated>
<entry>
<title>driver-core: document ERR_PTR() return values</title>
<updated>2010-03-19T14:12:21Z</updated>
<author>
<name>Jani Nikula</name>
<email>ext-jani.1.nikula@nokia.com</email>
</author>
<published>2010-03-11T16:11:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f0eae0ed3b7d4182a6b4dd03540a738518ea3163'/>
<id>urn:sha1:f0eae0ed3b7d4182a6b4dd03540a738518ea3163</id>
<content type='text'>
A number of functions in the driver core return ERR_PTR() values on
error. Document this in the kernel-doc of the functions.

Signed-off-by: Jani Nikula &lt;ext-jani.1.nikula@nokia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>driver core: Use sysfs_rename_link in device_rename</title>
<updated>2010-03-08T01:04:52Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2010-02-13T03:22:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2354dcc7218853a6537ec722be40fde9a11c413b'/>
<id>urn:sha1:2354dcc7218853a6537ec722be40fde9a11c413b</id>
<content type='text'>
Don't open code the renaming of symlinks in sysfs
instead use the new helper function sysfs_rename_link

Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Serge Hallyn &lt;serue@us.ibm.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@aristanetworks.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Driver core: Constify struct sysfs_ops in struct kobj_type</title>
<updated>2010-03-08T01:04:49Z</updated>
<author>
<name>Emese Revfy</name>
<email>re.emese@gmail.com</email>
</author>
<published>2010-01-19T01:58:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=52cf25d0ab7f78eeecc59ac652ed5090f69b619e'/>
<id>urn:sha1:52cf25d0ab7f78eeecc59ac652ed5090f69b619e</id>
<content type='text'>
Constify struct sysfs_ops.

This is part of the ops structure constification
effort started by Arjan van de Ven et al.

Benefits of this constification:

 * prevents modification of data that is shared
   (referenced) by many other structure instances
   at runtime

 * detects/prevents accidental (but not intentional)
   modification attempts on archs that enforce
   read-only kernel data at runtime

 * potentially better optimized code as the compiler
   can assume that the const data cannot be changed

 * the compiler/linker move const data into .rodata
   and therefore exclude them from false sharing

Signed-off-by: Emese Revfy &lt;re.emese@gmail.com&gt;
Acked-by: David Teigland &lt;teigland@redhat.com&gt;
Acked-by: Matt Domsch &lt;Matt_Domsch@dell.com&gt;
Acked-by: Maciej Sosnowski &lt;maciej.sosnowski@intel.com&gt;
Acked-by: Hans J. Koch &lt;hjk@linutronix.de&gt;
Acked-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Acked-by: Jens Axboe &lt;jens.axboe@oracle.com&gt;
Acked-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>kobject: Constify struct kset_uevent_ops</title>
<updated>2010-03-08T01:04:49Z</updated>
<author>
<name>Emese Revfy</name>
<email>re.emese@gmail.com</email>
</author>
<published>2009-12-31T13:52:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9cd43611ccfb46632bfa7d19f688924ea93f1613'/>
<id>urn:sha1:9cd43611ccfb46632bfa7d19f688924ea93f1613</id>
<content type='text'>
Constify struct kset_uevent_ops.

This is part of the ops structure constification
effort started by Arjan van de Ven et al.

Benefits of this constification:

 * prevents modification of data that is shared
   (referenced) by many other structure instances
   at runtime

 * detects/prevents accidental (but not intentional)
   modification attempts on archs that enforce
   read-only kernel data at runtime

 * potentially better optimized code as the compiler
   can assume that the const data cannot be changed

 * the compiler/linker move const data into .rodata
   and therefore exclude them from false sharing

Signed-off-by: Emese Revfy &lt;re.emese@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Driver-Core: require valid action string in uevent trigger</title>
<updated>2010-03-08T01:04:48Z</updated>
<author>
<name>Kay Sievers</name>
<email>kay.sievers@vrfy.org</email>
</author>
<published>2010-01-14T21:54:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3f5468c9ae293cbca43e4ffe6ca3b3235189042a'/>
<id>urn:sha1:3f5468c9ae293cbca43e4ffe6ca3b3235189042a</id>
<content type='text'>
No longer fall back to "add" and warn, but always require a valid
action-string written to the "uevent" file.

Signed-off-by: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>driver-core: fix race condition in get_device_parent()</title>
<updated>2010-03-08T01:04:46Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-02-05T08:57:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=77d3d7c1d561f49f755d7390f0764dff90765974'/>
<id>urn:sha1:77d3d7c1d561f49f755d7390f0764dff90765974</id>
<content type='text'>
sysfs is creating several devices in cuse class concurrently and with
CONFIG_SYSFS_DEPRECATED turned off, it triggers the following oops.

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000038
 IP: [&lt;ffffffff81158b0a&gt;] sysfs_addrm_start+0x4a/0xf0
 PGD 75bb067 PUD 75be067 PMD 0
 Oops: 0000 [#1] PREEMPT SMP
 last sysfs file: /sys/devices/system/cpu/cpu7/topology/core_siblings
 CPU 1
 Modules linked in: cuse fuse
 Pid: 4737, comm: osspd Not tainted 2.6.31-work #77
 RIP: 0010:[&lt;ffffffff81158b0a&gt;]  [&lt;ffffffff81158b0a&gt;] sysfs_addrm_start+0x4a/0xf0
 RSP: 0018:ffff88000042f8f8  EFLAGS: 00010296
 RAX: ffff88000042ffd8 RBX: 0000000000000000 RCX: 0000000000000000
 RDX: 0000000000000000 RSI: ffff880007eef660 RDI: 0000000000000001
 RBP: ffff88000042f918 R08: 0000000000000000 R09: 0000000000000000
 R10: 0000000000000001 R11: ffffffff81158b0a R12: ffff88000042f928
 R13: 00000000fffffff4 R14: 0000000000000000 R15: ffff88000042f9a0
 FS:  00007fe93905a950(0000) GS:ffff880008600000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 0000000000000038 CR3: 00000000077c9000 CR4: 00000000000006e0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process osspd (pid: 4737, threadinfo ffff88000042e000, task ffff880007eef040)
 Stack:
  ffff880005da10e8 0000000011cc8d6e ffff88000042f928 ffff880003d28a28
 &lt;0&gt; ffff88000042f988 ffffffff811592d7 0000000000000000 0000000000000000
 &lt;0&gt; 0000000000000000 0000000000000000 ffff88000042f958 0000000011cc8d6e
 Call Trace:
  [&lt;ffffffff811592d7&gt;] create_dir+0x67/0xe0
  [&lt;ffffffff811593a8&gt;] sysfs_create_dir+0x58/0xb0
  [&lt;ffffffff8128ca7c&gt;] ? kobject_add_internal+0xcc/0x220
  [&lt;ffffffff812942e1&gt;] ? vsnprintf+0x3c1/0xb90
  [&lt;ffffffff8128cab7&gt;] kobject_add_internal+0x107/0x220
  [&lt;ffffffff8128cd37&gt;] kobject_add_varg+0x47/0x80
  [&lt;ffffffff8128ce53&gt;] kobject_add+0x53/0x90
  [&lt;ffffffff81357d84&gt;] device_add+0xd4/0x690
  [&lt;ffffffff81356c2b&gt;] ? dev_set_name+0x4b/0x70
  [&lt;ffffffffa001a884&gt;] cuse_process_init_reply+0x2b4/0x420 [cuse]
  ...

The problem is that kobject_add_internal() first adds a kobject to the
kset and then try to create sysfs directory for it.  If the creation
fails, it remove the kobject from the kset.  get_device_parent()
accesses class_dirs kset while only holding class_dirs.list_lock to
see whether the cuse class dir exists.  But when it exists, it may not
have finished initialization yet or may fail and get removed soon.  In
the above case, the former happened so the second one ends up trying
to create subdirectory under NULL sysfs_dirent.

Fix it by grabbing a mutex in get_device_parent().

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Colin Guthrie &lt;cguthrie@mandriva.org&gt;
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


</content>
</entry>
<entry>
<title>Driver-core: Fix bogus 0 error return in device_add()</title>
<updated>2009-12-23T19:23:44Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2009-12-10T19:32:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e6309e7568d4b9d62298a887b10de42df11cb8c1'/>
<id>urn:sha1:e6309e7568d4b9d62298a887b10de42df11cb8c1</id>
<content type='text'>
If device_add() is called with a device which does not have dev-&gt;p set
up, then device_private_init() is called. If that succeeds, then the
error variable is set to 0. Now if the dev_name(dev) check further
down fails, then device_add() correctly terminates, but returns 0.
That of course lets the driver progress. If later another driver uses
this half set up device as parent then device_add() of the child
device explodes and renders sysfs completely unusable.

Set the error to -EINVAL if dev_name() check fails.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: "Hans J. Koch" &lt;hjk@linutronix.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Driver core: bin_attribute parameters can often be const*</title>
<updated>2009-12-23T19:23:43Z</updated>
<author>
<name>Phil Carmody</name>
<email>ext-phil.2.carmody@nokia.com</email>
</author>
<published>2009-12-18T13:34:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=66ecb92be9eb579df93add22d19843e7869f168e'/>
<id>urn:sha1:66ecb92be9eb579df93add22d19843e7869f168e</id>
<content type='text'>
Many struct bin_attribute descriptors are purely read-only
structures, and there's no need to change them. Therefore
make the promise not to, which will let those descriptors
be put in a ro section.

Signed-off-by: Phil Carmody &lt;ext-phil.2.carmody@nokia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Driver core: device_attribute parameters can often be const*</title>
<updated>2009-12-23T19:23:43Z</updated>
<author>
<name>Phil Carmody</name>
<email>ext-phil.2.carmody@nokia.com</email>
</author>
<published>2009-12-18T13:34:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=26579ab70aa0e0ea434e6e100279d2f67c094431'/>
<id>urn:sha1:26579ab70aa0e0ea434e6e100279d2f67c094431</id>
<content type='text'>
Most device_attributes are const, and are begging to be
put in a ro section. However, the create and remove
file interfaces were failing to propagate the const promise
which the only functions they call offer.

Signed-off-by: Phil Carmody &lt;ext-phil.2.carmody@nokia.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>Driver core: fix race in dev_driver_string</title>
<updated>2009-12-11T19:24:55Z</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2009-12-04T16:06:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3589972e51fac1e02d0aaa576fa47f568cb94d40'/>
<id>urn:sha1:3589972e51fac1e02d0aaa576fa47f568cb94d40</id>
<content type='text'>
This patch (as1310) works around a race in dev_driver_string().  If
the device is unbound while the function is running, dev-&gt;driver might
become NULL after we test it and before we dereference it.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: stable &lt;stable@kernel.org&gt;
Cc: Oliver Neukum &lt;oliver@neukum.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;


</content>
</entry>
</feed>
