From: Sasha Levin Date: Wed, 19 Jun 2024 12:25:04 +0000 (-0400) Subject: Fixes for 6.1 X-Git-Tag: v6.1.95~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f05597c0c9b97e5bf28d9a99019e22036ec43689;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 6.1 Signed-off-by: Sasha Levin --- diff --git a/queue-6.1/i2c-at91-fix-the-functionality-flags-of-the-slave-on.patch b/queue-6.1/i2c-at91-fix-the-functionality-flags-of-the-slave-on.patch new file mode 100644 index 00000000000..7855f1d0152 --- /dev/null +++ b/queue-6.1/i2c-at91-fix-the-functionality-flags-of-the-slave-on.patch @@ -0,0 +1,44 @@ +From c1cb0c950bda60d2c615ed8d432de5e34293bea8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 31 May 2024 11:19:14 +0200 +Subject: i2c: at91: Fix the functionality flags of the slave-only interface + +From: Jean Delvare + +[ Upstream commit d6d5645e5fc1233a7ba950de4a72981c394a2557 ] + +When an I2C adapter acts only as a slave, it should not claim to +support I2C master capabilities. + +Fixes: 9d3ca54b550c ("i2c: at91: added slave mode support") +Signed-off-by: Jean Delvare +Cc: Juergen Fitschen +Cc: Ludovic Desroches +Cc: Codrin Ciubotariu +Cc: Andi Shyti +Cc: Nicolas Ferre +Cc: Alexandre Belloni +Cc: Claudiu Beznea +Signed-off-by: Andi Shyti +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-at91-slave.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-at91-slave.c b/drivers/i2c/busses/i2c-at91-slave.c +index d6eeea5166c04..131a67d9d4a68 100644 +--- a/drivers/i2c/busses/i2c-at91-slave.c ++++ b/drivers/i2c/busses/i2c-at91-slave.c +@@ -106,8 +106,7 @@ static int at91_unreg_slave(struct i2c_client *slave) + + static u32 at91_twi_func(struct i2c_adapter *adapter) + { +- return I2C_FUNC_SLAVE | I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL +- | I2C_FUNC_SMBUS_READ_BLOCK_DATA; ++ return I2C_FUNC_SLAVE; + } + + static const struct i2c_algorithm at91_twi_algorithm_slave = { +-- +2.43.0 + diff --git a/queue-6.1/i2c-designware-fix-the-functionality-flags-of-the-sl.patch b/queue-6.1/i2c-designware-fix-the-functionality-flags-of-the-sl.patch new file mode 100644 index 00000000000..2136dcbf4f1 --- /dev/null +++ b/queue-6.1/i2c-designware-fix-the-functionality-flags-of-the-sl.patch @@ -0,0 +1,46 @@ +From 137afc25dd7db00cc2f246a565edbe8b8077b89c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 31 May 2024 11:17:48 +0200 +Subject: i2c: designware: Fix the functionality flags of the slave-only + interface + +From: Jean Delvare + +[ Upstream commit cbf3fb5b29e99e3689d63a88c3cddbffa1b8de99 ] + +When an I2C adapter acts only as a slave, it should not claim to +support I2C master capabilities. + +Fixes: 5b6d721b266a ("i2c: designware: enable SLAVE in platform module") +Signed-off-by: Jean Delvare +Cc: Luis Oliveira +Cc: Jarkko Nikula +Cc: Andy Shevchenko +Cc: Mika Westerberg +Cc: Jan Dabros +Cc: Andi Shyti +Reviewed-by: Andy Shevchenko +Acked-by: Jarkko Nikula +Tested-by: Jarkko Nikula +Signed-off-by: Andi Shyti +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-designware-slave.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/i2c/busses/i2c-designware-slave.c b/drivers/i2c/busses/i2c-designware-slave.c +index 0d15f4c1e9f7e..5b54a9b9ed1a3 100644 +--- a/drivers/i2c/busses/i2c-designware-slave.c ++++ b/drivers/i2c/busses/i2c-designware-slave.c +@@ -232,7 +232,7 @@ static const struct i2c_algorithm i2c_dw_algo = { + + void i2c_dw_configure_slave(struct dw_i2c_dev *dev) + { +- dev->functionality = I2C_FUNC_SLAVE | DW_IC_DEFAULT_FUNCTIONALITY; ++ dev->functionality = I2C_FUNC_SLAVE; + + dev->slave_cfg = DW_IC_CON_RX_FIFO_FULL_HLD_CTRL | + DW_IC_CON_RESTART_EN | DW_IC_CON_STOP_DET_IFADDRESSED; +-- +2.43.0 + diff --git a/queue-6.1/misc-microchip-pci1xxxx-fix-a-memory-leak-in-the-err.patch b/queue-6.1/misc-microchip-pci1xxxx-fix-a-memory-leak-in-the-err.patch new file mode 100644 index 00000000000..008d65b3c19 --- /dev/null +++ b/queue-6.1/misc-microchip-pci1xxxx-fix-a-memory-leak-in-the-err.patch @@ -0,0 +1,45 @@ +From 864388c899693d35249c9471e67b16b1e69615b3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 23 May 2024 20:14:34 +0800 +Subject: misc: microchip: pci1xxxx: Fix a memory leak in the error handling of + gp_aux_bus_probe() + +From: Yongzhi Liu + +[ Upstream commit 77427e3d5c353e3dd98c7c0af322f8d9e3131ace ] + +There is a memory leak (forget to free allocated buffers) in a +memory allocation failure path. + +Fix it to jump to the correct error handling code. + +Fixes: 393fc2f5948f ("misc: microchip: pci1xxxx: load auxiliary bus driver for the PIO function in the multi-function endpoint of pci1xxxx device.") +Signed-off-by: Yongzhi Liu +Reviewed-by: Kumaravel Thiagarajan +Link: https://lore.kernel.org/r/20240523121434.21855-4-hyperlyzcs@gmail.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c +index de75d89ef53e8..34c9be437432a 100644 +--- a/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c ++++ b/drivers/misc/mchp_pci1xxxx/mchp_pci1xxxx_gp.c +@@ -69,8 +69,10 @@ static int gp_aux_bus_probe(struct pci_dev *pdev, const struct pci_device_id *id + + aux_bus->aux_device_wrapper[1] = kzalloc(sizeof(*aux_bus->aux_device_wrapper[1]), + GFP_KERNEL); +- if (!aux_bus->aux_device_wrapper[1]) +- return -ENOMEM; ++ if (!aux_bus->aux_device_wrapper[1]) { ++ retval = -ENOMEM; ++ goto err_aux_dev_add_0; ++ } + + retval = ida_alloc(&gp_client_ida, GFP_KERNEL); + if (retval < 0) +-- +2.43.0 + diff --git a/queue-6.1/serial-8250_dw-fall-back-to-poll-if-there-s-no-inter.patch b/queue-6.1/serial-8250_dw-fall-back-to-poll-if-there-s-no-inter.patch new file mode 100644 index 00000000000..5dc2b80f03c --- /dev/null +++ b/queue-6.1/serial-8250_dw-fall-back-to-poll-if-there-s-no-inter.patch @@ -0,0 +1,41 @@ +From f8c6cebdcc6c3ac9f7230b5aa00e3a263436f649 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 6 Aug 2023 17:20:56 +0800 +Subject: serial: 8250_dw: fall back to poll if there's no interrupt + +From: Jisheng Zhang + +[ Upstream commit 22130dae0533c474e4e0db930a88caa9b397d083 ] + +When there's no irq(this can be due to various reasons, for example, +no irq from HW support, or we just want to use poll solution, and so +on), falling back to poll is still better than no support at all. + +Signed-off-by: Jisheng Zhang +Link: https://lore.kernel.org/r/20230806092056.2467-3-jszhang@kernel.org +Signed-off-by: Greg Kroah-Hartman +Stable-dep-of: 87d80bfbd577 ("serial: 8250_dw: Don't use struct dw8250_data outside of 8250_dw") +Signed-off-by: Sasha Levin +--- + drivers/tty/serial/8250/8250_dw.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c +index 88035100b86c6..a1f2259cc9a98 100644 +--- a/drivers/tty/serial/8250/8250_dw.c ++++ b/drivers/tty/serial/8250/8250_dw.c +@@ -523,7 +523,10 @@ static int dw8250_probe(struct platform_device *pdev) + if (!regs) + return dev_err_probe(dev, -EINVAL, "no registers defined\n"); + +- irq = platform_get_irq(pdev, 0); ++ irq = platform_get_irq_optional(pdev, 0); ++ /* no interrupt -> fall back to polling */ ++ if (irq == -ENXIO) ++ irq = 0; + if (irq < 0) + return irq; + +-- +2.43.0 + diff --git a/queue-6.1/serial-core-add-upio_unknown-constant-for-unknown-po.patch b/queue-6.1/serial-core-add-upio_unknown-constant-for-unknown-po.patch new file mode 100644 index 00000000000..5c8da13a5a5 --- /dev/null +++ b/queue-6.1/serial-core-add-upio_unknown-constant-for-unknown-po.patch @@ -0,0 +1,39 @@ +From e60abf4c53fa88756e92df98cfe5cba30accd0dd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 4 Mar 2024 14:27:03 +0200 +Subject: serial: core: Add UPIO_UNKNOWN constant for unknown port type + +From: Andy Shevchenko + +[ Upstream commit 79d713baf63c8f23cc58b304c40be33d64a12aaf ] + +In some APIs we would like to assign the special value to iotype +and compare against it in another places. Introduce UPIO_UNKNOWN +for this purpose. + +Note, we can't use 0, because it's a valid value for IO port access. + +Signed-off-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20240304123035.758700-3-andriy.shevchenko@linux.intel.com +Signed-off-by: Greg Kroah-Hartman +Stable-dep-of: 87d80bfbd577 ("serial: 8250_dw: Don't use struct dw8250_data outside of 8250_dw") +Signed-off-by: Sasha Levin +--- + include/linux/serial_core.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h +index 13bf20242b61a..1c9b3f27f2d36 100644 +--- a/include/linux/serial_core.h ++++ b/include/linux/serial_core.h +@@ -467,6 +467,7 @@ struct uart_port { + unsigned char iotype; /* io access style */ + unsigned char quirks; /* internal quirks */ + ++#define UPIO_UNKNOWN ((unsigned char)~0U) /* UCHAR_MAX */ + #define UPIO_PORT (SERIAL_IO_PORT) /* 8b I/O port access */ + #define UPIO_HUB6 (SERIAL_IO_HUB6) /* Hub6 ISA card */ + #define UPIO_MEM (SERIAL_IO_MEM) /* driver-specific */ +-- +2.43.0 + diff --git a/queue-6.1/series b/queue-6.1/series index 694ad8a1c04..7b7260fe7ad 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -208,3 +208,10 @@ cachefiles-erofs-fix-null-deref-in-when-cachefiles-is-not-doing-ondemand-mode.pa bluetooth-qca-fix-wcn3991-device-address-check.patch bluetooth-qca-generalise-device-address-check.patch greybus-fix-use-after-free-bug-in-gb_interface_release-due-to-race-condition.patch +serial-8250_dw-fall-back-to-poll-if-there-s-no-inter.patch +serial-core-add-upio_unknown-constant-for-unknown-po.patch +usb-storage-alauda-check-whether-the-media-is-initia.patch +misc-microchip-pci1xxxx-fix-a-memory-leak-in-the-err.patch +i2c-at91-fix-the-functionality-flags-of-the-slave-on.patch +i2c-designware-fix-the-functionality-flags-of-the-sl.patch +zap_pid_ns_processes-clear-tif_notify_signal-along-w.patch diff --git a/queue-6.1/usb-storage-alauda-check-whether-the-media-is-initia.patch b/queue-6.1/usb-storage-alauda-check-whether-the-media-is-initia.patch new file mode 100644 index 00000000000..100cdb4fadc --- /dev/null +++ b/queue-6.1/usb-storage-alauda-check-whether-the-media-is-initia.patch @@ -0,0 +1,61 @@ +From a0ee2a01d413c67e2993e753feb707afe2c906e1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 26 May 2024 09:27:45 +0800 +Subject: usb-storage: alauda: Check whether the media is initialized + +From: Shichao Lai + +[ Upstream commit 16637fea001ab3c8df528a8995b3211906165a30 ] + +The member "uzonesize" of struct alauda_info will remain 0 +if alauda_init_media() fails, potentially causing divide errors +in alauda_read_data() and alauda_write_lba(). +- Add a member "media_initialized" to struct alauda_info. +- Change a condition in alauda_check_media() to ensure the + first initialization. +- Add an error check for the return value of alauda_init_media(). + +Fixes: e80b0fade09e ("[PATCH] USB Storage: add alauda support") +Reported-by: xingwei lee +Reported-by: yue sun +Reviewed-by: Alan Stern +Signed-off-by: Shichao Lai +Link: https://lore.kernel.org/r/20240526012745.2852061-1-shichaorai@gmail.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/storage/alauda.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c +index 115f05a6201a1..40d34cc28344a 100644 +--- a/drivers/usb/storage/alauda.c ++++ b/drivers/usb/storage/alauda.c +@@ -105,6 +105,8 @@ struct alauda_info { + unsigned char sense_key; + unsigned long sense_asc; /* additional sense code */ + unsigned long sense_ascq; /* additional sense code qualifier */ ++ ++ bool media_initialized; + }; + + #define short_pack(lsb,msb) ( ((u16)(lsb)) | ( ((u16)(msb))<<8 ) ) +@@ -476,11 +478,12 @@ static int alauda_check_media(struct us_data *us) + } + + /* Check for media change */ +- if (status[0] & 0x08) { ++ if (status[0] & 0x08 || !info->media_initialized) { + usb_stor_dbg(us, "Media change detected\n"); + alauda_free_maps(&MEDIA_INFO(us)); +- alauda_init_media(us); +- ++ rc = alauda_init_media(us); ++ if (rc == USB_STOR_TRANSPORT_GOOD) ++ info->media_initialized = true; + info->sense_key = UNIT_ATTENTION; + info->sense_asc = 0x28; + info->sense_ascq = 0x00; +-- +2.43.0 + diff --git a/queue-6.1/zap_pid_ns_processes-clear-tif_notify_signal-along-w.patch b/queue-6.1/zap_pid_ns_processes-clear-tif_notify_signal-along-w.patch new file mode 100644 index 00000000000..fae37d0fb29 --- /dev/null +++ b/queue-6.1/zap_pid_ns_processes-clear-tif_notify_signal-along-w.patch @@ -0,0 +1,61 @@ +From a4826d3fba9d570646d19608de98c4452f403cae Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 8 Jun 2024 14:06:16 +0200 +Subject: zap_pid_ns_processes: clear TIF_NOTIFY_SIGNAL along with + TIF_SIGPENDING + +From: Oleg Nesterov + +[ Upstream commit 7fea700e04bd3f424c2d836e98425782f97b494e ] + +kernel_wait4() doesn't sleep and returns -EINTR if there is no +eligible child and signal_pending() is true. + +That is why zap_pid_ns_processes() clears TIF_SIGPENDING but this is not +enough, it should also clear TIF_NOTIFY_SIGNAL to make signal_pending() +return false and avoid a busy-wait loop. + +Link: https://lkml.kernel.org/r/20240608120616.GB7947@redhat.com +Fixes: 12db8b690010 ("entry: Add support for TIF_NOTIFY_SIGNAL") +Signed-off-by: Oleg Nesterov +Reported-by: Rachel Menge +Closes: https://lore.kernel.org/all/1386cd49-36d0-4a5c-85e9-bc42056a5a38@linux.microsoft.com/ +Reviewed-by: Boqun Feng +Tested-by: Wei Fu +Reviewed-by: Jens Axboe +Cc: Allen Pais +Cc: Christian Brauner +Cc: Frederic Weisbecker +Cc: Joel Fernandes (Google) +Cc: Joel Granados +Cc: Josh Triplett +Cc: Lai Jiangshan +Cc: Mateusz Guzik +Cc: Mathieu Desnoyers +Cc: Mike Christie +Cc: Neeraj Upadhyay +Cc: Paul E. McKenney +Cc: Steven Rostedt (Google) +Cc: Zqiang +Cc: Thomas Gleixner +Signed-off-by: Andrew Morton +Signed-off-by: Sasha Levin +--- + kernel/pid_namespace.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c +index fc21c5d5fd5de..1daadbefcee3a 100644 +--- a/kernel/pid_namespace.c ++++ b/kernel/pid_namespace.c +@@ -214,6 +214,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) + */ + do { + clear_thread_flag(TIF_SIGPENDING); ++ clear_thread_flag(TIF_NOTIFY_SIGNAL); + rc = kernel_wait4(-1, NULL, __WALL, NULL); + } while (rc != -ECHILD); + +-- +2.43.0 +