]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Nov 2022 19:00:53 +0000 (20:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Nov 2022 19:00:53 +0000 (20:00 +0100)
added patches:
bus-ixp4xx-don-t-touch-bit-7-on-ixp42x.patch
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-5.15/bus-ixp4xx-don-t-touch-bit-7-on-ixp42x.patch [new file with mode: 0644]
queue-5.15/iio-core-fix-entry-not-deleted-when-iio_register_sw_trigger_type-fails.patch [new file with mode: 0644]
queue-5.15/iio-light-apds9960-fix-wrong-register-for-gesture-gain.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/bus-ixp4xx-don-t-touch-bit-7-on-ixp42x.patch b/queue-5.15/bus-ixp4xx-don-t-touch-bit-7-on-ixp42x.patch
new file mode 100644 (file)
index 0000000..5861e77
--- /dev/null
@@ -0,0 +1,73 @@
+From ff5a19909b49fe5c0b01ae197f84b741e0f698dc Mon Sep 17 00:00:00 2001
+From: Linus Walleij <linus.walleij@linaro.org>
+Date: Tue, 22 Nov 2022 14:44:11 +0100
+Subject: bus: ixp4xx: Don't touch bit 7 on IXP42x
+
+From: Linus Walleij <linus.walleij@linaro.org>
+
+commit ff5a19909b49fe5c0b01ae197f84b741e0f698dc upstream.
+
+We face some regressions on a few IXP42x systems when
+accessing flash, the following unrelated error prints
+appear from the PCI driver:
+
+ixp4xx-pci c0000000.pci: PCI: abort_handler addr = 0xff9ffb5f,
+          isr = 0x0, status = 0x22a0
+ixp4xx-pci c0000000.pci: imprecise abort
+(...)
+
+It turns out that while bit 7 is masked "reserved" it is
+not unused, so masking it off as zero is dangerous, and
+breaks flash access on some systems such as the NSLU2.
+Be more careful and avoid masking off any of the reserved
+bits 7, 8, 9 or 30. Only keep masking EXP_WORD (bit 2)
+on IXP43x which is necessary in some setups.
+
+Fixes: 1c953bda90ca ("bus: ixp4xx: Add a driver for IXP4xx expansion bus")
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20221122134411.2030372-1-linus.walleij@linaro.org
+Signed-off-by: Arnd Bergmann <arnd@arndb.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/bus/intel-ixp4xx-eb.c | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/bus/intel-ixp4xx-eb.c b/drivers/bus/intel-ixp4xx-eb.c
+index a4388440aca7..91db001eb69a 100644
+--- a/drivers/bus/intel-ixp4xx-eb.c
++++ b/drivers/bus/intel-ixp4xx-eb.c
+@@ -49,7 +49,7 @@
+ #define IXP4XX_EXP_SIZE_SHIFT         10
+ #define IXP4XX_EXP_CNFG_0             BIT(9) /* Always zero */
+ #define IXP43X_EXP_SYNC_INTEL         BIT(8) /* Only on IXP43x */
+-#define IXP43X_EXP_EXP_CHIP           BIT(7) /* Only on IXP43x */
++#define IXP43X_EXP_EXP_CHIP           BIT(7) /* Only on IXP43x, dangerous to touch on IXP42x */
+ #define IXP4XX_EXP_BYTE_RD16          BIT(6)
+ #define IXP4XX_EXP_HRDY_POL           BIT(5) /* Only on IXP42x */
+ #define IXP4XX_EXP_MUX_EN             BIT(4)
+@@ -57,8 +57,6 @@
+ #define IXP4XX_EXP_WORD                       BIT(2) /* Always zero */
+ #define IXP4XX_EXP_WR_EN              BIT(1)
+ #define IXP4XX_EXP_BYTE_EN            BIT(0)
+-#define IXP42X_RESERVED                       (BIT(30)|IXP4XX_EXP_CNFG_0|BIT(8)|BIT(7)|IXP4XX_EXP_WORD)
+-#define IXP43X_RESERVED                       (BIT(30)|IXP4XX_EXP_CNFG_0|BIT(5)|IXP4XX_EXP_WORD)
+ #define IXP4XX_EXP_CNFG0              0x20
+ #define IXP4XX_EXP_CNFG0_MEM_MAP      BIT(31)
+@@ -252,10 +250,9 @@ static void ixp4xx_exp_setup_chipselect(struct ixp4xx_eb *eb,
+               cs_cfg |= val << IXP4XX_EXP_CYC_TYPE_SHIFT;
+       }
+-      if (eb->is_42x)
+-              cs_cfg &= ~IXP42X_RESERVED;
+       if (eb->is_43x) {
+-              cs_cfg &= ~IXP43X_RESERVED;
++              /* Should always be zero */
++              cs_cfg &= ~IXP4XX_EXP_WORD;
+               /*
+                * This bit for Intel strata flash is currently unused, but let's
+                * report it if we find one.
+-- 
+2.38.1
+
diff --git a/queue-5.15/iio-core-fix-entry-not-deleted-when-iio_register_sw_trigger_type-fails.patch b/queue-5.15/iio-core-fix-entry-not-deleted-when-iio_register_sw_trigger_type-fails.patch
new file mode 100644 (file)
index 0000000..ffaf80b
--- /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
+@@ -58,8 +58,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-5.15/iio-light-apds9960-fix-wrong-register-for-gesture-gain.patch b/queue-5.15/iio-light-apds9960-fix-wrong-register-for-gesture-gain.patch
new file mode 100644 (file)
index 0000000..a6ecd1e
--- /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
+@@ -54,9 +54,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
+@@ -77,6 +74,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 8d0c7e304caecc1a55dedc86b82744a4d5dbfc19..5765e5b98eeead3ecd98936282bdf4baa75d8e90 100644 (file)
@@ -144,3 +144,6 @@ usb-cdnsp-fix-issue-with-zlp-added-td_size-1.patch
 ext4-fix-use-after-free-in-ext4_ext_shift_extents.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
+bus-ixp4xx-don-t-touch-bit-7-on-ixp42x.patch