<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/w1/w1.c, branch v3.11</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>w1: add family based automatic module loading</title>
<updated>2013-06-03T21:09:14+00:00</updated>
<author>
<name>Alexander Stein</name>
<email>alexander.stein@informatik.tu-chemnitz.de</email>
</author>
<published>2013-05-26T18:06:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8d7bda51888d14c07cbebacc5a10be776477bb63'/>
<id>8d7bda51888d14c07cbebacc5a10be776477bb63</id>
<content type='text'>
This patch allows the 1-wire bus to autoload the corresponding module
for each slave being attached.
This works similar to bluetooth protocols.

Signed-off-by: Alexander Stein &lt;alexander.stein@informatik.tu-chemnitz.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch allows the 1-wire bus to autoload the corresponding module
for each slave being attached.
This works similar to bluetooth protocols.

Signed-off-by: Alexander Stein &lt;alexander.stein@informatik.tu-chemnitz.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>w1: fix oops when w1_search is called from netlink connector</title>
<updated>2013-03-12T23:20:46+00:00</updated>
<author>
<name>Marcin Jurkowski</name>
<email>marcin1j@gmail.com</email>
</author>
<published>2013-03-02T13:50:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9d1817cab2f030f6af360e961cc69bb1da8ad765'/>
<id>9d1817cab2f030f6af360e961cc69bb1da8ad765</id>
<content type='text'>
On Sat, Mar 02, 2013 at 10:45:10AM +0100, Sven Geggus wrote:
&gt; This is the bad commit I found doing git bisect:
&gt; 04f482faf50535229a5a5c8d629cf963899f857c is the first bad commit
&gt; commit 04f482faf50535229a5a5c8d629cf963899f857c
&gt; Author: Patrick McHardy &lt;kaber@trash.net&gt;
&gt; Date:   Mon Mar 28 08:39:36 2011 +0000

Good job. I was too lazy to bisect for bad commit;)

Reading the code I found problematic kthread_should_stop call from netlink
connector which causes the oops. After applying a patch, I've been testing
owfs+w1 setup for nearly two days and it seems to work very reliable (no
hangs, no memleaks etc).
More detailed description and possible fix is given below:

Function w1_search can be called from either kthread or netlink callback.
While the former works fine, the latter causes oops due to kthread_should_stop
invocation.

This patch adds a check if w1_search is serving netlink command, skipping
kthread_should_stop invocation if so.

Signed-off-by: Marcin Jurkowski &lt;marcin1j@gmail.com&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Cc: Josh Boyer &lt;jwboyer@gmail.com&gt;
Tested-by: Sven Geggus &lt;lists@fuchsschwanzdomain.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.0+
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On Sat, Mar 02, 2013 at 10:45:10AM +0100, Sven Geggus wrote:
&gt; This is the bad commit I found doing git bisect:
&gt; 04f482faf50535229a5a5c8d629cf963899f857c is the first bad commit
&gt; commit 04f482faf50535229a5a5c8d629cf963899f857c
&gt; Author: Patrick McHardy &lt;kaber@trash.net&gt;
&gt; Date:   Mon Mar 28 08:39:36 2011 +0000

Good job. I was too lazy to bisect for bad commit;)

Reading the code I found problematic kthread_should_stop call from netlink
connector which causes the oops. After applying a patch, I've been testing
owfs+w1 setup for nearly two days and it seems to work very reliable (no
hangs, no memleaks etc).
More detailed description and possible fix is given below:

Function w1_search can be called from either kthread or netlink callback.
While the former works fine, the latter causes oops due to kthread_should_stop
invocation.

This patch adds a check if w1_search is serving netlink command, skipping
kthread_should_stop invocation if so.

Signed-off-by: Marcin Jurkowski &lt;marcin1j@gmail.com&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Cc: Josh Boyer &lt;jwboyer@gmail.com&gt;
Tested-by: Sven Geggus &lt;lists@fuchsschwanzdomain.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: stable &lt;stable@vger.kernel.org&gt; # 3.0+
</pre>
</div>
</content>
</entry>
<entry>
<title>w1: remove CONFIG_HOTPLUG ifdefs</title>
<updated>2012-11-21T20:42:25+00:00</updated>
<author>
<name>Bill Pemberton</name>
<email>wfp5p@virginia.edu</email>
</author>
<published>2012-11-19T18:19:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2c9e9fdc0b2d55886609f0503fb91f96dfec6948'/>
<id>2c9e9fdc0b2d55886609f0503fb91f96dfec6948</id>
<content type='text'>
Remove conditional code based on CONFIG_HOTPLUG being false.  It's
always on now in preparation of it going away as an option.

Signed-off-by: Bill Pemberton &lt;wfp5p@virginia.edu&gt;
Cc: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove conditional code based on CONFIG_HOTPLUG being false.  It's
always on now in preparation of it going away as an option.

Signed-off-by: Bill Pemberton &lt;wfp5p@virginia.edu&gt;
Cc: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>W1: split master mutex to avoid deadlocks.</title>
<updated>2012-06-13T23:38:40+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2012-05-18T05:59:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b02f8bede217a4b145ecc16d3940c78d83941147'/>
<id>b02f8bede217a4b145ecc16d3940c78d83941147</id>
<content type='text'>
The 'mutex' in struct w1_master is use for two very different
purposes.

Firstly it protects various data structures such as the list of all
slaves.

Secondly it protects the w1 buss against concurrent accesses.

This can lead to deadlocks when the -&gt;probe code called while adding a
slave needs to talk on the bus, as is the case for power_supply
devices.
ds2780 and ds2781 drivers contain a work around to track which
process hold the lock simply to avoid this deadlock.  bq27000 doesn't
have that work around and so deadlocks.

There are other possible deadlocks involving sysfs.
When removing a device the sysfs s_active lock is held, so the lock
that protects the slave list must take precedence over s_active.
However when access power_supply attributes via sysfs, the s_active
lock must take precedence over the lock that protects accesses to
the bus.

So to avoid deadlocks between w1 slaves and sysfs, these must be
two separate locks.  Making them separate means that the work around
in ds2780 and ds2781 can be removed.

So this patch:
 - adds a new mutex: "bus_mutex" which serialises access to the bus.
 - takes in mutex in w1_search and ds1wm_search while they access
   the bus for searching.  The mutex is dropped before calling the
   callback which adds the slave.
 - changes all slaves to use bus_mutex instead of mutex to
   protect access to the bus
 - removes w1_ds2790_io_nolock and w1_ds2781_io_nolock, and the
   related code from drivers/power/ds278[01]_battery.c which
   calls them.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The 'mutex' in struct w1_master is use for two very different
purposes.

Firstly it protects various data structures such as the list of all
slaves.

Secondly it protects the w1 buss against concurrent accesses.

This can lead to deadlocks when the -&gt;probe code called while adding a
slave needs to talk on the bus, as is the case for power_supply
devices.
ds2780 and ds2781 drivers contain a work around to track which
process hold the lock simply to avoid this deadlock.  bq27000 doesn't
have that work around and so deadlocks.

There are other possible deadlocks involving sysfs.
When removing a device the sysfs s_active lock is held, so the lock
that protects the slave list must take precedence over s_active.
However when access power_supply attributes via sysfs, the s_active
lock must take precedence over the lock that protects accesses to
the bus.

So to avoid deadlocks between w1 slaves and sysfs, these must be
two separate locks.  Making them separate means that the work around
in ds2780 and ds2781 can be removed.

So this patch:
 - adds a new mutex: "bus_mutex" which serialises access to the bus.
 - takes in mutex in w1_search and ds1wm_search while they access
   the bus for searching.  The mutex is dropped before calling the
   callback which adds the slave.
 - changes all slaves to use bus_mutex instead of mutex to
   protect access to the bus
 - removes w1_ds2790_io_nolock and w1_ds2781_io_nolock, and the
   related code from drivers/power/ds278[01]_battery.c which
   calls them.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "w1: introduce a slave mutex for serializing IO"</title>
<updated>2012-06-13T23:33:54+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2012-06-13T23:33:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dd0aa67cd7cf3f4a3ca52ecc1d6b82f3fad1352b'/>
<id>dd0aa67cd7cf3f4a3ca52ecc1d6b82f3fad1352b</id>
<content type='text'>
This reverts commit 59d4467be405316916a4087d5b02d99196eeef04.

Turns out it was the wrong version, will apply the correct version after
this.

Reported-by: NeilBrown &lt;neilb@suse.de&gt;
Cc: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 59d4467be405316916a4087d5b02d99196eeef04.

Turns out it was the wrong version, will apply the correct version after
this.

Reported-by: NeilBrown &lt;neilb@suse.de&gt;
Cc: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>w1: cleanup w1_uevent</title>
<updated>2012-06-12T22:27:32+00:00</updated>
<author>
<name>Devendra Naga</name>
<email>devendra.aaru@gmail.com</email>
</author>
<published>2012-05-19T03:31:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=526be41625a8b2282d5720dcb19f927edbf193b4'/>
<id>526be41625a8b2282d5720dcb19f927edbf193b4</id>
<content type='text'>
There were some return statements around in the w1_uevent, used goto
to cleanup those return statements with the help of err variable,
and also removed a semi colon at the end of the w1_uevent's closing
brace.

Signed-off-by: Devendra Naga &lt;devendra.aaru@gmail.com&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There were some return statements around in the w1_uevent, used goto
to cleanup those return statements with the help of err variable,
and also removed a semi colon at the end of the w1_uevent's closing
brace.

Signed-off-by: Devendra Naga &lt;devendra.aaru@gmail.com&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>w1: introduce a slave mutex for serializing IO</title>
<updated>2012-06-12T22:27:32+00:00</updated>
<author>
<name>NeilBrown</name>
<email>neilb@suse.de</email>
</author>
<published>2012-05-01T18:49:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=59d4467be405316916a4087d5b02d99196eeef04'/>
<id>59d4467be405316916a4087d5b02d99196eeef04</id>
<content type='text'>
w1 devices need a mutex to serial IO.  Most use master-&gt;mutex.
However that is used for other purposes and they can conflict.

In particular master-&gt;mutex is held while w1_attach_slave_device is
called.

For bq27000, this registers a 'powersupply' device which tries to read the
current status.  The attempt to read will cause a deadlock on
master-&gt;mutex.

So create a new per-slave mutex and use that for serializing IO for
bq27000.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Cc: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
w1 devices need a mutex to serial IO.  Most use master-&gt;mutex.
However that is used for other purposes and they can conflict.

In particular master-&gt;mutex is held while w1_attach_slave_device is
called.

For bq27000, this registers a 'powersupply' device which tries to read the
current status.  The attempt to read will cause a deadlock on
master-&gt;mutex.

So create a new per-slave mutex and use that for serializing IO for
bq27000.

Signed-off-by: NeilBrown &lt;neilb@suse.de&gt;
Cc: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>w1: fix slave driver registration error message</title>
<updated>2012-04-09T22:05:47+00:00</updated>
<author>
<name>Dmitry Artamonow</name>
<email>mad_soft@inbox.ru</email>
</author>
<published>2012-04-02T05:42:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ecf1948985247cf35b5536fa62e02f56476f41f1'/>
<id>ecf1948985247cf35b5536fa62e02f56476f41f1</id>
<content type='text'>
W1 core prints "Failed to register master driver" if error happens
on registering SLAVE driver. Fix it.

Signed-off-by: Dmitry Artamonow &lt;mad_soft@inbox.ru&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
W1 core prints "Failed to register master driver" if error happens
on registering SLAVE driver. Fix it.

Signed-off-by: Dmitry Artamonow &lt;mad_soft@inbox.ru&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>w1: add fast search for single slave bus</title>
<updated>2011-12-10T03:19:18+00:00</updated>
<author>
<name>Evgeniy Polyakov</name>
<email>zbr@ioremap.net</email>
</author>
<published>2011-12-10T01:36:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c9cbf558e7793d312a4dd5d839ad7eae1aa8bd12'/>
<id>c9cbf558e7793d312a4dd5d839ad7eae1aa8bd12</id>
<content type='text'>
This enables a much more efficient way of device searching. It uses the
1-wire read-rom operation which allows the direct reading of the slave
address. BUT this works only with exactly one slave on the bus.

Signed-off-by: Hubert Feurstein &lt;h.feurstein@gmail.com&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;

index c374978..9761950 100644
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This enables a much more efficient way of device searching. It uses the
1-wire read-rom operation which allows the direct reading of the slave
address. BUT this works only with exactly one slave on the bus.

Signed-off-by: Hubert Feurstein &lt;h.feurstein@gmail.com&gt;
Acked-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;

index c374978..9761950 100644
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MAINTAINERS: Evgeniy has moved</title>
<updated>2011-08-25T23:25:33+00:00</updated>
<author>
<name>Evgeniy Polyakov</name>
<email>zbr@ioremap.net</email>
</author>
<published>2011-08-25T22:59:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a801876638c5ce650223476c4eb8f37cea32dc1c'/>
<id>a801876638c5ce650223476c4eb8f37cea32dc1c</id>
<content type='text'>
Signed-off-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Evgeniy Polyakov &lt;zbr@ioremap.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
