From fd8585fd75b8b9207e1f02f5a7f5cd58b2529428 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 29 Nov 2022 20:00:53 +0100 Subject: [PATCH] 5.15-stable patches 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 --- ...s-ixp4xx-don-t-touch-bit-7-on-ixp42x.patch | 73 +++++++++++++++++++ ...n-iio_register_sw_trigger_type-fails.patch | 52 +++++++++++++ ...-fix-wrong-register-for-gesture-gain.patch | 58 +++++++++++++++ queue-5.15/series | 3 + 4 files changed, 186 insertions(+) create mode 100644 queue-5.15/bus-ixp4xx-don-t-touch-bit-7-on-ixp42x.patch create mode 100644 queue-5.15/iio-core-fix-entry-not-deleted-when-iio_register_sw_trigger_type-fails.patch create mode 100644 queue-5.15/iio-light-apds9960-fix-wrong-register-for-gesture-gain.patch 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 index 00000000000..5861e772ed4 --- /dev/null +++ b/queue-5.15/bus-ixp4xx-don-t-touch-bit-7-on-ixp42x.patch @@ -0,0 +1,73 @@ +From ff5a19909b49fe5c0b01ae197f84b741e0f698dc Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Tue, 22 Nov 2022 14:44:11 +0100 +Subject: bus: ixp4xx: Don't touch bit 7 on IXP42x + +From: Linus Walleij + +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 +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20221122134411.2030372-1-linus.walleij@linaro.org +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..ffaf80bc411 --- /dev/null +++ b/queue-5.15/iio-core-fix-entry-not-deleted-when-iio_register_sw_trigger_type-fails.patch @@ -0,0 +1,52 @@ +From 4ad09d956f8eacff61e67e5b13ba8ebec3232f76 Mon Sep 17 00:00:00 2001 +From: Chen Zhongjin +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 + +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: + + 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 +Link: https://lore.kernel.org/r/20221108032802.168623-1-chenzhongjin@huawei.com +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..a6ecd1ea34d --- /dev/null +++ b/queue-5.15/iio-light-apds9960-fix-wrong-register-for-gesture-gain.patch @@ -0,0 +1,58 @@ +From 0aa60ff5d996d4ecdd4a62699c01f6d00f798d59 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alejandro=20Concepci=C3=B3n=20Rodr=C3=ADguez?= + +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 + +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 +Acked-by: Matt Ranostay +Cc: +Link: https://lore.kernel.org/r/EaT-NKC-H4DNX5z4Lg9B6IWPD5TrTrYBr5DYB784wfDKQkTmzPXkoYqyUOrOgJH-xvTsEkFLcVkeAPZRUODEFI5dGziaWXwjpfBNLeNGfNc=@acoro.eu +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + 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); diff --git a/queue-5.15/series b/queue-5.15/series index 8d0c7e304ca..5765e5b98ee 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -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 -- 2.47.3