<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/iio, branch v3.12-rc2</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>iio:buffer_cb: Add missing iio_buffer_init()</title>
<updated>2013-09-21T11:52:50+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2013-09-18T20:02:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bda2f8fca20b564ac8edb2b9c080d942c2144359'/>
<id>bda2f8fca20b564ac8edb2b9c080d942c2144359</id>
<content type='text'>
Make sure to properly initialize the IIO buffer data structure.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make sure to properly initialize the IIO buffer data structure.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: Prevent race between IIO chardev opening and IIO device free</title>
<updated>2013-09-21T11:50:23+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2013-09-18T20:02:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=0d5b7dae897b61a2372916b1c93f6cee6b8049b1'/>
<id>0d5b7dae897b61a2372916b1c93f6cee6b8049b1</id>
<content type='text'>
Set the IIO device as the parent for the character device

We need to make sure that the IIO device is not freed while the character device
exists, otherwise the freeing of the IIO device might race against the file open
callback. Do this by setting the character device's parent to the IIO device,
this will cause the character device to grab a reference to the IIO device and
only release it once the character device itself has been removed.

Also move the registration of the character device before the registration of
the IIO device to avoid the (rather theoretical case) that the IIO device is
already freed again before we can add the character device and grab a reference
to the IIO device.

We also need to move the call to cdev_del() from iio_dev_release() to
iio_device_unregister() (where it should have been in the first place anyway) to
avoid a reference cycle. As iio_dev_release() is only called once all reference
are dropped, but the character device holds a reference to the IIO device.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Set the IIO device as the parent for the character device

We need to make sure that the IIO device is not freed while the character device
exists, otherwise the freeing of the IIO device might race against the file open
callback. Do this by setting the character device's parent to the IIO device,
this will cause the character device to grab a reference to the IIO device and
only release it once the character device itself has been removed.

Also move the registration of the character device before the registration of
the IIO device to avoid the (rather theoretical case) that the IIO device is
already freed again before we can add the character device and grab a reference
to the IIO device.

We also need to move the call to cdev_del() from iio_dev_release() to
iio_device_unregister() (where it should have been in the first place anyway) to
avoid a reference cycle. As iio_dev_release() is only called once all reference
are dropped, but the character device holds a reference to the IIO device.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: fix: Keep a reference to the IIO device for open file descriptors</title>
<updated>2013-09-21T11:45:07+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2013-09-18T20:02:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=cadc2125e140f7122bf1b59d42486cfc778c7286'/>
<id>cadc2125e140f7122bf1b59d42486cfc778c7286</id>
<content type='text'>
Make sure that the IIO device is not freed while we still have file descriptors
for it.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make sure that the IIO device is not freed while we still have file descriptors
for it.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: Stop sampling when the device is removed</title>
<updated>2013-09-21T11:36:30+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2013-09-18T20:02:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a87c82e454f184a9473f8cdfd4d304205f585f65'/>
<id>a87c82e454f184a9473f8cdfd4d304205f585f65</id>
<content type='text'>
Make sure to stop sampling when the device is removed, otherwise it will
continue to sample forever.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Make sure to stop sampling when the device is removed, otherwise it will
continue to sample forever.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: Fix crash when scan_bytes is computed with active_scan_mask == NULL</title>
<updated>2013-09-21T11:30:58+00:00</updated>
<author>
<name>Peter Meerwald</name>
<email>pmeerw@pmeerw.net</email>
</author>
<published>2013-09-18T21:10:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d66e0452bf6b0d98cd1a478918c92f2baffcb413'/>
<id>d66e0452bf6b0d98cd1a478918c92f2baffcb413</id>
<content type='text'>
if device has available_scan_masks set and the buffer is enabled without
any scan_elements enabled, in a NULL pointer is dereferenced in iio_compute_scan_bytes()

[   18.993713] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[   19.002593] pgd = debd4000
[   19.005432] [00000000] *pgd=9ebc0831, *pte=00000000, *ppte=00000000
[   19.012329] Internal error: Oops: 17 [#1] PREEMPT ARM
[   19.017639] Modules linked in:
[   19.020843] CPU: 0    Not tainted  (3.9.11-00036-g75c888a-dirty #207)
[   19.027587] PC is at _find_first_bit_le+0xc/0x2c
[   19.032440] LR is at iio_compute_scan_bytes+0x2c/0xf4
[   19.037719] pc : [&lt;c021dc60&gt;]    lr : [&lt;c03198d0&gt;]    psr: 200d0013
[   19.037719] sp : debd9ed0  ip : 00000000  fp : 000802bc
[   19.049713] r10: 00000000  r9 : 00000000  r8 : deb67250
[   19.055206] r7 : 00000000  r6 : 00000000  r5 : 00000000  r4 : deb67000
[   19.062011] r3 : de96ec00  r2 : 00000000  r1 : 00000004  r0 : 00000000
[   19.068847] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   19.076324] Control: 10c5387d  Table: 9ebd4019  DAC: 00000015

problem is the rollback code in iio_update_buffers(), old_mask may be NULL (e.g. on first
call)

I'm not too confident about the fix; works for me...

Signed-off-by: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
if device has available_scan_masks set and the buffer is enabled without
any scan_elements enabled, in a NULL pointer is dereferenced in iio_compute_scan_bytes()

[   18.993713] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[   19.002593] pgd = debd4000
[   19.005432] [00000000] *pgd=9ebc0831, *pte=00000000, *ppte=00000000
[   19.012329] Internal error: Oops: 17 [#1] PREEMPT ARM
[   19.017639] Modules linked in:
[   19.020843] CPU: 0    Not tainted  (3.9.11-00036-g75c888a-dirty #207)
[   19.027587] PC is at _find_first_bit_le+0xc/0x2c
[   19.032440] LR is at iio_compute_scan_bytes+0x2c/0xf4
[   19.037719] pc : [&lt;c021dc60&gt;]    lr : [&lt;c03198d0&gt;]    psr: 200d0013
[   19.037719] sp : debd9ed0  ip : 00000000  fp : 000802bc
[   19.049713] r10: 00000000  r9 : 00000000  r8 : deb67250
[   19.055206] r7 : 00000000  r6 : 00000000  r5 : 00000000  r4 : deb67000
[   19.062011] r3 : de96ec00  r2 : 00000000  r1 : 00000004  r0 : 00000000
[   19.068847] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[   19.076324] Control: 10c5387d  Table: 9ebd4019  DAC: 00000015

problem is the rollback code in iio_update_buffers(), old_mask may be NULL (e.g. on first
call)

I'm not too confident about the fix; works for me...

Signed-off-by: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Reviewed-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: Fix mcp4725 dev-to-indio_dev conversion in suspend/resume</title>
<updated>2013-09-21T11:04:48+00:00</updated>
<author>
<name>Peter Meerwald</name>
<email>pmeerw@pmeerw.net</email>
</author>
<published>2013-09-18T21:47:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=a97dd06948e6ba1ff4fa2e046dd573b4f42a45c1'/>
<id>a97dd06948e6ba1ff4fa2e046dd573b4f42a45c1</id>
<content type='text'>
dev_to_iio_dev() is a false friend

Signed-off-by: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dev_to_iio_dev() is a false friend

Signed-off-by: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: Fix bma180 dev-to-indio_dev conversion in suspend/resume</title>
<updated>2013-09-21T11:04:34+00:00</updated>
<author>
<name>Peter Meerwald</name>
<email>pmeerw@pmeerw.net</email>
</author>
<published>2013-09-18T21:47:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=234efa1703ade3dc57a520829176378b26e831e0'/>
<id>234efa1703ade3dc57a520829176378b26e831e0</id>
<content type='text'>
dev_to_iio_dev() is a false friend

Signed-off-by: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Cc: Oleksandr Kravchenko &lt;o.v.kravchenko@globallogic.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dev_to_iio_dev() is a false friend

Signed-off-by: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Cc: Oleksandr Kravchenko &lt;o.v.kravchenko@globallogic.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: Fix tmp006 dev-to-indio_dev conversion in suspend/resume</title>
<updated>2013-09-21T11:03:02+00:00</updated>
<author>
<name>Peter Meerwald</name>
<email>pmeerw@pmeerw.net</email>
</author>
<published>2013-09-18T21:47:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=d320f1b4811564052d5e3496a807a68c5ade791d'/>
<id>d320f1b4811564052d5e3496a807a68c5ade791d</id>
<content type='text'>
dev_to_iio_dev() is a false friend

Signed-off-by: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dev_to_iio_dev() is a false friend

Signed-off-by: Peter Meerwald &lt;pmeerw@pmeerw.net&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: iio_device_add_event_sysfs() bugfix</title>
<updated>2013-09-18T18:50:10+00:00</updated>
<author>
<name>Lukasz Czerwinski</name>
<email>l.czerwinski@samsung.com</email>
</author>
<published>2013-09-18T09:21:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=2b0774df40d7ceed9bda3423d436d9fea30fb281'/>
<id>2b0774df40d7ceed9bda3423d436d9fea30fb281</id>
<content type='text'>
Fix mask generation for modified channels.

Signed-off-by: Lukasz Czerwinski &lt;l.czerwinski@samsung.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix mask generation for modified channels.

Signed-off-by: Lukasz Czerwinski &lt;l.czerwinski@samsung.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>iio: at91: fix adc_clk overflow</title>
<updated>2013-09-18T18:43:20+00:00</updated>
<author>
<name>Josh Wu</name>
<email>josh.wu@atmel.com</email>
</author>
<published>2013-08-27T11:28:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=db10e201172f48dad29d81ee1fec96384f0eab35'/>
<id>db10e201172f48dad29d81ee1fec96384f0eab35</id>
<content type='text'>
The adc_clk variable is currently defined using a 32-bits unsigned integer,
which will overflow under some very valid range of operations.

Such overflow will occur if, for example, the parent clock is set to a
20MHz frequency and the ADC startup time is larger than 215ns.

To fix this, introduce an intermediate variable holding the clock rate
in kHz.

Signed-off-by: Josh Wu &lt;josh.wu@atmel.com&gt;
Acked-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The adc_clk variable is currently defined using a 32-bits unsigned integer,
which will overflow under some very valid range of operations.

Such overflow will occur if, for example, the parent clock is set to a
20MHz frequency and the ADC startup time is larger than 215ns.

To fix this, introduce an intermediate variable holding the clock rate
in kHz.

Signed-off-by: Josh Wu &lt;josh.wu@atmel.com&gt;
Acked-by: Maxime Ripard &lt;maxime.ripard@free-electrons.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
