<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/core.c, branch v3.14-rc4</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/base/core.c?h=v3.14-rc4</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/base/core.c?h=v3.14-rc4'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2014-01-13T22:05:13Z</updated>
<entry>
<title>Revert "kernfs, sysfs, driver-core: implement kernfs_remove_self() and its wrappers"</title>
<updated>2014-01-13T22:05:13Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2014-01-13T22:05:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a9f138b0e537de55933335d580ebd38c2bc53c47'/>
<id>urn:sha1:a9f138b0e537de55933335d580ebd38c2bc53c47</id>
<content type='text'>
This reverts commit 1ae06819c77cff1ea2833c94f8c093fe8a5c79db.

Tejun writes:
        I'm sorry but can you please revert the whole series?
        get_active() waiting while a node is deactivated has potential
        to lead to deadlock and that deactivate/reactivate interface is
        something fundamentally flawed and that cgroup will have to work
        with the remove_self() like everybody else.  IOW, I think the
        first posting was correct.

Cc: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_owner()"</title>
<updated>2014-01-13T21:51:36Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2014-01-13T21:51:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a30f82b7ebc87cdec3ef48303278f02970086118'/>
<id>urn:sha1:a30f82b7ebc87cdec3ef48303278f02970086118</id>
<content type='text'>
This reverts commit d1ba277e79889085a2faec3b68b91ce89c63f888.

Tejun writes:
        I'm sorry but can you please revert the whole series?
        get_active() waiting while a node is deactivated has potential
        to lead to deadlock and that deactivate/reactivate interface is
        something fundamentally flawed and that cgroup will have to work
        with the remove_self() like everybody else.  IOW, I think the
        first posting was correct.

Cc: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_owner()</title>
<updated>2014-01-11T00:03:19Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-01-10T13:57:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d1ba277e79889085a2faec3b68b91ce89c63f888'/>
<id>urn:sha1:d1ba277e79889085a2faec3b68b91ce89c63f888</id>
<content type='text'>
All device_schedule_callback_owner() users are converted to use
device_remove_file_self().  Remove now unused
{sysfs|device}_schedule_callback_owner().

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kernfs, sysfs, driver-core: implement kernfs_remove_self() and its wrappers</title>
<updated>2014-01-10T22:01:05Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-01-10T13:57:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1ae06819c77cff1ea2833c94f8c093fe8a5c79db'/>
<id>urn:sha1:1ae06819c77cff1ea2833c94f8c093fe8a5c79db</id>
<content type='text'>
Sometimes it's necessary to implement a node which wants to delete
nodes including itself.  This isn't straightforward because of kernfs
active reference.  While a file operation is in progress, an active
reference is held and kernfs_remove() waits for all such references to
drain before completing.  For a self-deleting node, this is a deadlock
as kernfs_remove() ends up waiting for an active reference that itself
is sitting on top of.

This currently is worked around in the sysfs layer using
sysfs_schedule_callback() which makes such removals asynchronous.
While it works, it's rather cumbersome and inherently breaks
synchronicity of the operation - the file operation which triggered
the operation may complete before the removal is finished (or even
started) and the removal may fail asynchronously.  If a removal
operation is immmediately followed by another operation which expects
the specific name to be available (e.g. removal followed by rename
onto the same name), there's no way to make the latter operation
reliable.

The thing is there's no inherent reason for this to be asynchrnous.
All that's necessary to do this synchronous is a dedicated operation
which drops its own active ref and deactivates self.  This patch
implements kernfs_remove_self() and its wrappers in sysfs and driver
core.  kernfs_remove_self() is to be called from one of the file
operations, drops the active ref and deactivates using
__kernfs_deactivate_self(), removes the self node, and restores active
ref to the dead node using __kernfs_reactivate_self() so that the ref
is balanced afterwards.  __kernfs_remove() is updated so that it takes
an early exit if the target node is already fully removed so that the
active ref restored by kernfs_remove_self() after removal doesn't
confuse the deactivation path.

This makes implementing self-deleting nodes very easy.  The normal
removal path doesn't even need to be changed to use
kernfs_remove_self() for the self-deleting node.  The method can
invoke kernfs_remove_self() on itself before proceeding the normal
removal path.  kernfs_remove() invoked on the node by the normal
deletion path will simply be ignored.

This will replace sysfs_schedule_callback().  A subtle feature of
sysfs_schedule_callback() is that it collapses multiple invocations -
even if multiple removals are triggered, the removal callback is run
only once.  An equivalent effect can be achieved by testing the return
value of kernfs_remove_self() - only the one which gets %true return
value should proceed with actual deletion.  All other instances of
kernfs_remove_self() will wait till the enclosing kernfs operation
which invoked the winning instance of kernfs_remove_self() finishes
and then return %false.  This trivially makes all users of
kernfs_remove_self() automatically show correct synchronous behavior
even when there are multiple concurrent operations - all "echo 1 &gt;
delete" instances will finish only after the whole operation is
completed by one of the instances.

v2: For !CONFIG_SYSFS, dummy version kernfs_remove_self() was missing
    and sysfs_remove_file_self() had incorrect return type.  Fix it.
    Reported by kbuild test bot.

v3: Updated to use __kernfs_{de|re}activate_self().

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Cc: kbuild test robot &lt;fengguang.wu@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Driver core: Fix device_add_attrs() error code path</title>
<updated>2013-12-18T23:50:16Z</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rafael.j.wysocki@intel.com</email>
</author>
<published>2013-12-12T05:11:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ecfbf6fd9c03be7dfe3eafc3846641b9d463607b'/>
<id>urn:sha1:ecfbf6fd9c03be7dfe3eafc3846641b9d463607b</id>
<content type='text'>
If the addition of dev_attr_online fails, device_add_attrs() should
remove device attribute groups as well as type and class attribute
groups before returning an error code.  Make that happen.

Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Toshi Kani &lt;toshi.kani@hp.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: fix device_create() error path</title>
<updated>2013-12-09T02:25:10Z</updated>
<author>
<name>David Herrmann</name>
<email>dh.herrmann@gmail.com</email>
</author>
<published>2013-11-21T19:15:48Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bbc780f8bab52fef1784151d3c4982cb1143edd2'/>
<id>urn:sha1:bbc780f8bab52fef1784151d3c4982cb1143edd2</id>
<content type='text'>
We call put_device() in the error path, which is fine for dev==NULL.
However, in case kobject_set_name_vargs() fails, we have dev!=NULL but
device_initialized() wasn't called, yet.

Fix this by splitting device_register() into explicit calls to
device_add() and an early call to device_initialize().

Signed-off-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers/base/core.c: output device renaming messages with dev_dbg().</title>
<updated>2013-10-17T01:33:27Z</updated>
<author>
<name>ethan.zhao</name>
<email>ethan.kernel@gmail.com</email>
</author>
<published>2013-10-13T14:12:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=69df75334bf6d68a0a74397c2cc32172f0d7d620'/>
<id>urn:sha1:69df75334bf6d68a0a74397c2cc32172f0d7d620</id>
<content type='text'>
Replace pr_debug() with dev_dbg().

Signed-off-by: ethan.zhao &lt;ethan.kernel@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: remove dev_bin_attrs from struct class</title>
<updated>2013-10-06T07:01:47Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-10-06T01:19:30Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a6b01deda1e79259d2fe98fe68d41e4b7bad2783'/>
<id>urn:sha1:a6b01deda1e79259d2fe98fe68d41e4b7bad2783</id>
<content type='text'>
No in-kernel code is now using this, they have all be converted over to
using the bin_attrs support in attribute groups, so this field, and the
code in the driver core that was creating/remove the binary files can be
removed.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: remove dev_attrs from struct class</title>
<updated>2013-10-06T06:59:34Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-10-06T01:25:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bcc8edb52f05c1a9e75118d6b3bc04996a750593'/>
<id>urn:sha1:bcc8edb52f05c1a9e75118d6b3bc04996a750593</id>
<content type='text'>
Now that all in-kernel users of the dev_attrs field are converted to use
dev_groups, we can safely remove dev_attrs from struct class.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 3.12-rc3 into driver-core-next</title>
<updated>2013-09-30T01:29:23Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-09-30T01:29:23Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=88502b9c0a5dcc884c0dbfb6ddf964ff5da5d8d3'/>
<id>urn:sha1:88502b9c0a5dcc884c0dbfb6ddf964ff5da5d8d3</id>
<content type='text'>
We want the driver core and sysfs fixes in here to make merges and
development easier.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
