From 7ce0f85e97b73febe68dfa8dce03c6291e92a45c Mon Sep 17 00:00:00 2001 From: Thinh Nguyen Date: Mon, 7 Nov 2022 18:45:44 -0800 Subject: [PATCH 1/3] UPSTREAM: usb: dwc3: gadget: Return -ESHUTDOWN on ep disable The usb_request API clearly noted that removed requests due to disabled endpoint should have -ESHUTDOWN status returned. Don't change this behavior. Fixes: b44c0e7fef51 ("usb: dwc3: gadget: conditionally remove requests") Cc: stable@vger.kernel.org Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/3421859485cb32d77e2068549679a6c07a7797bc.1667875427.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit ffb9da4a04c69567bad717707b6fdfbc4c216ef4) Bug: 290141348 Bug: 290331654 Bug: 290628560 Change-Id: I92e7910e3957fb7e77bf6a1b1c121ce143f1c1c6 Signed-off-by: Udipto Goswami Signed-off-by: Mukesh Ojha Signed-off-by: Siva sri Kumar Vanka --- drivers/usb/dwc3/gadget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 4e1cb058ee14..085b995bcd2f 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -1042,7 +1042,7 @@ static int __dwc3_gadget_ep_disable(struct dwc3_ep *dep) reg &= ~DWC3_DALEPENA_EP(dep->number); dwc3_writel(dwc->regs, DWC3_DALEPENA, reg); - dwc3_remove_requests(dwc, dep, -ECONNRESET); + dwc3_remove_requests(dwc, dep, -ESHUTDOWN); dep->stream_capable = false; dep->type = 0; From d76043947c92ab9dd503b494e731832ba97e5952 Mon Sep 17 00:00:00 2001 From: Venkata Rao Kakani Date: Tue, 20 Jun 2023 11:13:36 +0530 Subject: [PATCH 2/3] ANDROID: ABI: Add to QCOM symbols list Symbols updated to QCOM abi symbol list: genphy_c45_read_status Bug: 280924669 Bug: 288027217 Bug: 288060701 Bug: 290628560 Change-Id: I13fd178c2c36a949bf01108b85c4433f6b38d8cf Signed-off-by: Venkata Rao Kakani (cherry picked from commit 4a4cc7be63416ccc87b0132e0484acf12118d3a2) --- android/abi_gki_aarch64.xml | 8 ++++++-- android/abi_gki_aarch64_qcom | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/android/abi_gki_aarch64.xml b/android/abi_gki_aarch64.xml index 6cba7d10f082..5f12102c0506 100644 --- a/android/abi_gki_aarch64.xml +++ b/android/abi_gki_aarch64.xml @@ -2932,6 +2932,7 @@ + @@ -51703,7 +51704,7 @@ - + @@ -142646,6 +142647,10 @@ + + + + @@ -163078,7 +163083,6 @@ - diff --git a/android/abi_gki_aarch64_qcom b/android/abi_gki_aarch64_qcom index 9ec68d428e57..37cca0209d6b 100644 --- a/android/abi_gki_aarch64_qcom +++ b/android/abi_gki_aarch64_qcom @@ -780,6 +780,7 @@ geni_se_tx_dma_unprep genphy_check_and_restart_aneg __genphy_config_aneg + genphy_c45_read_status genphy_read_abilities genphy_read_lpa genphy_read_mmd_unsupported From a0fe19aaccc9927dd91df4b555dc797ce299e6d6 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Wed, 8 Mar 2023 20:40:43 +0000 Subject: [PATCH 3/3] FROMGIT: pstore: Revert pmsg_lock back to a normal mutex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 76d62f24db07f22ccf9bc18ca793c27d4ebef721. So while priority inversion on the pmsg_lock is an occasional problem that an rt_mutex would help with, in uses where logging is writing to pmsg heavily from multiple threads, the pmsg_lock can be heavily contended. After this change landed, it was reported that cases where the mutex locking overhead was commonly adding on the order of 10s of usecs delay had suddenly jumped to ~msec delay with rtmutex. It seems the slight differences in the locks under this level of contention causes the normal mutexes to utilize the spinning optimizations, while the rtmutexes end up in the sleeping slowpath (which allows additional threads to pile on trying to take the lock). In this case, it devolves to a worse case senerio where the lock acquisition and scheduling overhead dominates, and each thread is waiting on the order of ~ms to do ~us of work. Obviously, having tons of threads all contending on a single lock for logging is non-optimal, so the proper fix is probably reworking pstore pmsg to have per-cpu buffers so we don't have contention. Additionally, Steven Rostedt has provided some furhter optimizations for rtmutexes that improves the rtmutex spinning path, but at least in my testing, I still see the test tripping into the sleeping path on rtmutexes while utilizing the spinning path with mutexes. But in the short term, lets revert the change to the rt_mutex and go back to normal mutexes to avoid a potentially major performance regression. And we can work on optimizations to both rtmutexes and finer-grained locking for pstore pmsg in the future. Cc: Wei Wang Cc: Midas Chien Cc: "Chunhui Li (李春辉)" Cc: Steven Rostedt Cc: Kees Cook Cc: Anton Vorontsov Cc: "Guilherme G. Piccoli" Cc: Tony Luck Cc: kernel-team@android.com Fixes: 76d62f24db07 ("pstore: Switch pmsg_lock to an rt_mutex to avoid priority inversion") Reported-by: "Chunhui Li (李春辉)" Signed-off-by: John Stultz Signed-off-by: Kees Cook Link: https://lore.kernel.org/r/20230308204043.2061631-1-jstultz@google.com Bug: 271041816 Bug: 272453930 Bug: 290899184 Bug: 290908562 Bug: 290920906 (cherry picked from commit 5239a89b06d6b199f133bf0ffea421683187f257 https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/pstore ) Change-Id: Iadf30bcbf5ba3895dd4af8c15c3a8aecf4301acb Signed-off-by: John Stultz (cherry picked from commit 3ff04317e4e3a49923f6aec6e0e42c64458ed672) (cherry picked from commit c27abae93823d1ccb275c59db63e4ead9f1d8420) Signed-off-by: Mukesh Ojha --- fs/pstore/pmsg.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/pstore/pmsg.c b/fs/pstore/pmsg.c index 18cf94b597e0..d8542ec2f38c 100644 --- a/fs/pstore/pmsg.c +++ b/fs/pstore/pmsg.c @@ -7,10 +7,9 @@ #include #include #include -#include #include "internal.h" -static DEFINE_RT_MUTEX(pmsg_lock); +static DEFINE_MUTEX(pmsg_lock); static ssize_t write_pmsg(struct file *file, const char __user *buf, size_t count, loff_t *ppos) @@ -29,9 +28,9 @@ static ssize_t write_pmsg(struct file *file, const char __user *buf, if (!access_ok(buf, count)) return -EFAULT; - rt_mutex_lock(&pmsg_lock); + mutex_lock(&pmsg_lock); ret = psinfo->write_user(&record, buf); - rt_mutex_unlock(&pmsg_lock); + mutex_unlock(&pmsg_lock); return ret ? ret : count; }