From: Sasha Levin Date: Mon, 12 Jun 2023 03:51:39 +0000 (-0400) Subject: Fixes for 5.10 X-Git-Tag: v4.14.318~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ad5a3cf6fef212a16e8e03c11fd9a5b5ee1111e;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/asoc-codecs-wsa881x-do-not-set-can_multi_write-flag.patch b/queue-5.10/asoc-codecs-wsa881x-do-not-set-can_multi_write-flag.patch new file mode 100644 index 00000000000..240db224104 --- /dev/null +++ b/queue-5.10/asoc-codecs-wsa881x-do-not-set-can_multi_write-flag.patch @@ -0,0 +1,39 @@ +From 50ff155b14e4cb256058371ed99f52bcfd6bcffe Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 23 May 2023 16:46:05 +0100 +Subject: ASoC: codecs: wsa881x: do not set can_multi_write flag + +From: Srinivas Kandagatla + +[ Upstream commit 6e7a6d4797ef521c0762914610ed682e102b9d36 ] + +regmap-sdw does not support multi register writes, so there is +no point in setting this flag. This also leads to incorrect +programming of WSA codecs with regmap_multi_reg_write() call. + +This invalid configuration should have been rejected by regmap-sdw. + +Fixes: a0aab9e1404a ("ASoC: codecs: add wsa881x amplifier support") +Signed-off-by: Srinivas Kandagatla +Link: https://lore.kernel.org/r/20230523154605.4284-2-srinivas.kandagatla@linaro.org +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/wsa881x.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/sound/soc/codecs/wsa881x.c b/sound/soc/codecs/wsa881x.c +index 15b3f47fbfa35..9f66f6dc2c67f 100644 +--- a/sound/soc/codecs/wsa881x.c ++++ b/sound/soc/codecs/wsa881x.c +@@ -646,7 +646,6 @@ static struct regmap_config wsa881x_regmap_config = { + .readable_reg = wsa881x_readable_register, + .reg_format_endian = REGMAP_ENDIAN_NATIVE, + .val_format_endian = REGMAP_ENDIAN_NATIVE, +- .can_multi_write = true, + }; + + enum { +-- +2.39.2 + diff --git a/queue-5.10/eeprom-at24-also-select-regmap.patch b/queue-5.10/eeprom-at24-also-select-regmap.patch new file mode 100644 index 00000000000..cb20307435e --- /dev/null +++ b/queue-5.10/eeprom-at24-also-select-regmap.patch @@ -0,0 +1,49 @@ +From 3121a981ae4a122c44cb4195b23eaf9aa186e216 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 7 Jun 2023 19:54:24 -0700 +Subject: eeprom: at24: also select REGMAP + +From: Randy Dunlap + +[ Upstream commit 7f3c782b3914e510b646a77aedc3adeac2e4a63b ] + +Selecting only REGMAP_I2C can leave REGMAP unset, causing build errors, +so also select REGMAP to prevent the build errors. + +../drivers/misc/eeprom/at24.c:540:42: warning: 'struct regmap_config' declared inside parameter list will not be visible outside of this definition or declaration + 540 | struct regmap_config *regmap_config) +../drivers/misc/eeprom/at24.c: In function 'at24_make_dummy_client': +../drivers/misc/eeprom/at24.c:552:18: error: implicit declaration of function 'devm_regmap_init_i2c' [-Werror=implicit-function-declaration] + 552 | regmap = devm_regmap_init_i2c(dummy_client, regmap_config); +../drivers/misc/eeprom/at24.c:552:16: warning: assignment to 'struct regmap *' from 'int' makes pointer from integer without a cast [-Wint-conversion] + 552 | regmap = devm_regmap_init_i2c(dummy_client, regmap_config); +../drivers/misc/eeprom/at24.c: In function 'at24_probe': +../drivers/misc/eeprom/at24.c:586:16: error: variable 'regmap_config' has initializer but incomplete type + 586 | struct regmap_config regmap_config = { }; +../drivers/misc/eeprom/at24.c:586:30: error: storage size of 'regmap_config' isn't known + 586 | struct regmap_config regmap_config = { }; +../drivers/misc/eeprom/at24.c:586:30: warning: unused variable 'regmap_config' [-Wunused-variable] + +Fixes: 5c015258478e ("eeprom: at24: add basic regmap_i2c support") +Signed-off-by: Randy Dunlap +Signed-off-by: Bartosz Golaszewski +Signed-off-by: Sasha Levin +--- + drivers/misc/eeprom/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/misc/eeprom/Kconfig b/drivers/misc/eeprom/Kconfig +index 0f791bfdc1f58..c92f2cdf40263 100644 +--- a/drivers/misc/eeprom/Kconfig ++++ b/drivers/misc/eeprom/Kconfig +@@ -6,6 +6,7 @@ config EEPROM_AT24 + depends on I2C && SYSFS + select NVMEM + select NVMEM_SYSFS ++ select REGMAP + select REGMAP_I2C + help + Enable this driver to get read/write support to most I2C EEPROMs +-- +2.39.2 + diff --git a/queue-5.10/i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch b/queue-5.10/i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch new file mode 100644 index 00000000000..000271e65d0 --- /dev/null +++ b/queue-5.10/i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch @@ -0,0 +1,53 @@ +From 60896ff3ec94386be7bff89a4bc2bcea01b4e939 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 9 Mar 2023 10:58:19 +0100 +Subject: i2c: sprd: Delete i2c adapter in .remove's error path +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +[ Upstream commit ca0aa17f2db3468fd017038d23a78e17388e2f67 ] + +If pm runtime resume fails the .remove callback used to exit early. This +resulted in an error message by the driver core but the device gets +removed anyhow. This lets the registered i2c adapter stay around with an +unbound parent device. + +So only skip clk disabling if resume failed, but do delete the adapter. + +Fixes: 8b9ec0719834 ("i2c: Add Spreadtrum I2C controller driver") +Signed-off-by: Uwe Kleine-König +Reviewed-by: Andi Shyti +Signed-off-by: Wolfram Sang +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-sprd.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-sprd.c b/drivers/i2c/busses/i2c-sprd.c +index 8ead7e021008c..a520aa06d2cb5 100644 +--- a/drivers/i2c/busses/i2c-sprd.c ++++ b/drivers/i2c/busses/i2c-sprd.c +@@ -576,12 +576,14 @@ static int sprd_i2c_remove(struct platform_device *pdev) + struct sprd_i2c *i2c_dev = platform_get_drvdata(pdev); + int ret; + +- ret = pm_runtime_resume_and_get(i2c_dev->dev); ++ ret = pm_runtime_get_sync(i2c_dev->dev); + if (ret < 0) +- return ret; ++ dev_err(&pdev->dev, "Failed to resume device (%pe)\n", ERR_PTR(ret)); + + i2c_del_adapter(&i2c_dev->adap); +- clk_disable_unprepare(i2c_dev->clk); ++ ++ if (ret >= 0) ++ clk_disable_unprepare(i2c_dev->clk); + + pm_runtime_put_noidle(i2c_dev->dev); + pm_runtime_disable(i2c_dev->dev); +-- +2.39.2 + diff --git a/queue-5.10/riscv-fix-kprobe-__user-string-arg-print-fault-issue.patch b/queue-5.10/riscv-fix-kprobe-__user-string-arg-print-fault-issue.patch new file mode 100644 index 00000000000..ec7bb978313 --- /dev/null +++ b/queue-5.10/riscv-fix-kprobe-__user-string-arg-print-fault-issue.patch @@ -0,0 +1,68 @@ +From c928ea84306189bd75d2ee1e6714d08dbe834ca9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 4 May 2023 15:29:10 +0800 +Subject: riscv: fix kprobe __user string arg print fault issue +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ruan Jinjie + +[ Upstream commit 99a670b2069c725a7b50318aa681d9cae8f89325 ] + +On riscv qemu platform, when add kprobe event on do_sys_open() to show +filename string arg, it just print fault as follow: + +echo 'p:myprobe do_sys_open dfd=$arg1 filename=+0($arg2):string flags=$arg3 +mode=$arg4' > kprobe_events + +bash-166 [000] ...1. 360.195367: myprobe: (do_sys_open+0x0/0x84) +dfd=0xffffffffffffff9c filename=(fault) flags=0x8241 mode=0x1b6 + +bash-166 [000] ...1. 360.219369: myprobe: (do_sys_open+0x0/0x84) +dfd=0xffffffffffffff9c filename=(fault) flags=0x8241 mode=0x1b6 + +bash-191 [000] ...1. 360.378827: myprobe: (do_sys_open+0x0/0x84) +dfd=0xffffffffffffff9c filename=(fault) flags=0x98800 mode=0x0 + +As riscv do not select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE, +the +0($arg2) addr is processed as a kernel address though it is a +userspace address, cause the above filename=(fault) print. So select +ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE to avoid the issue, after that the +kprobe trace is ok as below: + +bash-166 [000] ...1. 96.767641: myprobe: (do_sys_open+0x0/0x84) +dfd=0xffffffffffffff9c filename="/dev/null" flags=0x8241 mode=0x1b6 + +bash-166 [000] ...1. 96.793751: myprobe: (do_sys_open+0x0/0x84) +dfd=0xffffffffffffff9c filename="/dev/null" flags=0x8241 mode=0x1b6 + +bash-177 [000] ...1. 96.962354: myprobe: (do_sys_open+0x0/0x84) +dfd=0xffffffffffffff9c filename="/sys/kernel/debug/tracing/events/kprobes/" +flags=0x98800 mode=0x0 + +Signed-off-by: Ruan Jinjie +Acked-by: Björn Töpel +Fixes: 0ebeea8ca8a4 ("bpf: Restrict bpf_probe_read{, str}() only to archs where they work") +Link: https://lore.kernel.org/r/20230504072910.3742842-1-ruanjinjie@huawei.com +Signed-off-by: Palmer Dabbelt +Signed-off-by: Sasha Levin +--- + arch/riscv/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig +index c192bd7305dc6..b28fabfc91bf7 100644 +--- a/arch/riscv/Kconfig ++++ b/arch/riscv/Kconfig +@@ -22,6 +22,7 @@ config RISCV + select ARCH_HAS_GIGANTIC_PAGE + select ARCH_HAS_KCOV + select ARCH_HAS_MMIOWB ++ select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE + select ARCH_HAS_PTE_SPECIAL + select ARCH_HAS_SET_DIRECT_MAP + select ARCH_HAS_SET_MEMORY +-- +2.39.2 + diff --git a/queue-5.10/series b/queue-5.10/series index 2359e9c748d..d208eaf6b01 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -52,3 +52,8 @@ pinctrl-meson-axg-add-missing-gpioa_18-gpio-group.patch usb-usbfs-enforce-page-requirements-for-mmap.patch usb-usbfs-use-consistent-mmap-functions.patch staging-vc04_services-fix-gcc-13-build-warning.patch +asoc-codecs-wsa881x-do-not-set-can_multi_write-flag.patch +i2c-sprd-delete-i2c-adapter-in-.remove-s-error-path.patch +eeprom-at24-also-select-regmap.patch +riscv-fix-kprobe-__user-string-arg-print-fault-issue.patch +vhost-support-packed-when-setting-getting-vring_base.patch diff --git a/queue-5.10/vhost-support-packed-when-setting-getting-vring_base.patch b/queue-5.10/vhost-support-packed-when-setting-getting-vring_base.patch new file mode 100644 index 00000000000..d6cc587cac1 --- /dev/null +++ b/queue-5.10/vhost-support-packed-when-setting-getting-vring_base.patch @@ -0,0 +1,85 @@ +From bd8b1019aba4e66fd21a7ffe8342b0427d5eb225 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 24 Apr 2023 15:50:30 -0700 +Subject: vhost: support PACKED when setting-getting vring_base + +From: Shannon Nelson + +[ Upstream commit 55d8122f5cd62d5aaa225d7167dcd14a44c850b9 ] + +Use the right structs for PACKED or split vqs when setting and +getting the vring base. + +Fixes: 4c8cf31885f6 ("vhost: introduce vDPA-based backend") +Signed-off-by: Shannon Nelson +Message-Id: <20230424225031.18947-3-shannon.nelson@amd.com> +Signed-off-by: Michael S. Tsirkin +Acked-by: Jason Wang +Signed-off-by: Sasha Levin +--- + drivers/vhost/vhost.c | 18 +++++++++++++----- + drivers/vhost/vhost.h | 8 ++++++-- + 2 files changed, 19 insertions(+), 7 deletions(-) + +diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c +index 1f9a1554ce5f4..de110363af521 100644 +--- a/drivers/vhost/vhost.c ++++ b/drivers/vhost/vhost.c +@@ -1621,17 +1621,25 @@ long vhost_vring_ioctl(struct vhost_dev *d, unsigned int ioctl, void __user *arg + r = -EFAULT; + break; + } +- if (s.num > 0xffff) { +- r = -EINVAL; +- break; ++ if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) { ++ vq->last_avail_idx = s.num & 0xffff; ++ vq->last_used_idx = (s.num >> 16) & 0xffff; ++ } else { ++ if (s.num > 0xffff) { ++ r = -EINVAL; ++ break; ++ } ++ vq->last_avail_idx = s.num; + } +- vq->last_avail_idx = s.num; + /* Forget the cached index value. */ + vq->avail_idx = vq->last_avail_idx; + break; + case VHOST_GET_VRING_BASE: + s.index = idx; +- s.num = vq->last_avail_idx; ++ if (vhost_has_feature(vq, VIRTIO_F_RING_PACKED)) ++ s.num = (u32)vq->last_avail_idx | ((u32)vq->last_used_idx << 16); ++ else ++ s.num = vq->last_avail_idx; + if (copy_to_user(argp, &s, sizeof s)) + r = -EFAULT; + break; +diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h +index 8f80d6b0d843e..e00347f2b4d30 100644 +--- a/drivers/vhost/vhost.h ++++ b/drivers/vhost/vhost.h +@@ -87,13 +87,17 @@ struct vhost_virtqueue { + /* The routine to call when the Guest pings us, or timeout. */ + vhost_work_fn_t handle_kick; + +- /* Last available index we saw. */ ++ /* Last available index we saw. ++ * Values are limited to 0x7fff, and the high bit is used as ++ * a wrap counter when using VIRTIO_F_RING_PACKED. */ + u16 last_avail_idx; + + /* Caches available index value from user. */ + u16 avail_idx; + +- /* Last index we used. */ ++ /* Last index we used. ++ * Values are limited to 0x7fff, and the high bit is used as ++ * a wrap counter when using VIRTIO_F_RING_PACKED. */ + u16 last_used_idx; + + /* Used flags */ +-- +2.39.2 +