<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/iio/magnetometer, branch linux-5.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2020-09-13T16:15:20Z</updated>
<entry>
<title>Merge tag 'staging-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging</title>
<updated>2020-09-13T16:15:20Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2020-09-13T16:15:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6c7247f6258b2dba353c885a1b00d795a380cc85'/>
<id>urn:sha1:6c7247f6258b2dba353c885a1b00d795a380cc85</id>
<content type='text'>
Pull staging/IIO driver fixes from Greg KH:
 "Here are a number of staging and IIO driver fixes for 5.9-rc5.

  The majority of these are IIO driver fixes, to resolve a timestamp
  issue that was recently found to affect a bunch of IIO drivers.

  The other fixes in here are:

   - small IIO driver fixes

   - greybus driver fix

   - counter driver fix (came in through the IIO fixes tree)

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'staging-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (23 commits)
  iio: adc: mcp3422: fix locking on error path
  iio: adc: mcp3422: fix locking scope
  iio: adc: meson-saradc: Use the parent device to look up the calib data
  iio:adc:max1118 Fix alignment of timestamp and data leak issues
  iio:adc:ina2xx Fix timestamp alignment issue.
  iio:adc:ti-adc084s021 Fix alignment and data leak issues.
  iio:adc:ti-adc081c Fix alignment and data leak issues
  iio:magnetometer:ak8975 Fix alignment and data leak issues.
  iio:light:ltr501 Fix timestamp alignment issue.
  iio:light:max44000 Fix timestamp alignment and prevent data leak.
  iio:chemical:ccs811: Fix timestamp alignment and prevent data leak.
  iio:proximity:mb1232: Fix timestamp alignment and prevent data leak.
  iio:accel:mma7455: Fix timestamp alignment and prevent data leak.
  iio:accel:bmc150-accel: Fix timestamp alignment and prevent data leak.
  iio:accel:mma8452: Fix timestamp alignment and prevent data leak.
  iio: accel: kxsd9: Fix alignment of local buffer.
  iio: adc: rockchip_saradc: select IIO_TRIGGERED_BUFFER
  iio: adc: ti-ads1015: fix conversion when CONFIG_PM is not set
  counter: microchip-tcb-capture: check the correct variable
  iio: cros_ec: Set Gyroscope default frequency to 25Hz
  ...
</content>
</entry>
<entry>
<title>treewide: Use fallthrough pseudo-keyword</title>
<updated>2020-08-23T22:36:59Z</updated>
<author>
<name>Gustavo A. R. Silva</name>
</author>
<published>2020-08-23T22:36:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=df561f6688fef775baa341a0f5d960becd248b11'/>
<id>urn:sha1:df561f6688fef775baa341a0f5d960becd248b11</id>
<content type='text'>
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.

[1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

Signed-off-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
</content>
</entry>
<entry>
<title>iio:magnetometer:ak8975 Fix alignment and data leak issues.</title>
<updated>2020-08-22T10:39:00Z</updated>
<author>
<name>Jonathan Cameron</name>
</author>
<published>2020-07-22T15:50:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=02ad21cefbac4d89ac443866f25b90449527737b'/>
<id>urn:sha1:02ad21cefbac4d89ac443866f25b90449527737b</id>
<content type='text'>
One of a class of bugs pointed out by Lars in a recent review.
iio_push_to_buffers_with_timestamp assumes the buffer used is aligned
to the size of the timestamp (8 bytes).  This is not guaranteed in
this driver which uses an array of smaller elements on the stack.
As Lars also noted this anti pattern can involve a leak of data to
userspace and that indeed can happen here.  We close both issues by
moving to a suitable structure in the iio_priv() data.

This data is allocated with kzalloc so no data can leak apart from
previous readings.

The explicit alignment of ts is not necessary in this case as by
coincidence the padding will end up the same, however I consider
it to make the code less fragile and have included it.

Fixes: bc11ca4a0b84 ("iio:magnetometer:ak8975: triggered buffer support")
Reported-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Cc: Gregor Boirie &lt;gregor.boirie@parrot.com&gt;
Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
</content>
</entry>
<entry>
<title>iio: magnetometer: ak8974: Add description for ak8974's 'scan' attribute</title>
<updated>2020-07-20T08:03:32Z</updated>
<author>
<name>Lee Jones</name>
</author>
<published>2020-07-17T16:55:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5497523e657ce448198a34767b71fa168da0393d'/>
<id>urn:sha1:5497523e657ce448198a34767b71fa168da0393d</id>
<content type='text'>
Fixes the following W=1 kernel build warning(s):

 drivers/iio/magnetometer/ak8974.c:200: warning: Function parameter or member 'scan' not described in 'ak8974'

Cc: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: Samu Onkalo &lt;samu.p.onkalo@nokia.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: magnetometer: hmc5843: 'hmc5843_pm_ops' is unused in 1 of 3 files including hmc5843_core.h</title>
<updated>2020-07-20T08:03:14Z</updated>
<author>
<name>Lee Jones</name>
</author>
<published>2020-07-17T16:55:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5e2b006d800d7e5cc4a55047eebb6e5157e7c57f'/>
<id>urn:sha1:5e2b006d800d7e5cc4a55047eebb6e5157e7c57f</id>
<content type='text'>
We know that it's okay for 'hmc5843_pm_ops' to be unused here.

Fixes the following W=1 kernel build warning(s):

 In file included from include/linux/device.h:25,
 from include/linux/iio/iio.h:10,
 from drivers/iio/magnetometer/hmc5843_core.c:16:
 drivers/iio/magnetometer/hmc5843.h:55:26: warning: ‘hmc5843_pm_ops’ defined but not used [-Wunused-const-variable=]
 55 | static SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
 | ^~~~~~~~~~~~~~
 include/linux/pm.h:354:25: note: in definition of macro ‘SIMPLE_DEV_PM_OPS’
 354 | const struct dev_pm_ops name = { | ^~~~

Cc: Josef Gajdusek &lt;atx@atx.name&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio: magnetometer: mmc35240: Fix function header formatting</title>
<updated>2020-07-20T08:03:08Z</updated>
<author>
<name>Lee Jones</name>
</author>
<published>2020-07-16T13:59:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=faa4540ef4438ece0315ef0d30e9d4ddc8d36dd0'/>
<id>urn:sha1:faa4540ef4438ece0315ef0d30e9d4ddc8d36dd0</id>
<content type='text'>
All lines in the header must start with " *".

Fixes the following W=1 kernel build warning(s):

 drivers/iio/magnetometer/mmc35240.c:304: warning: bad line:                             compensation for output value.

Cc: Daniel Baluta &lt;daniel.baluta@intel.com&gt;
Signed-off-by: Lee Jones &lt;lee.jones@linaro.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>Merge 5.8-rc6 into staging-next</title>
<updated>2020-07-20T07:37:31Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
</author>
<published>2020-07-20T07:37:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=263771dbc85bc6573b344c193351980c27fd2faa'/>
<id>urn:sha1:263771dbc85bc6573b344c193351980c27fd2faa</id>
<content type='text'>
We need the staging fixes in here, and it resolves a merge issue with an
iio driver.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>iio: magnetometer: bmc150: Add proper compatible for BMM150</title>
<updated>2020-07-07T19:24:07Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2020-06-29T10:05:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0954bc9787e749e754cde0ca53f700c24a117dda'/>
<id>urn:sha1:0954bc9787e749e754cde0ca53f700c24a117dda</id>
<content type='text'>
The compatible for BMM150 should not have "_magn" suffix because, unlike
two other Bosch devices, it is only a magnetometer.

Signed-off-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
<entry>
<title>iio:magnetometer:ak8974: Fix alignment and data leak issues</title>
<updated>2020-07-05T13:22:48Z</updated>
<author>
<name>Jonathan Cameron</name>
</author>
<published>2020-06-07T15:53:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=838e00b13bfd4cac8b24df25bfc58e2eb99bcc70'/>
<id>urn:sha1:838e00b13bfd4cac8b24df25bfc58e2eb99bcc70</id>
<content type='text'>
One of a class of bugs pointed out by Lars in a recent review.
iio_push_to_buffers_with_timestamp assumes the buffer used is aligned
to the size of the timestamp (8 bytes).  This is not guaranteed in
this driver which uses an array of smaller elements on the stack.
As Lars also noted this anti pattern can involve a leak of data to
userspace and that indeed can happen here.  We close both issues by
moving to a suitable structure in the iio_priv() data.

This data is allocated with kzalloc so no data can leak appart from
previous readings.

Fixes: 7c94a8b2ee8cf ("iio: magn: add a driver for AK8974")
Reported-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Cc: &lt;Stable@vger.kernel.org&gt;
</content>
</entry>
<entry>
<title>iio: Move attach/detach of the poll func to the core</title>
<updated>2020-06-20T16:34:44Z</updated>
<author>
<name>Lars-Peter Clausen</name>
</author>
<published>2020-05-25T11:38:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f11d59d87b8622d4cf9f856c0b8029fb030d8612'/>
<id>urn:sha1:f11d59d87b8622d4cf9f856c0b8029fb030d8612</id>
<content type='text'>
All devices using a triggered buffer need to attach and detach the trigger
to the device in order to properly work. Instead of doing this in each and
every driver by hand move this into the core.

At this point in time, all drivers should have been resolved to
attach/detach the poll-function in the same order.

This patch removes all explicit calls of iio_triggered_buffer_postenable()
&amp; iio_triggered_buffer_predisable() in all drivers, since the core handles
now the pollfunc attach/detach.

The more peculiar change is for the 'at91-sama5d2_adc' driver, since it's
not immediately obvious that removing the hooks doesn't break anything.
Eugen was able to test on at91-sama5d2-adc driver, sama5d2-xplained board.
All seems to be fine.

Signed-off-by: Lars-Peter Clausen &lt;lars@metafoo.de&gt;
Signed-off-by: Alexandru Ardelean &lt;alexandru.ardelean@analog.com&gt;
Tested-by: Eugen Hristev &lt;eugen.hristev@microchip.com&gt; #for at91-sama5d2-adc
Signed-off-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
</content>
</entry>
</feed>
