<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/iio, branch v3.18.100</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v3.18.100</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v3.18.100'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2018-02-28T09:16:17+00:00</updated>
<entry>
<title>iio: adis_lib: Initialize trigger before requesting interrupt</title>
<updated>2018-02-28T09:16:17+00:00</updated>
<author>
<name>Lars-Peter Clausen</name>
<email>lars@metafoo.de</email>
</author>
<published>2018-02-14T14:43:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=007436bff749ec6c204ff8232abe4903537bca56'/>
<id>urn:sha1:007436bff749ec6c204ff8232abe4903537bca56</id>
<content type='text'>
commit f027e0b3a774e10302207e91d304bbf99e3a8b36 upstream.

The adis_probe_trigger() creates a new IIO trigger and requests an
interrupt associated with the trigger. The interrupt uses the generic
iio_trigger_generic_data_rdy_poll() function as its interrupt handler.

Currently the driver initializes some fields of the trigger structure after
the interrupt has been requested. But an interrupt can fire as soon as it
has been requested. This opens up a race condition.

iio_trigger_generic_data_rdy_poll() will access the trigger data structure
and dereference the ops field. If the ops field is not yet initialized this
will result in a NULL pointer deref.

It is not expected that the device generates an interrupt at this point, so
typically this issue did not surface unless e.g. due to a hardware
misconfiguration (wrong interrupt number, wrong polarity, etc.).

But some newer devices from the ADIS family start to generate periodic
interrupts in their power-on reset configuration and unfortunately the
interrupt can not be masked in the device.  This makes the race condition
much more visible and the following crash has been observed occasionally
when booting a system using the ADIS16460.

	Unable to handle kernel NULL pointer dereference at virtual address 00000008
	pgd = c0004000
	[00000008] *pgd=00000000
	Internal error: Oops: 5 [#1] PREEMPT SMP ARM
	Modules linked in:
	CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.0-04126-gf9739f0-dirty #257
	Hardware name: Xilinx Zynq Platform
	task: ef04f640 task.stack: ef050000
	PC is at iio_trigger_notify_done+0x30/0x68
	LR is at iio_trigger_generic_data_rdy_poll+0x18/0x20
	pc : [&lt;c042d868&gt;]    lr : [&lt;c042d924&gt;]    psr: 60000193
	sp : ef051bb8  ip : 00000000  fp : ef106400
	r10: c081d80a  r9 : ef3bfa00  r8 : 00000087
	r7 : ef051bec  r6 : 00000000  r5 : ef3bfa00  r4 : ee92ab00
	r3 : 00000000  r2 : 00000000  r1 : 00000000  r0 : ee97e400
	Flags: nZCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment none
	Control: 18c5387d  Table: 0000404a  DAC: 00000051
	Process swapper/0 (pid: 1, stack limit = 0xef050210)
	[&lt;c042d868&gt;] (iio_trigger_notify_done) from [&lt;c0065b10&gt;] (__handle_irq_event_percpu+0x88/0x118)
	[&lt;c0065b10&gt;] (__handle_irq_event_percpu) from [&lt;c0065bbc&gt;] (handle_irq_event_percpu+0x1c/0x58)
	[&lt;c0065bbc&gt;] (handle_irq_event_percpu) from [&lt;c0065c30&gt;] (handle_irq_event+0x38/0x5c)
	[&lt;c0065c30&gt;] (handle_irq_event) from [&lt;c0068e28&gt;] (handle_level_irq+0xa4/0x130)
	[&lt;c0068e28&gt;] (handle_level_irq) from [&lt;c0064e74&gt;] (generic_handle_irq+0x24/0x34)
	[&lt;c0064e74&gt;] (generic_handle_irq) from [&lt;c021ab7c&gt;] (zynq_gpio_irqhandler+0xb8/0x13c)
	[&lt;c021ab7c&gt;] (zynq_gpio_irqhandler) from [&lt;c0064e74&gt;] (generic_handle_irq+0x24/0x34)
	[&lt;c0064e74&gt;] (generic_handle_irq) from [&lt;c0065370&gt;] (__handle_domain_irq+0x5c/0xb4)
	[&lt;c0065370&gt;] (__handle_domain_irq) from [&lt;c000940c&gt;] (gic_handle_irq+0x48/0x8c)
	[&lt;c000940c&gt;] (gic_handle_irq) from [&lt;c0013e8c&gt;] (__irq_svc+0x6c/0xa8)

To fix this make sure that the trigger is fully initialized before
requesting the interrupt.

Fixes: ccd2b52f4ac6 ("staging:iio: Add common ADIS library")
Reported-by: Robin Getz &lt;Robin.Getz@analog.com&gt;
Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>iio: buffer: check if a buffer has been set up when poll is called</title>
<updated>2018-02-28T09:16:17+00:00</updated>
<author>
<name>Stefan Windfeldt-Prytz</name>
<email>stefan.windfeldt@axis.com</email>
</author>
<published>2018-02-15T14:02:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2433724adee7eac0f461d17afeb84f06c9b48973'/>
<id>urn:sha1:2433724adee7eac0f461d17afeb84f06c9b48973</id>
<content type='text'>
commit 4cd140bda6494543f1c1b0ccceceaa44b676eef6 upstream.

If no iio buffer has been set up and poll is called return 0.
Without this check there will be a null pointer dereference when
calling poll on a iio driver without an iio buffer.

Cc: stable@vger.kernel.org
Signed-off-by: Stefan Windfeldt-Prytz &lt;stefan.windfeldt@axis.com&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>iio: trigger: free trigger resource correctly</title>
<updated>2017-11-15T09:04:12+00:00</updated>
<author>
<name>Alison Schofield</name>
<email>amsfield22@gmail.com</email>
</author>
<published>2017-01-20T03:47:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2febf192ed4bb493ea808401e925b683a412521f'/>
<id>urn:sha1:2febf192ed4bb493ea808401e925b683a412521f</id>
<content type='text'>
[ Upstream commit 10e840dfb0b7fc345082dd9e5fff3c1c02e7690e ]

These stand-alone trigger drivers were using iio_trigger_put()
where they should have been using iio_trigger_free().  The
iio_trigger_put() adds a module_put which is bad since they
never did a module_get.

In the sysfs driver, module_get/put's are used as triggers are
added &amp; removed. This extra module_put() occurs on an error path
in the probe routine (probably rare).

In the bfin-timer &amp; interrupt trigger drivers, the module resources
are not explicitly managed, so it's doing a put on something that
was never get'd.  It occurs on the probe error path and on the
remove path (not so rare).

Tested with the sysfs trigger driver.
The bfin &amp; interrupt drivers were build tested &amp; inspected only.

Signed-off-by: Alison Schofield &lt;amsfield22@gmail.com&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: xilinx: Fix error handling</title>
<updated>2017-10-21T15:07:26+00:00</updated>
<author>
<name>Christophe JAILLET</name>
<email>christophe.jaillet@wanadoo.fr</email>
</author>
<published>2017-02-21T06:34:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=21bf570719a5e5c9c8082601175fa32be83e43d5'/>
<id>urn:sha1:21bf570719a5e5c9c8082601175fa32be83e43d5</id>
<content type='text'>
[ Upstream commit ca1c39ef76376b67303d01f94fe98bb68bb3861a ]

Reorder error handling labels in order to match the way resources have
been allocated.

Signed-off-by: Christophe JAILLET &lt;christophe.jaillet@wanadoo.fr&gt;
Acked-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;jic23@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@verizon.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: adc: mcp320x: Fix oops on module unload</title>
<updated>2017-10-12T07:18:02+00:00</updated>
<author>
<name>Lukas Wunner</name>
<email>lukas@wunner.de</email>
</author>
<published>2017-08-22T13:33:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6fd03e48dc8ad207a6f2f1c36c8b773599ec0280'/>
<id>urn:sha1:6fd03e48dc8ad207a6f2f1c36c8b773599ec0280</id>
<content type='text'>
commit 0964e40947a630a2a6f724e968246992f97bcf1c upstream.

The driver calls spi_get_drvdata() in its -&gt;remove hook even though it
has never called spi_set_drvdata().  Stack trace for posterity:

Unable to handle kernel NULL pointer dereference at virtual address 00000220
Internal error: Oops: 5 [#1] SMP ARM
[&lt;8072f564&gt;] (mutex_lock) from [&lt;7f1400d0&gt;] (iio_device_unregister+0x24/0x7c [industrialio])
[&lt;7f1400d0&gt;] (iio_device_unregister [industrialio]) from [&lt;7f15e020&gt;] (mcp320x_remove+0x20/0x30 [mcp320x])
[&lt;7f15e020&gt;] (mcp320x_remove [mcp320x]) from [&lt;8055a8cc&gt;] (spi_drv_remove+0x2c/0x44)
[&lt;8055a8cc&gt;] (spi_drv_remove) from [&lt;805087bc&gt;] (__device_release_driver+0x98/0x134)
[&lt;805087bc&gt;] (__device_release_driver) from [&lt;80509180&gt;] (driver_detach+0xdc/0xe0)
[&lt;80509180&gt;] (driver_detach) from [&lt;8050823c&gt;] (bus_remove_driver+0x5c/0xb0)
[&lt;8050823c&gt;] (bus_remove_driver) from [&lt;80509ab0&gt;] (driver_unregister+0x38/0x58)
[&lt;80509ab0&gt;] (driver_unregister) from [&lt;7f15e69c&gt;] (mcp320x_driver_exit+0x14/0x1c [mcp320x])
[&lt;7f15e69c&gt;] (mcp320x_driver_exit [mcp320x]) from [&lt;801a78d0&gt;] (SyS_delete_module+0x184/0x1d0)
[&lt;801a78d0&gt;] (SyS_delete_module) from [&lt;80108100&gt;] (ret_fast_syscall+0x0/0x1c)

Fixes: f5ce4a7a9291 ("iio: adc: add driver for MCP3204/08 12-bit ADC")
Cc: Oskar Andero &lt;oskar.andero@gmail.com&gt;
Signed-off-by: Lukas Wunner &lt;lukas@wunner.de&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>iio: ad7793: Fix the serial interface reset</title>
<updated>2017-10-12T07:18:02+00:00</updated>
<author>
<name>Dragos Bogdan</name>
<email>dragos.bogdan@analog.com</email>
</author>
<published>2017-09-05T12:16:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=85a14a6de4f7256a81c6c2b06df61216e2fcf9a9'/>
<id>urn:sha1:85a14a6de4f7256a81c6c2b06df61216e2fcf9a9</id>
<content type='text'>
commit 7ee3b7ebcb74714df6d94c8f500f307e1ee5dda5 upstream.

The serial interface can be reset by writing 32 consecutive 1s to the device.
'ret' was initialized correctly but its value was overwritten when
ad7793_check_platform_data() was called. Since a dedicated reset function
is present now, it should be used instead.

Fixes: 2edb769d246e ("iio:ad7793: Add support for the ad7798 and ad7799")
Signed-off-by: Dragos Bogdan &lt;dragos.bogdan@analog.com&gt;
Acked-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>iio: core: Return error for failed read_reg</title>
<updated>2017-10-12T07:18:02+00:00</updated>
<author>
<name>Matt Fornero</name>
<email>matt.fornero@mathworks.com</email>
</author>
<published>2017-09-05T14:34:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e1087d24eff5f5cc3f82f55bec8848e6d910cf9c'/>
<id>urn:sha1:e1087d24eff5f5cc3f82f55bec8848e6d910cf9c</id>
<content type='text'>
commit 3d62c78a6eb9a7d67bace9622b66ad51e81c5f9b upstream.

If an IIO device returns an error code for a read access via debugfs, it
is currently ignored by the IIO core (other than emitting an error
message). Instead, return this error code to user space, so upper layers
can detect it correctly.

Signed-off-by: Matt Fornero &lt;matt.fornero@mathworks.com&gt;
Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>iio: ad_sigma_delta: Implement a dedicated reset function</title>
<updated>2017-10-12T07:18:02+00:00</updated>
<author>
<name>Dragos Bogdan</name>
<email>dragos.bogdan@analog.com</email>
</author>
<published>2017-09-05T12:14:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=440edb76708ff2eefe035c9f3f9457b3b8a93dd6'/>
<id>urn:sha1:440edb76708ff2eefe035c9f3f9457b3b8a93dd6</id>
<content type='text'>
commit 7fc10de8d49a748c476532c9d8e8fe19e548dd67 upstream.

Since most of the SD ADCs have the option of reseting the serial
interface by sending a number of SCLKs with CS = 0 and DIN = 1,
a dedicated function that can do this is usefull.

Needed for the patch:  iio: ad7793: Fix the serial interface reset
Signed-off-by: Dragos Bogdan &lt;dragos.bogdan@analog.com&gt;
Acked-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>iio: imu: adis16480: Fix acceleration scale factor for adis16480</title>
<updated>2017-08-30T08:16:57+00:00</updated>
<author>
<name>Dragos Bogdan</name>
<email>dragos.bogdan@analog.com</email>
</author>
<published>2017-08-03T22:37:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0647d1234afe90786f70b803c2aa8a4ebda821f1'/>
<id>urn:sha1:0647d1234afe90786f70b803c2aa8a4ebda821f1</id>
<content type='text'>
commit fdd0d32eb95f135041236a6885d9006315aa9a1d upstream.

According to the datasheet, the range of the acceleration is [-10 g, + 10 g],
so the scale factor should be 10 instead of 5.

Signed-off-by: Dragos Bogdan &lt;dragos.bogdan@analog.com&gt;
Acked-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>iio: adc: vf610_adc: Fix VALT selection value for REFSEL bits</title>
<updated>2017-08-16T20:35:31+00:00</updated>
<author>
<name>Stefan-Gabriel Mirea</name>
<email>stefan-gabriel.mirea@nxp.com</email>
</author>
<published>2017-07-06T09:06:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d79c26b3c617985acace15e0ac57ccf1285b0cd9'/>
<id>urn:sha1:d79c26b3c617985acace15e0ac57ccf1285b0cd9</id>
<content type='text'>
commit d466d3c1217406b14b834335b5b4b33c0d45bd09 upstream.

In order to select the alternate voltage reference pair (VALTH/VALTL), the
right value for the REFSEL field in the ADCx_CFG register is "01", leading
to 0x800 as register mask. See section 8.2.6.4 in the reference manual[1].

[1] http://www.nxp.com/docs/en/reference-manual/VFXXXRM.pdf

Fixes: a775427632fd ("iio:adc:imx: add Freescale Vybrid vf610 adc driver")
Signed-off-by: Stefan-Gabriel Mirea &lt;stefan-gabriel.mirea@nxp.com&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

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