From: Greg Kroah-Hartman Date: Tue, 28 Mar 2023 11:47:47 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v5.15.105~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6de1aeba86d42c7dece5d245732f28e6c6b3fc03;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: scsi-core-add-blist_skip_vpd_pages-for-skhynix-h28u74301amr.patch usb-gadget-u_audio-don-t-let-userspace-block-driver-unbind.patch --- diff --git a/queue-4.14/scsi-core-add-blist_skip_vpd_pages-for-skhynix-h28u74301amr.patch b/queue-4.14/scsi-core-add-blist_skip_vpd_pages-for-skhynix-h28u74301amr.patch new file mode 100644 index 00000000000..bc657f76fd5 --- /dev/null +++ b/queue-4.14/scsi-core-add-blist_skip_vpd_pages-for-skhynix-h28u74301amr.patch @@ -0,0 +1,37 @@ +From a204b490595de71016b2360a1886ec8c12d0afac Mon Sep 17 00:00:00 2001 +From: Joel Selvaraj +Date: Sun, 12 Mar 2023 23:14:02 -0500 +Subject: scsi: core: Add BLIST_SKIP_VPD_PAGES for SKhynix H28U74301AMR + +From: Joel Selvaraj + +commit a204b490595de71016b2360a1886ec8c12d0afac upstream. + +Xiaomi Poco F1 (qcom/sdm845-xiaomi-beryllium*.dts) comes with a SKhynix +H28U74301AMR UFS. The sd_read_cpr() operation leads to a 120 second +timeout, making the device bootup very slow: + +[ 121.457736] sd 0:0:0:1: [sdb] tag#23 timing out command, waited 120s + +Setting the BLIST_SKIP_VPD_PAGES allows the device to skip the failing +sd_read_cpr operation and boot normally. + +Signed-off-by: Joel Selvaraj +Link: https://lore.kernel.org/r/20230313041402.39330-1-joelselvaraj.oss@gmail.com +Cc: stable@vger.kernel.org +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/scsi_devinfo.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/scsi/scsi_devinfo.c ++++ b/drivers/scsi/scsi_devinfo.c +@@ -241,6 +241,7 @@ static struct { + {"SGI", "RAID5", "*", BLIST_SPARSELUN}, + {"SGI", "TP9100", "*", BLIST_REPORTLUN2}, + {"SGI", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, ++ {"SKhynix", "H28U74301AMR", NULL, BLIST_SKIP_VPD_PAGES}, + {"IBM", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, + {"SUN", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, + {"DELL", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, diff --git a/queue-4.14/series b/queue-4.14/series index 239406e482e..c71f6889491 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -28,3 +28,5 @@ scsi-ufs-core-add-soft-dependency-on-governor_simple.patch net-usb-cdc_mbim-avoid-altsetting-toggling-for-telit.patch net-usb-qmi_wwan-add-telit-0x1080-composition.patch sh-sanitize-the-flags-on-sigreturn.patch +scsi-core-add-blist_skip_vpd_pages-for-skhynix-h28u74301amr.patch +usb-gadget-u_audio-don-t-let-userspace-block-driver-unbind.patch diff --git a/queue-4.14/sh-sanitize-the-flags-on-sigreturn.patch b/queue-4.14/sh-sanitize-the-flags-on-sigreturn.patch index 8a5621c182b..34049c452b3 100644 --- a/queue-4.14/sh-sanitize-the-flags-on-sigreturn.patch +++ b/queue-4.14/sh-sanitize-the-flags-on-sigreturn.patch @@ -16,12 +16,10 @@ Cc: Rich Felker Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- - arch/sh/include/asm/processor_32.h | 1 + - arch/sh/kernel/signal_32.c | 3 +++ + arch/sh/include/asm/processor_32.h | 1 + + arch/sh/kernel/signal_32.c | 3 +++ 2 files changed, 4 insertions(+) -diff --git a/arch/sh/include/asm/processor_32.h b/arch/sh/include/asm/processor_32.h -index 95100d8a0b7b4..fc94603724b86 100644 --- a/arch/sh/include/asm/processor_32.h +++ b/arch/sh/include/asm/processor_32.h @@ -57,6 +57,7 @@ @@ -32,8 +30,6 @@ index 95100d8a0b7b4..fc94603724b86 100644 /* * DSP structure and data */ -diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c -index c46c0020ff55e..ce93ae78c3002 100644 --- a/arch/sh/kernel/signal_32.c +++ b/arch/sh/kernel/signal_32.c @@ -116,6 +116,7 @@ static int @@ -44,7 +40,7 @@ index c46c0020ff55e..ce93ae78c3002 100644 #define COPY(x) err |= __get_user(regs->x, &sc->sc_##x) COPY(regs[1]); -@@ -131,6 +132,8 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *r0_p +@@ -131,6 +132,8 @@ restore_sigcontext(struct pt_regs *regs, COPY(sr); COPY(pc); #undef COPY @@ -53,6 +49,3 @@ index c46c0020ff55e..ce93ae78c3002 100644 #ifdef CONFIG_SH_FPU if (boot_cpu_data.flags & CPU_HAS_FPU) { int owned_fp; --- -2.39.2 - diff --git a/queue-4.14/usb-gadget-u_audio-don-t-let-userspace-block-driver-unbind.patch b/queue-4.14/usb-gadget-u_audio-don-t-let-userspace-block-driver-unbind.patch new file mode 100644 index 00000000000..7af398ab8d6 --- /dev/null +++ b/queue-4.14/usb-gadget-u_audio-don-t-let-userspace-block-driver-unbind.patch @@ -0,0 +1,72 @@ +From 6c67ed9ad9b83e453e808f9b31a931a20a25629b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Alvin=20=C5=A0ipraga?= +Date: Thu, 2 Mar 2023 17:36:47 +0100 +Subject: usb: gadget: u_audio: don't let userspace block driver unbind +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Alvin Å ipraga + +commit 6c67ed9ad9b83e453e808f9b31a931a20a25629b upstream. + +In the unbind callback for f_uac1 and f_uac2, a call to snd_card_free() +via g_audio_cleanup() will disconnect the card and then wait for all +resources to be released, which happens when the refcount falls to zero. +Since userspace can keep the refcount incremented by not closing the +relevant file descriptor, the call to unbind may block indefinitely. +This can cause a deadlock during reboot, as evidenced by the following +blocked task observed on my machine: + + task:reboot state:D stack:0 pid:2827 ppid:569 flags:0x0000000c + Call trace: + __switch_to+0xc8/0x140 + __schedule+0x2f0/0x7c0 + schedule+0x60/0xd0 + schedule_timeout+0x180/0x1d4 + wait_for_completion+0x78/0x180 + snd_card_free+0x90/0xa0 + g_audio_cleanup+0x2c/0x64 + afunc_unbind+0x28/0x60 + ... + kernel_restart+0x4c/0xac + __do_sys_reboot+0xcc/0x1ec + __arm64_sys_reboot+0x28/0x30 + invoke_syscall+0x4c/0x110 + ... + +The issue can also be observed by opening the card with arecord and +then stopping the process through the shell before unbinding: + + # arecord -D hw:UAC2Gadget -f S32_LE -c 2 -r 48000 /dev/null + Recording WAVE '/dev/null' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo + ^Z[1]+ Stopped arecord -D hw:UAC2Gadget -f S32_LE -c 2 -r 48000 /dev/null + # echo gadget.0 > /sys/bus/gadget/drivers/configfs-gadget/unbind + (observe that the unbind command never finishes) + +Fix the problem by using snd_card_free_when_closed() instead, which will +still disconnect the card as desired, but defer the task of freeing the +resources to the core once userspace closes its file descriptor. + +Fixes: 132fcb460839 ("usb: gadget: Add Audio Class 2.0 Driver") +Cc: stable@vger.kernel.org +Signed-off-by: Alvin Å ipraga +Reviewed-by: Ruslan Bilovol +Reviewed-by: John Keeping +Link: https://lore.kernel.org/r/20230302163648.3349669-1-alvin@pqrs.dk +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/gadget/function/u_audio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/gadget/function/u_audio.c ++++ b/drivers/usb/gadget/function/u_audio.c +@@ -635,7 +635,7 @@ void g_audio_cleanup(struct g_audio *g_a + uac = g_audio->uac; + card = uac->card; + if (card) +- snd_card_free(card); ++ snd_card_free_when_closed(card); + + kfree(uac->p_prm.ureq); + kfree(uac->c_prm.ureq);