From: Sasha Levin Date: Wed, 19 Jun 2024 12:25:05 +0000 (-0400) Subject: Fixes for 5.15 X-Git-Tag: v6.1.95~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6898669fb7d41a8934a489b4fb265b904eeceb8c;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.15 Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/i2c-at91-fix-the-functionality-flags-of-the-slave-on.patch b/queue-5.15/i2c-at91-fix-the-functionality-flags-of-the-slave-on.patch new file mode 100644 index 00000000000..e7e0e717a20 --- /dev/null +++ b/queue-5.15/i2c-at91-fix-the-functionality-flags-of-the-slave-on.patch @@ -0,0 +1,44 @@ +From 5971cd217063cc9021e9fad36f942afef9a68b7d 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-5.15/i2c-designware-fix-the-functionality-flags-of-the-sl.patch b/queue-5.15/i2c-designware-fix-the-functionality-flags-of-the-sl.patch new file mode 100644 index 00000000000..2edf93e79b9 --- /dev/null +++ b/queue-5.15/i2c-designware-fix-the-functionality-flags-of-the-sl.patch @@ -0,0 +1,46 @@ +From 7968142dde99c1f457dc57985b84f103af4e7929 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-5.15/series b/queue-5.15/series index c234ac29e0c..d173b7a1d74 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -168,3 +168,7 @@ mptcp-pm-update-add_addr-counters-after-connect.patch kbuild-remove-support-for-clang-s-thinlto-caching.patch remoteproc-k3-r5-jump-to-error-handling-labels-in-start-stop-errors.patch greybus-fix-use-after-free-bug-in-gb_interface_release-due-to-race-condition.patch +usb-storage-alauda-check-whether-the-media-is-initia.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-5.15/usb-storage-alauda-check-whether-the-media-is-initia.patch b/queue-5.15/usb-storage-alauda-check-whether-the-media-is-initia.patch new file mode 100644 index 00000000000..6fabf915bfd --- /dev/null +++ b/queue-5.15/usb-storage-alauda-check-whether-the-media-is-initia.patch @@ -0,0 +1,61 @@ +From 0604f2e8d61ad12abed78d39431ed24ec2552adb 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 dcc4778d1ae99..17fe35083f048 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-5.15/zap_pid_ns_processes-clear-tif_notify_signal-along-w.patch b/queue-5.15/zap_pid_ns_processes-clear-tif_notify_signal-along-w.patch new file mode 100644 index 00000000000..71523157b3d --- /dev/null +++ b/queue-5.15/zap_pid_ns_processes-clear-tif_notify_signal-along-w.patch @@ -0,0 +1,61 @@ +From e766c8b694608646befb7527cfd7a4ebc9ebc117 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 259fc4ca0d9cc..40b011f880675 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 +