]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Nov 2022 19:00:21 +0000 (20:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Nov 2022 19:00:21 +0000 (20:00 +0100)
added patches:
iio-core-fix-entry-not-deleted-when-iio_register_sw_trigger_type-fails.patch
iio-light-apds9960-fix-wrong-register-for-gesture-gain.patch

queue-4.19/iio-core-fix-entry-not-deleted-when-iio_register_sw_trigger_type-fails.patch [new file with mode: 0644]
queue-4.19/iio-light-apds9960-fix-wrong-register-for-gesture-gain.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/iio-core-fix-entry-not-deleted-when-iio_register_sw_trigger_type-fails.patch b/queue-4.19/iio-core-fix-entry-not-deleted-when-iio_register_sw_trigger_type-fails.patch
new file mode 100644 (file)
index 0000000..825d443
--- /dev/null
@@ -0,0 +1,52 @@
+From 4ad09d956f8eacff61e67e5b13ba8ebec3232f76 Mon Sep 17 00:00:00 2001
+From: Chen Zhongjin <chenzhongjin@huawei.com>
+Date: Tue, 8 Nov 2022 11:28:02 +0800
+Subject: iio: core: Fix entry not deleted when iio_register_sw_trigger_type() fails
+
+From: Chen Zhongjin <chenzhongjin@huawei.com>
+
+commit 4ad09d956f8eacff61e67e5b13ba8ebec3232f76 upstream.
+
+In iio_register_sw_trigger_type(), configfs_register_default_group() is
+possible to fail, but the entry add to iio_trigger_types_list is not
+deleted.
+
+This leaves wild in iio_trigger_types_list, which can cause page fault
+when module is loading again. So fix this by list_del(&t->list) in error
+path.
+
+BUG: unable to handle page fault for address: fffffbfff81d7400
+Call Trace:
+<TASK>
+ iio_register_sw_trigger_type
+ do_one_initcall
+ do_init_module
+ load_module
+ ...
+
+Fixes: b662f809d410 ("iio: core: Introduce IIO software triggers")
+Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
+Link: https://lore.kernel.org/r/20221108032802.168623-1-chenzhongjin@huawei.com
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/industrialio-sw-trigger.c |    6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+--- a/drivers/iio/industrialio-sw-trigger.c
++++ b/drivers/iio/industrialio-sw-trigger.c
+@@ -61,8 +61,12 @@ int iio_register_sw_trigger_type(struct
+       t->group = configfs_register_default_group(iio_triggers_group, t->name,
+                                               &iio_trigger_type_group_type);
+-      if (IS_ERR(t->group))
++      if (IS_ERR(t->group)) {
++              mutex_lock(&iio_trigger_types_lock);
++              list_del(&t->list);
++              mutex_unlock(&iio_trigger_types_lock);
+               ret = PTR_ERR(t->group);
++      }
+       return ret;
+ }
diff --git a/queue-4.19/iio-light-apds9960-fix-wrong-register-for-gesture-gain.patch b/queue-4.19/iio-light-apds9960-fix-wrong-register-for-gesture-gain.patch
new file mode 100644 (file)
index 0000000..1795910
--- /dev/null
@@ -0,0 +1,58 @@
+From 0aa60ff5d996d4ecdd4a62699c01f6d00f798d59 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alejandro=20Concepci=C3=B3n=20Rodr=C3=ADguez?=
+ <asconcepcion@acoro.eu>
+Date: Sun, 6 Nov 2022 01:56:51 +0000
+Subject: iio: light: apds9960: fix wrong register for gesture gain
+
+From: Alejandro Concepción Rodríguez <asconcepcion@acoro.eu>
+
+commit 0aa60ff5d996d4ecdd4a62699c01f6d00f798d59 upstream.
+
+Gesture Gain Control is in REG_GCONF_2 (0xa3), not in REG_CONFIG_2 (0x90).
+
+Fixes: aff268cd532e ("iio: light: add APDS9960 ALS + promixity driver")
+Signed-off-by: Alejandro Concepcion-Rodriguez <asconcepcion@acoro.eu>
+Acked-by: Matt Ranostay <matt.ranostay@konsulko.com>
+Cc: <Stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/EaT-NKC-H4DNX5z4Lg9B6IWPD5TrTrYBr5DYB784wfDKQkTmzPXkoYqyUOrOgJH-xvTsEkFLcVkeAPZRUODEFI5dGziaWXwjpfBNLeNGfNc=@acoro.eu
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/light/apds9960.c |   12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/drivers/iio/light/apds9960.c
++++ b/drivers/iio/light/apds9960.c
+@@ -55,9 +55,6 @@
+ #define APDS9960_REG_CONTROL_PGAIN_MASK_SHIFT 2
+ #define APDS9960_REG_CONFIG_2 0x90
+-#define APDS9960_REG_CONFIG_2_GGAIN_MASK      0x60
+-#define APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT        5
+-
+ #define APDS9960_REG_ID               0x92
+ #define APDS9960_REG_STATUS   0x93
+@@ -78,6 +75,9 @@
+ #define APDS9960_REG_GCONF_1_GFIFO_THRES_MASK_SHIFT   6
+ #define APDS9960_REG_GCONF_2  0xa3
++#define APDS9960_REG_GCONF_2_GGAIN_MASK                       0x60
++#define APDS9960_REG_GCONF_2_GGAIN_MASK_SHIFT         5
++
+ #define APDS9960_REG_GOFFSET_U        0xa4
+ #define APDS9960_REG_GOFFSET_D        0xa5
+ #define APDS9960_REG_GPULSE   0xa6
+@@ -396,9 +396,9 @@ static int apds9960_set_pxs_gain(struct
+                       }
+                       ret = regmap_update_bits(data->regmap,
+-                              APDS9960_REG_CONFIG_2,
+-                              APDS9960_REG_CONFIG_2_GGAIN_MASK,
+-                              idx << APDS9960_REG_CONFIG_2_GGAIN_MASK_SHIFT);
++                              APDS9960_REG_GCONF_2,
++                              APDS9960_REG_GCONF_2_GGAIN_MASK,
++                              idx << APDS9960_REG_GCONF_2_GGAIN_MASK_SHIFT);
+                       if (!ret)
+                               data->pxs_gain = idx;
+                       mutex_unlock(&data->lock);
index f5c4bb727238721fde0db705f1bf6b863e4d5ca3..75cbe360116bb16558d6b2a36b323e591648d7bf 100644 (file)
@@ -34,4 +34,6 @@ net-thunderx-fix-the-acpi-memory-leak.patch
 s390-crashdump-fix-tod-programmable-field-size.patch
 arm64-dts-rockchip-lower-rk3399-puma-haikou-sd-controller-clock-frequency.patch
 kbuild-fix-wimplicit-function-declaration-in-license_is_gpl_compatible.patch
+iio-light-apds9960-fix-wrong-register-for-gesture-gain.patch
+iio-core-fix-entry-not-deleted-when-iio_register_sw_trigger_type-fails.patch
 nios2-add-force-for-vmlinuz.gz.patch