]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Mar 2018 08:30:19 +0000 (10:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Mar 2018 08:30:19 +0000 (10:30 +0200)
added patches:
iio-abi-fix-name-of-timestamp-sysfs-file.patch
iio-imu-st_lsm6dsx-fix-endianness-in-st_lsm6dsx_read_oneshot.patch
iio-imu-st_lsm6dsx-introduce-conf_lock-mutex.patch
staging-android-ion-zero-cma-allocated-memory.patch

queue-4.15/iio-abi-fix-name-of-timestamp-sysfs-file.patch [new file with mode: 0644]
queue-4.15/iio-imu-st_lsm6dsx-fix-endianness-in-st_lsm6dsx_read_oneshot.patch [new file with mode: 0644]
queue-4.15/iio-imu-st_lsm6dsx-introduce-conf_lock-mutex.patch [new file with mode: 0644]
queue-4.15/series
queue-4.15/staging-android-ion-zero-cma-allocated-memory.patch [new file with mode: 0644]

diff --git a/queue-4.15/iio-abi-fix-name-of-timestamp-sysfs-file.patch b/queue-4.15/iio-abi-fix-name-of-timestamp-sysfs-file.patch
new file mode 100644 (file)
index 0000000..5d597d5
--- /dev/null
@@ -0,0 +1,31 @@
+From b9a3589332c2a25fb7edad25a26fcaada3209126 Mon Sep 17 00:00:00 2001
+From: Linus Walleij <linus.walleij@linaro.org>
+Date: Tue, 5 Dec 2017 11:57:27 +0100
+Subject: iio: ABI: Fix name of timestamp sysfs file
+
+From: Linus Walleij <linus.walleij@linaro.org>
+
+commit b9a3589332c2a25fb7edad25a26fcaada3209126 upstream.
+
+The name of the file is "current_timetamp_clock" not
+"timestamp_clock".
+
+Fixes: bc2b7dab629a ("iio:core: timestamping clock selection support")
+Cc: Gregor Boirie <gregor.boirie@parrot.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+diff --git a/Documentation/ABI/testing/sysfs-bus-iio b/Documentation/ABI/testing/sysfs-bus-iio
+index 9cc0ea1c0273..6a5f34b4d5b9 100644
+--- a/Documentation/ABI/testing/sysfs-bus-iio
++++ b/Documentation/ABI/testing/sysfs-bus-iio
+@@ -32,7 +32,7 @@ Description:
+               Description of the physical chip / device for device X.
+               Typically a part number.
+-What:         /sys/bus/iio/devices/iio:deviceX/timestamp_clock
++What:         /sys/bus/iio/devices/iio:deviceX/current_timestamp_clock
+ KernelVersion:        4.5
+ Contact:      linux-iio@vger.kernel.org
+ Description:
diff --git a/queue-4.15/iio-imu-st_lsm6dsx-fix-endianness-in-st_lsm6dsx_read_oneshot.patch b/queue-4.15/iio-imu-st_lsm6dsx-fix-endianness-in-st_lsm6dsx_read_oneshot.patch
new file mode 100644 (file)
index 0000000..8a5fb2b
--- /dev/null
@@ -0,0 +1,32 @@
+From 7b9ebe428266fb7e0a6d769bb3ff3fcb6044b15e Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
+Date: Mon, 1 Jan 2018 19:54:42 +0100
+Subject: iio: imu: st_lsm6dsx: fix endianness in st_lsm6dsx_read_oneshot()
+
+From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
+
+commit 7b9ebe428266fb7e0a6d769bb3ff3fcb6044b15e upstream.
+
+Apply le16_to_cpu() to data read from the sensor in order to take into
+account architecture endianness
+
+Fixes: 290a6ce11d93 (iio: imu: add support to lsm6dsx driver)
+Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
++++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+@@ -448,7 +448,7 @@ static int st_lsm6dsx_read_oneshot(struc
+       st_lsm6dsx_sensor_disable(sensor);
+-      *val = (s16)data;
++      *val = (s16)le16_to_cpu(data);
+       return IIO_VAL_INT;
+ }
diff --git a/queue-4.15/iio-imu-st_lsm6dsx-introduce-conf_lock-mutex.patch b/queue-4.15/iio-imu-st_lsm6dsx-introduce-conf_lock-mutex.patch
new file mode 100644 (file)
index 0000000..1c039fa
--- /dev/null
@@ -0,0 +1,125 @@
+From 335eaedce461c9092e133ce0c6247f5a0b0baf69 Mon Sep 17 00:00:00 2001
+From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
+Date: Mon, 1 Jan 2018 19:54:43 +0100
+Subject: iio: imu: st_lsm6dsx: introduce conf_lock mutex
+
+From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
+
+commit 335eaedce461c9092e133ce0c6247f5a0b0baf69 upstream.
+
+Add conf_lock mutex to prevent concurrent FIFO configuration update
+
+Fixes: 290a6ce11d93 (iio: imu: add support to lsm6dsx driver)
+Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h        |    2 ++
+ drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c |   21 +++++++++++++--------
+ drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c   |    6 ++++++
+ 3 files changed, 21 insertions(+), 8 deletions(-)
+
+--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
++++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
+@@ -130,6 +130,7 @@ struct st_lsm6dsx_sensor {
+  * @irq: Device interrupt line (I2C or SPI).
+  * @lock: Mutex to protect read and write operations.
+  * @fifo_lock: Mutex to prevent concurrent access to the hw FIFO.
++ * @conf_lock: Mutex to prevent concurrent FIFO configuration update.
+  * @fifo_mode: FIFO operating mode supported by the device.
+  * @enable_mask: Enabled sensor bitmask.
+  * @sip: Total number of samples (acc/gyro) in a given pattern.
+@@ -144,6 +145,7 @@ struct st_lsm6dsx_hw {
+       struct mutex lock;
+       struct mutex fifo_lock;
++      struct mutex conf_lock;
+       enum st_lsm6dsx_fifo_mode fifo_mode;
+       u8 enable_mask;
+--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
++++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
+@@ -325,38 +325,40 @@ static int st_lsm6dsx_update_fifo(struct
+       struct st_lsm6dsx_hw *hw = sensor->hw;
+       int err;
++      mutex_lock(&hw->conf_lock);
++
+       if (hw->fifo_mode != ST_LSM6DSX_FIFO_BYPASS) {
+               err = st_lsm6dsx_flush_fifo(hw);
+               if (err < 0)
+-                      return err;
++                      goto out;
+       }
+       if (enable) {
+               err = st_lsm6dsx_sensor_enable(sensor);
+               if (err < 0)
+-                      return err;
++                      goto out;
+       } else {
+               err = st_lsm6dsx_sensor_disable(sensor);
+               if (err < 0)
+-                      return err;
++                      goto out;
+       }
+       err = st_lsm6dsx_set_fifo_odr(sensor, enable);
+       if (err < 0)
+-              return err;
++              goto out;
+       err = st_lsm6dsx_update_decimators(hw);
+       if (err < 0)
+-              return err;
++              goto out;
+       err = st_lsm6dsx_update_watermark(sensor, sensor->watermark);
+       if (err < 0)
+-              return err;
++              goto out;
+       if (hw->enable_mask) {
+               err = st_lsm6dsx_set_fifo_mode(hw, ST_LSM6DSX_FIFO_CONT);
+               if (err < 0)
+-                      return err;
++                      goto out;
+               /*
+                * store enable buffer timestamp as reference to compute
+@@ -365,7 +367,10 @@ static int st_lsm6dsx_update_fifo(struct
+               sensor->ts = iio_get_time_ns(iio_dev);
+       }
+-      return 0;
++out:
++      mutex_unlock(&hw->conf_lock);
++
++      return err;
+ }
+ static irqreturn_t st_lsm6dsx_handler_irq(int irq, void *private)
+--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
++++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
+@@ -528,7 +528,12 @@ static int st_lsm6dsx_set_watermark(stru
+       if (val < 1 || val > hw->settings->max_fifo_size)
+               return -EINVAL;
++      mutex_lock(&hw->conf_lock);
++
+       err = st_lsm6dsx_update_watermark(sensor, val);
++
++      mutex_unlock(&hw->conf_lock);
++
+       if (err < 0)
+               return err;
+@@ -739,6 +744,7 @@ int st_lsm6dsx_probe(struct device *dev,
+       mutex_init(&hw->lock);
+       mutex_init(&hw->fifo_lock);
++      mutex_init(&hw->conf_lock);
+       hw->dev = dev;
+       hw->irq = irq;
index bb24c3e8e1c65dbfc7970340842335cf90d5702b..d839a1a259ad9a513a26d489d092accb39d99107 100644 (file)
@@ -96,3 +96,7 @@ perf-core-fix-ctx_event_type-in-ctx_resched.patch
 trace-bpf-remove-helper-bpf_perf_prog_read_value-from-tracepoint-type-programs.patch
 perf-x86-intel-don-t-accidentally-clear-high-bits-in-bdw_limit_period.patch
 perf-x86-intel-uncore-fix-multi-domain-pci-cha-enumeration-bug-on-skylake-servers.patch
+iio-abi-fix-name-of-timestamp-sysfs-file.patch
+iio-imu-st_lsm6dsx-fix-endianness-in-st_lsm6dsx_read_oneshot.patch
+iio-imu-st_lsm6dsx-introduce-conf_lock-mutex.patch
+staging-android-ion-zero-cma-allocated-memory.patch
diff --git a/queue-4.15/staging-android-ion-zero-cma-allocated-memory.patch b/queue-4.15/staging-android-ion-zero-cma-allocated-memory.patch
new file mode 100644 (file)
index 0000000..70a3e79
--- /dev/null
@@ -0,0 +1,58 @@
+From 6d79bd5bb6c79a9dba4842040c9adf39e7806330 Mon Sep 17 00:00:00 2001
+From: Liam Mark <lmark@codeaurora.org>
+Date: Fri, 26 Jan 2018 09:48:18 -0800
+Subject: staging: android: ion: Zero CMA allocated memory
+
+From: Liam Mark <lmark@codeaurora.org>
+
+commit 6d79bd5bb6c79a9dba4842040c9adf39e7806330 upstream.
+
+Since commit 204f672255c2 ("staging: android: ion: Use CMA APIs directly")
+the CMA API is now used directly and therefore the allocated memory is no
+longer automatically zeroed.
+
+Explicitly zero CMA allocated memory to ensure that no data is exposed to
+userspace.
+
+Fixes: 204f672255c2 ("staging: android: ion: Use CMA APIs directly")
+Signed-off-by: Liam Mark <lmark@codeaurora.org>
+Acked-by: Laura Abbott <labbott@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/staging/android/ion/ion_cma_heap.c |   17 +++++++++++++++++
+ 1 file changed, 17 insertions(+)
+
+--- a/drivers/staging/android/ion/ion_cma_heap.c
++++ b/drivers/staging/android/ion/ion_cma_heap.c
+@@ -21,6 +21,7 @@
+ #include <linux/err.h>
+ #include <linux/cma.h>
+ #include <linux/scatterlist.h>
++#include <linux/highmem.h>
+ #include "ion.h"
+@@ -51,6 +52,22 @@ static int ion_cma_allocate(struct ion_h
+       if (!pages)
+               return -ENOMEM;
++      if (PageHighMem(pages)) {
++              unsigned long nr_clear_pages = nr_pages;
++              struct page *page = pages;
++
++              while (nr_clear_pages > 0) {
++                      void *vaddr = kmap_atomic(page);
++
++                      memset(vaddr, 0, PAGE_SIZE);
++                      kunmap_atomic(vaddr);
++                      page++;
++                      nr_clear_pages--;
++              }
++      } else {
++              memset(page_address(pages), 0, size);
++      }
++
+       table = kmalloc(sizeof(*table), GFP_KERNEL);
+       if (!table)
+               goto err;