From: Greg Kroah-Hartman Date: Tue, 4 Feb 2025 14:08:03 +0000 (+0100) Subject: 5.4-stable patches X-Git-Tag: v6.6.76~42 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=285d93907a73f293e15af22661c024bf4c11bfe1;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: drivers-card_reader-rtsx_usb-restore-interrupt-based-detection.patch ktest.pl-check-kernelrelease-return-in-get_version.patch usb-typec-tcpm-set-src_send_capabilities-timeout-to-pd_t_sender_response.patch --- diff --git a/queue-5.4/drivers-card_reader-rtsx_usb-restore-interrupt-based-detection.patch b/queue-5.4/drivers-card_reader-rtsx_usb-restore-interrupt-based-detection.patch new file mode 100644 index 0000000000..d3d02a870a --- /dev/null +++ b/queue-5.4/drivers-card_reader-rtsx_usb-restore-interrupt-based-detection.patch @@ -0,0 +1,59 @@ +From 235b630eda072d7e7b102ab346d6b8a2c028a772 Mon Sep 17 00:00:00 2001 +From: Sean Rhodes +Date: Tue, 19 Nov 2024 08:58:15 +0000 +Subject: drivers/card_reader/rtsx_usb: Restore interrupt based detection + +From: Sean Rhodes + +commit 235b630eda072d7e7b102ab346d6b8a2c028a772 upstream. + +This commit reintroduces interrupt-based card detection previously +used in the rts5139 driver. This functionality was removed in commit +00d8521dcd23 ("staging: remove rts5139 driver code"). + +Reintroducing this mechanism fixes presence detection for certain card +readers, which with the current driver, will taken approximately 20 +seconds to enter S3 as `mmc_rescan` has to be frozen. + +Fixes: 00d8521dcd23 ("staging: remove rts5139 driver code") +Cc: stable@vger.kernel.org +Cc: Arnd Bergmann +Cc: Greg Kroah-Hartman +Signed-off-by: Sean Rhodes +Link: https://lore.kernel.org/r/20241119085815.11769-1-sean@starlabs.systems +Signed-off-by: Greg Kroah-Hartman +--- + drivers/misc/cardreader/rtsx_usb.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +--- a/drivers/misc/cardreader/rtsx_usb.c ++++ b/drivers/misc/cardreader/rtsx_usb.c +@@ -286,6 +286,7 @@ static int rtsx_usb_get_status_with_bulk + int rtsx_usb_get_card_status(struct rtsx_ucr *ucr, u16 *status) + { + int ret; ++ u8 interrupt_val = 0; + u16 *buf; + + if (!status) +@@ -308,6 +309,20 @@ int rtsx_usb_get_card_status(struct rtsx + ret = rtsx_usb_get_status_with_bulk(ucr, status); + } + ++ rtsx_usb_read_register(ucr, CARD_INT_PEND, &interrupt_val); ++ /* Cross check presence with interrupts */ ++ if (*status & XD_CD) ++ if (!(interrupt_val & XD_INT)) ++ *status &= ~XD_CD; ++ ++ if (*status & SD_CD) ++ if (!(interrupt_val & SD_INT)) ++ *status &= ~SD_CD; ++ ++ if (*status & MS_CD) ++ if (!(interrupt_val & MS_INT)) ++ *status &= ~MS_CD; ++ + /* usb_control_msg may return positive when success */ + if (ret < 0) + return ret; diff --git a/queue-5.4/ktest.pl-check-kernelrelease-return-in-get_version.patch b/queue-5.4/ktest.pl-check-kernelrelease-return-in-get_version.patch new file mode 100644 index 0000000000..890a7cc52e --- /dev/null +++ b/queue-5.4/ktest.pl-check-kernelrelease-return-in-get_version.patch @@ -0,0 +1,40 @@ +From a4e17a8f239a545c463f8ec27db4ed6e74b31841 Mon Sep 17 00:00:00 2001 +From: "Ricardo B. Marliere" +Date: Thu, 5 Dec 2024 17:50:35 -0300 +Subject: ktest.pl: Check kernelrelease return in get_version + +From: Ricardo B. Marliere + +commit a4e17a8f239a545c463f8ec27db4ed6e74b31841 upstream. + +In the case of a test that uses the special option ${KERNEL_VERSION} in one +of its settings but has no configuration available in ${OUTPUT_DIR}, for +example if it's a new empty directory, then the `make kernelrelease` call +will fail and the subroutine will chomp an empty string, silently. Fix that +by adding an empty configuration and retrying. + +Cc: stable@vger.kernel.org +Cc: John Hawley +Fixes: 5f9b6ced04a4e ("ktest: Bisecting, install modules, add logging") +Link: https://lore.kernel.org/20241205-ktest_kver_fallback-v2-1-869dae4c7777@suse.com +Signed-off-by: Ricardo B. Marliere +Signed-off-by: Steven Rostedt +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/ktest/ktest.pl | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/tools/testing/ktest/ktest.pl ++++ b/tools/testing/ktest/ktest.pl +@@ -2319,6 +2319,11 @@ sub get_version { + return if ($have_version); + doprint "$make kernelrelease ... "; + $version = `$make -s kernelrelease | tail -1`; ++ if (!length($version)) { ++ run_command "$make allnoconfig" or return 0; ++ doprint "$make kernelrelease ... "; ++ $version = `$make -s kernelrelease | tail -1`; ++ } + chomp($version); + doprint "$version\n"; + $have_version = 1; diff --git a/queue-5.4/series b/queue-5.4/series index 1fe630bb95..4a75862041 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -70,3 +70,6 @@ genksyms-fix-memory-leak-when-the-same-symbol-is-rea.patch hexagon-fix-using-plain-integer-as-null-pointer-warn.patch hexagon-fix-unbalanced-spinlock-in-die.patch nfsd-reset-cb_seq_status-after-nfs4err_delay.patch +ktest.pl-check-kernelrelease-return-in-get_version.patch +drivers-card_reader-rtsx_usb-restore-interrupt-based-detection.patch +usb-typec-tcpm-set-src_send_capabilities-timeout-to-pd_t_sender_response.patch diff --git a/queue-5.4/usb-typec-tcpm-set-src_send_capabilities-timeout-to-pd_t_sender_response.patch b/queue-5.4/usb-typec-tcpm-set-src_send_capabilities-timeout-to-pd_t_sender_response.patch new file mode 100644 index 0000000000..b3fda30c9d --- /dev/null +++ b/queue-5.4/usb-typec-tcpm-set-src_send_capabilities-timeout-to-pd_t_sender_response.patch @@ -0,0 +1,36 @@ +From 2eb3da037c2c20fa30bc502bc092479b2a1aaae2 Mon Sep 17 00:00:00 2001 +From: Jos Wang +Date: Sun, 5 Jan 2025 21:52:45 +0800 +Subject: usb: typec: tcpm: set SRC_SEND_CAPABILITIES timeout to PD_T_SENDER_RESPONSE + +From: Jos Wang + +commit 2eb3da037c2c20fa30bc502bc092479b2a1aaae2 upstream. + +As PD2.0 spec ("8.3.3.2.3 PE_SRC_Send_Capabilities state"), after the +Source receives the GoodCRC Message from the Sink in response to the +Source_Capabilities message, it should start the SenderResponseTimer, +after the timer times out, the state machine transitions to the +HARD_RESET state. + +Fixes: f0690a25a140 ("staging: typec: USB Type-C Port Manager (tcpm)") +Cc: stable@vger.kernel.org +Signed-off-by: Jos Wang +Reviewed-by: Badhri Jagan Sridharan +Link: https://lore.kernel.org/r/20250105135245.7493-1-joswang1221@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/typec/tcpm/tcpm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/typec/tcpm/tcpm.c ++++ b/drivers/usb/typec/tcpm/tcpm.c +@@ -3035,7 +3035,7 @@ static void run_state_machine(struct tcp + port->caps_count = 0; + port->pd_capable = true; + tcpm_set_state_cond(port, SRC_SEND_CAPABILITIES_TIMEOUT, +- PD_T_SEND_SOURCE_CAP); ++ PD_T_SENDER_RESPONSE); + } + break; + case SRC_SEND_CAPABILITIES_TIMEOUT: