From: Greg Kroah-Hartman Date: Tue, 27 Mar 2018 08:30:19 +0000 (+0200) Subject: 4.15-stable patches X-Git-Tag: v4.15.14~11 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2998f25e717b2eb7676a24054d5170b04e40c2d9;p=thirdparty%2Fkernel%2Fstable-queue.git 4.15-stable patches 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 --- 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 index 00000000000..5d597d532aa --- /dev/null +++ b/queue-4.15/iio-abi-fix-name-of-timestamp-sysfs-file.patch @@ -0,0 +1,31 @@ +From b9a3589332c2a25fb7edad25a26fcaada3209126 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Tue, 5 Dec 2017 11:57:27 +0100 +Subject: iio: ABI: Fix name of timestamp sysfs file + +From: Linus Walleij + +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 +Signed-off-by: Linus Walleij +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +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 index 00000000000..8a5fb2b925c --- /dev/null +++ b/queue-4.15/iio-imu-st_lsm6dsx-fix-endianness-in-st_lsm6dsx_read_oneshot.patch @@ -0,0 +1,32 @@ +From 7b9ebe428266fb7e0a6d769bb3ff3fcb6044b15e Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Mon, 1 Jan 2018 19:54:42 +0100 +Subject: iio: imu: st_lsm6dsx: fix endianness in st_lsm6dsx_read_oneshot() + +From: Lorenzo Bianconi + +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 +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..1c039fa05b5 --- /dev/null +++ b/queue-4.15/iio-imu-st_lsm6dsx-introduce-conf_lock-mutex.patch @@ -0,0 +1,125 @@ +From 335eaedce461c9092e133ce0c6247f5a0b0baf69 Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Mon, 1 Jan 2018 19:54:43 +0100 +Subject: iio: imu: st_lsm6dsx: introduce conf_lock mutex + +From: Lorenzo Bianconi + +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 +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + 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; diff --git a/queue-4.15/series b/queue-4.15/series index bb24c3e8e1c..d839a1a259a 100644 --- a/queue-4.15/series +++ b/queue-4.15/series @@ -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 index 00000000000..70a3e79711c --- /dev/null +++ b/queue-4.15/staging-android-ion-zero-cma-allocated-memory.patch @@ -0,0 +1,58 @@ +From 6d79bd5bb6c79a9dba4842040c9adf39e7806330 Mon Sep 17 00:00:00 2001 +From: Liam Mark +Date: Fri, 26 Jan 2018 09:48:18 -0800 +Subject: staging: android: ion: Zero CMA allocated memory + +From: Liam Mark + +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 +Acked-by: Laura Abbott +Signed-off-by: Greg Kroah-Hartman + +--- + 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 + #include + #include ++#include + + #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;