From: Sasha Levin Date: Thu, 7 Sep 2023 00:08:05 +0000 (-0400) Subject: Fixes for 5.15 X-Git-Tag: v6.1.53~158 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3c2c70872e375c30f2ff881452ed49877d379fef;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.15 Signed-off-by: Sasha Levin --- diff --git a/queue-5.15/9p-virtio-make-sure-offs-is-initialized-in-zc_reques.patch b/queue-5.15/9p-virtio-make-sure-offs-is-initialized-in-zc_reques.patch new file mode 100644 index 00000000000..8fe62b77c0a --- /dev/null +++ b/queue-5.15/9p-virtio-make-sure-offs-is-initialized-in-zc_reques.patch @@ -0,0 +1,43 @@ +From 7acdbf4f8935ab7cb1821baf33b5f784d04fa2d8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 3 May 2023 16:49:27 +0900 +Subject: 9p: virtio: make sure 'offs' is initialized in zc_request + +From: Dominique Martinet + +[ Upstream commit 4a73edab69d3a6623f03817fe950a2d9585f80e4 ] + +Similarly to the previous patch: offs can be used in handle_rerrors +without initializing on small payloads; in this case handle_rerrors will +not use it because of the size check, but it doesn't hurt to make sure +it is zero to please scan-build. + +This fixes the following warning: +net/9p/trans_virtio.c:539:3: warning: 3rd function call argument is an uninitialized value [core.CallAndMessage] + handle_rerror(req, in_hdr_len, offs, in_pages); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Reviewed-by: Simon Horman +Signed-off-by: Dominique Martinet +Signed-off-by: Eric Van Hensbergen +Signed-off-by: Sasha Levin +--- + net/9p/trans_virtio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c +index d110df3cb4e1d..96eecc2dcaa36 100644 +--- a/net/9p/trans_virtio.c ++++ b/net/9p/trans_virtio.c +@@ -399,7 +399,7 @@ p9_virtio_zc_request(struct p9_client *client, struct p9_req_t *req, + struct page **in_pages = NULL, **out_pages = NULL; + struct virtio_chan *chan = client->trans; + struct scatterlist *sgs[4]; +- size_t offs; ++ size_t offs = 0; + int need_drop = 0; + int kicked = 0; + +-- +2.40.1 + diff --git a/queue-5.15/alsa-seq-oss-fix-racy-open-close-of-midi-devices.patch b/queue-5.15/alsa-seq-oss-fix-racy-open-close-of-midi-devices.patch new file mode 100644 index 00000000000..bfaaba79d40 --- /dev/null +++ b/queue-5.15/alsa-seq-oss-fix-racy-open-close-of-midi-devices.patch @@ -0,0 +1,129 @@ +From 4e7f295ac6b582e10b8c546a3e8c830231866974 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 12 Jun 2023 14:55:33 +0200 +Subject: ALSA: seq: oss: Fix racy open/close of MIDI devices + +From: Takashi Iwai + +[ Upstream commit 297224fc0922e7385573a30c29ffdabb67f27b7d ] + +Although snd_seq_oss_midi_open() and snd_seq_oss_midi_close() can be +called concurrently from different code paths, we have no proper data +protection against races. Introduce open_mutex to each seq_oss_midi +object for avoiding the races. + +Reported-by: "Gong, Sishuai" +Closes: https://lore.kernel.org/r/7DC9AF71-F481-4ABA-955F-76C535661E33@purdue.edu +Link: https://lore.kernel.org/r/20230612125533.27461-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/core/seq/oss/seq_oss_midi.c | 35 +++++++++++++++++++------------ + 1 file changed, 22 insertions(+), 13 deletions(-) + +diff --git a/sound/core/seq/oss/seq_oss_midi.c b/sound/core/seq/oss/seq_oss_midi.c +index 07efb38f58ac1..f2940b29595f0 100644 +--- a/sound/core/seq/oss/seq_oss_midi.c ++++ b/sound/core/seq/oss/seq_oss_midi.c +@@ -37,6 +37,7 @@ struct seq_oss_midi { + struct snd_midi_event *coder; /* MIDI event coder */ + struct seq_oss_devinfo *devinfo; /* assigned OSSseq device */ + snd_use_lock_t use_lock; ++ struct mutex open_mutex; + }; + + +@@ -172,6 +173,7 @@ snd_seq_oss_midi_check_new_port(struct snd_seq_port_info *pinfo) + mdev->flags = pinfo->capability; + mdev->opened = 0; + snd_use_lock_init(&mdev->use_lock); ++ mutex_init(&mdev->open_mutex); + + /* copy and truncate the name of synth device */ + strscpy(mdev->name, pinfo->name, sizeof(mdev->name)); +@@ -322,15 +324,17 @@ snd_seq_oss_midi_open(struct seq_oss_devinfo *dp, int dev, int fmode) + int perm; + struct seq_oss_midi *mdev; + struct snd_seq_port_subscribe subs; ++ int err; + + mdev = get_mididev(dp, dev); + if (!mdev) + return -ENODEV; + ++ mutex_lock(&mdev->open_mutex); + /* already used? */ + if (mdev->opened && mdev->devinfo != dp) { +- snd_use_lock_free(&mdev->use_lock); +- return -EBUSY; ++ err = -EBUSY; ++ goto unlock; + } + + perm = 0; +@@ -340,14 +344,14 @@ snd_seq_oss_midi_open(struct seq_oss_devinfo *dp, int dev, int fmode) + perm |= PERM_READ; + perm &= mdev->flags; + if (perm == 0) { +- snd_use_lock_free(&mdev->use_lock); +- return -ENXIO; ++ err = -ENXIO; ++ goto unlock; + } + + /* already opened? */ + if ((mdev->opened & perm) == perm) { +- snd_use_lock_free(&mdev->use_lock); +- return 0; ++ err = 0; ++ goto unlock; + } + + perm &= ~mdev->opened; +@@ -372,13 +376,17 @@ snd_seq_oss_midi_open(struct seq_oss_devinfo *dp, int dev, int fmode) + } + + if (! mdev->opened) { +- snd_use_lock_free(&mdev->use_lock); +- return -ENXIO; ++ err = -ENXIO; ++ goto unlock; + } + + mdev->devinfo = dp; ++ err = 0; ++ ++ unlock: ++ mutex_unlock(&mdev->open_mutex); + snd_use_lock_free(&mdev->use_lock); +- return 0; ++ return err; + } + + /* +@@ -393,10 +401,9 @@ snd_seq_oss_midi_close(struct seq_oss_devinfo *dp, int dev) + mdev = get_mididev(dp, dev); + if (!mdev) + return -ENODEV; +- if (! mdev->opened || mdev->devinfo != dp) { +- snd_use_lock_free(&mdev->use_lock); +- return 0; +- } ++ mutex_lock(&mdev->open_mutex); ++ if (!mdev->opened || mdev->devinfo != dp) ++ goto unlock; + + memset(&subs, 0, sizeof(subs)); + if (mdev->opened & PERM_WRITE) { +@@ -415,6 +422,8 @@ snd_seq_oss_midi_close(struct seq_oss_devinfo *dp, int dev) + mdev->opened = 0; + mdev->devinfo = NULL; + ++ unlock: ++ mutex_unlock(&mdev->open_mutex); + snd_use_lock_free(&mdev->use_lock); + return 0; + } +-- +2.40.1 + diff --git a/queue-5.15/alsa-usb-audio-add-quirk-for-microsoft-modern-wirele.patch b/queue-5.15/alsa-usb-audio-add-quirk-for-microsoft-modern-wirele.patch new file mode 100644 index 00000000000..5e3650dfedf --- /dev/null +++ b/queue-5.15/alsa-usb-audio-add-quirk-for-microsoft-modern-wirele.patch @@ -0,0 +1,85 @@ +From 65e2bff9d27f9b67c68fc350a87f817652fa557a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 25 Jul 2023 11:20:57 +0200 +Subject: ALSA: usb-audio: Add quirk for Microsoft Modern Wireless Headset + +From: Takashi Iwai + +[ Upstream commit 3da435063777f8d861ba5a165344e3f75f839357 ] + +Microsoft Modern Wireless Headset (appearing on the host as "Microsoft +USB Link") has a playback and a capture mixer volume/switch, but they +are fairly broken. The descriptor reports wrong dB ranges for +playback, and the capture volume/switch don't influence on the actual +recording at all. Moreover, there seem instabilities in the +connection, and at best, we should disable the runtime PM. + +So this ended up with a quirk entry for: +- Correct the playback dB range; + I picked up some reasonable values but it's a guess work +- Disable the capture mixer; + it's completely useless and confuses PA/PW +- Suppress get-sample-rate, apply the delay for message handling, + and suppress the auto-suspend + +The behavior of the wheel control on the headset is somehow flaky, +too, but it's an issue of HID. + +Link: https://bugzilla.suse.com/show_bug.cgi?id=1207129 +Link: https://lore.kernel.org/r/20230725092057.15115-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/usb/mixer_maps.c | 14 ++++++++++++++ + sound/usb/quirks.c | 3 +++ + 2 files changed, 17 insertions(+) + +diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c +index 3f8f6056ff6a5..8e0915f02b26f 100644 +--- a/sound/usb/mixer_maps.c ++++ b/sound/usb/mixer_maps.c +@@ -366,6 +366,15 @@ static const struct usbmix_name_map corsair_virtuoso_map[] = { + { 0 } + }; + ++/* Microsoft USB Link headset */ ++/* a guess work: raw playback volume values are from 2 to 129 */ ++static const struct usbmix_dB_map ms_usb_link_dB = { -3225, 0, true }; ++static const struct usbmix_name_map ms_usb_link_map[] = { ++ { 9, NULL, .dB = &ms_usb_link_dB }, ++ { 10, NULL }, /* Headset Capture volume; seems non-working, disabled */ ++ { 0 } /* terminator */ ++}; ++ + /* ASUS ROG Zenith II with Realtek ALC1220-VB */ + static const struct usbmix_name_map asus_zenith_ii_map[] = { + { 19, NULL, 12 }, /* FU, Input Gain Pad - broken response, disabled */ +@@ -625,6 +634,11 @@ static const struct usbmix_ctl_map usbmix_ctl_maps[] = { + .id = USB_ID(0x1395, 0x0025), + .map = sennheiser_pc8_map, + }, ++ { ++ /* Microsoft USB Link headset */ ++ .id = USB_ID(0x045e, 0x083c), ++ .map = ms_usb_link_map, ++ }, + { 0 } /* terminator */ + }; + +diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c +index 8de572e774ddc..e5eab3b84b3f7 100644 +--- a/sound/usb/quirks.c ++++ b/sound/usb/quirks.c +@@ -1747,6 +1747,9 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = { + QUIRK_FLAG_IGNORE_CTL_ERROR), + DEVICE_FLG(0x041e, 0x4080, /* Creative Live Cam VF0610 */ + QUIRK_FLAG_GET_SAMPLE_RATE), ++ DEVICE_FLG(0x045e, 0x083c, /* MS USB Link headset */ ++ QUIRK_FLAG_GET_SAMPLE_RATE | QUIRK_FLAG_CTL_MSG_DELAY | ++ QUIRK_FLAG_DISABLE_AUTOSUSPEND), + DEVICE_FLG(0x046d, 0x084c, /* Logitech ConferenceCam Connect */ + QUIRK_FLAG_GET_SAMPLE_RATE | QUIRK_FLAG_CTL_MSG_DELAY_1M), + DEVICE_FLG(0x046d, 0x0991, /* Logitech QuickCam Pro */ +-- +2.40.1 + diff --git a/queue-5.15/arm-dts-imx-adjust-dma-apbh-node-name.patch b/queue-5.15/arm-dts-imx-adjust-dma-apbh-node-name.patch new file mode 100644 index 00000000000..42bee3bd34c --- /dev/null +++ b/queue-5.15/arm-dts-imx-adjust-dma-apbh-node-name.patch @@ -0,0 +1,109 @@ +From f5100f863ed14526639bdb7e012b0d1699daad20 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 14 Apr 2023 11:19:46 +0200 +Subject: ARM: dts: imx: Adjust dma-apbh node name + +From: Stefan Wahren + +[ Upstream commit e9f5cd85f1f931bb7b64031492f7051187ccaac7 ] + +Currently the dtbs_check generates warnings like this: + +$nodename:0: 'dma-apbh@110000' does not match '^dma-controller(@.*)?$' + +So fix all affected dma-apbh node names. + +Signed-off-by: Stefan Wahren +Signed-off-by: Shawn Guo +Stable-dep-of: be18293e47cb ("ARM: dts: imx: Set default tuning step for imx7d usdhc") +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/imx23.dtsi | 2 +- + arch/arm/boot/dts/imx28.dtsi | 2 +- + arch/arm/boot/dts/imx6qdl.dtsi | 2 +- + arch/arm/boot/dts/imx6sx.dtsi | 2 +- + arch/arm/boot/dts/imx6ul.dtsi | 2 +- + arch/arm/boot/dts/imx7s.dtsi | 2 +- + 6 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/arch/arm/boot/dts/imx23.dtsi b/arch/arm/boot/dts/imx23.dtsi +index 7f4c602454a5f..ce3d6360a7efb 100644 +--- a/arch/arm/boot/dts/imx23.dtsi ++++ b/arch/arm/boot/dts/imx23.dtsi +@@ -59,7 +59,7 @@ + reg = <0x80000000 0x2000>; + }; + +- dma_apbh: dma-apbh@80004000 { ++ dma_apbh: dma-controller@80004000 { + compatible = "fsl,imx23-dma-apbh"; + reg = <0x80004000 0x2000>; + interrupts = <0 14 20 0 +diff --git a/arch/arm/boot/dts/imx28.dtsi b/arch/arm/boot/dts/imx28.dtsi +index 84d0176d51933..10eab221bc053 100644 +--- a/arch/arm/boot/dts/imx28.dtsi ++++ b/arch/arm/boot/dts/imx28.dtsi +@@ -78,7 +78,7 @@ + status = "disabled"; + }; + +- dma_apbh: dma-apbh@80004000 { ++ dma_apbh: dma-controller@80004000 { + compatible = "fsl,imx28-dma-apbh"; + reg = <0x80004000 0x2000>; + interrupts = <82 83 84 85 +diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi +index 60fd903ead3aa..8b6327e64819c 100644 +--- a/arch/arm/boot/dts/imx6qdl.dtsi ++++ b/arch/arm/boot/dts/imx6qdl.dtsi +@@ -150,7 +150,7 @@ + interrupt-parent = <&gpc>; + ranges; + +- dma_apbh: dma-apbh@110000 { ++ dma_apbh: dma-controller@110000 { + compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh"; + reg = <0x00110000 0x2000>; + interrupts = <0 13 IRQ_TYPE_LEVEL_HIGH>, +diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi +index ff4dc6d1b7578..7a3d85e7a5fa7 100644 +--- a/arch/arm/boot/dts/imx6sx.dtsi ++++ b/arch/arm/boot/dts/imx6sx.dtsi +@@ -209,7 +209,7 @@ + power-domains = <&pd_pu>; + }; + +- dma_apbh: dma-apbh@1804000 { ++ dma_apbh: dma-controller@1804000 { + compatible = "fsl,imx6sx-dma-apbh", "fsl,imx28-dma-apbh"; + reg = <0x01804000 0x2000>; + interrupts = , +diff --git a/arch/arm/boot/dts/imx6ul.dtsi b/arch/arm/boot/dts/imx6ul.dtsi +index f920c7beb02fa..ad92409349fa2 100644 +--- a/arch/arm/boot/dts/imx6ul.dtsi ++++ b/arch/arm/boot/dts/imx6ul.dtsi +@@ -164,7 +164,7 @@ + <0x00a06000 0x2000>; + }; + +- dma_apbh: dma-apbh@1804000 { ++ dma_apbh: dma-controller@1804000 { + compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh"; + reg = <0x01804000 0x2000>; + interrupts = <0 13 IRQ_TYPE_LEVEL_HIGH>, +diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi +index 5d62781451cb0..1055a1013fd00 100644 +--- a/arch/arm/boot/dts/imx7s.dtsi ++++ b/arch/arm/boot/dts/imx7s.dtsi +@@ -1239,7 +1239,7 @@ + }; + }; + +- dma_apbh: dma-apbh@33000000 { ++ dma_apbh: dma-controller@33000000 { + compatible = "fsl,imx7d-dma-apbh", "fsl,imx28-dma-apbh"; + reg = <0x33000000 0x2000>; + interrupts = , +-- +2.40.1 + diff --git a/queue-5.15/arm-dts-imx-set-default-tuning-step-for-imx7d-usdhc.patch b/queue-5.15/arm-dts-imx-set-default-tuning-step-for-imx7d-usdhc.patch new file mode 100644 index 00000000000..f4a9e815a76 --- /dev/null +++ b/queue-5.15/arm-dts-imx-set-default-tuning-step-for-imx7d-usdhc.patch @@ -0,0 +1,64 @@ +From 2355bbfe366e04a9a3aa22e0034846739ca3a5d0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 24 Jul 2023 23:45:10 +0800 +Subject: ARM: dts: imx: Set default tuning step for imx7d usdhc + +From: Xiaolei Wang + +[ Upstream commit be18293e47cbca7c6acee9231fc851601d69563a ] + +If the tuning step is not set, the tuning step is set to 1. +For some sd cards, the following Tuning timeout will occur. + +Tuning failed, falling back to fixed sampling clock +mmc0: Tuning failed, falling back to fixed sampling clock + +So set the default tuning step. This refers to the NXP vendor's +commit below: + +https://github.com/nxp-imx/linux-imx/blob/lf-6.1.y/ +arch/arm/boot/dts/imx7s.dtsi#L1216-L1217 + +Fixes: 1e336aa0c025 ("mmc: sdhci-esdhc-imx: correct the tuning start tap and step setting") +Signed-off-by: Xiaolei Wang +Reviewed-by: Fabio Estevam +Signed-off-by: Shawn Guo +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/imx7s.dtsi | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi +index 1055a1013fd00..c978aab1d0e3d 100644 +--- a/arch/arm/boot/dts/imx7s.dtsi ++++ b/arch/arm/boot/dts/imx7s.dtsi +@@ -1166,6 +1166,8 @@ + <&clks IMX7D_USDHC1_ROOT_CLK>; + clock-names = "ipg", "ahb", "per"; + bus-width = <4>; ++ fsl,tuning-step = <2>; ++ fsl,tuning-start-tap = <20>; + status = "disabled"; + }; + +@@ -1178,6 +1180,8 @@ + <&clks IMX7D_USDHC2_ROOT_CLK>; + clock-names = "ipg", "ahb", "per"; + bus-width = <4>; ++ fsl,tuning-step = <2>; ++ fsl,tuning-start-tap = <20>; + status = "disabled"; + }; + +@@ -1190,6 +1194,8 @@ + <&clks IMX7D_USDHC3_ROOT_CLK>; + clock-names = "ipg", "ahb", "per"; + bus-width = <4>; ++ fsl,tuning-step = <2>; ++ fsl,tuning-start-tap = <20>; + status = "disabled"; + }; + +-- +2.40.1 + diff --git a/queue-5.15/arm-dts-imx-update-sdma-node-name-format.patch b/queue-5.15/arm-dts-imx-update-sdma-node-name-format.patch new file mode 100644 index 00000000000..c44a2797629 --- /dev/null +++ b/queue-5.15/arm-dts-imx-update-sdma-node-name-format.patch @@ -0,0 +1,177 @@ +From e30cbdedd17e9df12e77e47335b723be592a5d07 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 5 Sep 2022 16:36:15 +0800 +Subject: ARM: dts: imx: update sdma node name format + +From: Joy Zou + +[ Upstream commit 6769089ecb5073b0896addffe72c89a4d80258c9 ] + +Node names should be generic, so change the sdma node name format 'sdma' +into 'dma-controller'. + +Acked-by: Fabio Estevam +Signed-off-by: Joy Zou +Signed-off-by: Shawn Guo +Stable-dep-of: be18293e47cb ("ARM: dts: imx: Set default tuning step for imx7d usdhc") +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/imx25.dtsi | 2 +- + arch/arm/boot/dts/imx31.dtsi | 2 +- + arch/arm/boot/dts/imx35.dtsi | 2 +- + arch/arm/boot/dts/imx50.dtsi | 2 +- + arch/arm/boot/dts/imx51.dtsi | 2 +- + arch/arm/boot/dts/imx53.dtsi | 2 +- + arch/arm/boot/dts/imx6qdl.dtsi | 2 +- + arch/arm/boot/dts/imx6sl.dtsi | 2 +- + arch/arm/boot/dts/imx6sx.dtsi | 2 +- + arch/arm/boot/dts/imx6ul.dtsi | 2 +- + arch/arm/boot/dts/imx7s.dtsi | 2 +- + 11 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/arch/arm/boot/dts/imx25.dtsi b/arch/arm/boot/dts/imx25.dtsi +index fdcca82c9986f..bd8ea2ec24575 100644 +--- a/arch/arm/boot/dts/imx25.dtsi ++++ b/arch/arm/boot/dts/imx25.dtsi +@@ -515,7 +515,7 @@ + #interrupt-cells = <2>; + }; + +- sdma: sdma@53fd4000 { ++ sdma: dma-controller@53fd4000 { + compatible = "fsl,imx25-sdma"; + reg = <0x53fd4000 0x4000>; + clocks = <&clks 112>, <&clks 68>; +diff --git a/arch/arm/boot/dts/imx31.dtsi b/arch/arm/boot/dts/imx31.dtsi +index 948d2a543f8d1..c85866e73a7b9 100644 +--- a/arch/arm/boot/dts/imx31.dtsi ++++ b/arch/arm/boot/dts/imx31.dtsi +@@ -297,7 +297,7 @@ + #interrupt-cells = <2>; + }; + +- sdma: sdma@53fd4000 { ++ sdma: dma-controller@53fd4000 { + compatible = "fsl,imx31-sdma"; + reg = <0x53fd4000 0x4000>; + interrupts = <34>; +diff --git a/arch/arm/boot/dts/imx35.dtsi b/arch/arm/boot/dts/imx35.dtsi +index 8e41c8b7bd705..d650f54c3fc6b 100644 +--- a/arch/arm/boot/dts/imx35.dtsi ++++ b/arch/arm/boot/dts/imx35.dtsi +@@ -284,7 +284,7 @@ + #interrupt-cells = <2>; + }; + +- sdma: sdma@53fd4000 { ++ sdma: dma-controller@53fd4000 { + compatible = "fsl,imx35-sdma"; + reg = <0x53fd4000 0x4000>; + clocks = <&clks 9>, <&clks 65>; +diff --git a/arch/arm/boot/dts/imx50.dtsi b/arch/arm/boot/dts/imx50.dtsi +index a969f335b2402..2560f8514ebed 100644 +--- a/arch/arm/boot/dts/imx50.dtsi ++++ b/arch/arm/boot/dts/imx50.dtsi +@@ -421,7 +421,7 @@ + status = "disabled"; + }; + +- sdma: sdma@63fb0000 { ++ sdma: dma-controller@63fb0000 { + compatible = "fsl,imx50-sdma", "fsl,imx35-sdma"; + reg = <0x63fb0000 0x4000>; + interrupts = <6>; +diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi +index 01cfcbe5928e8..b3ab0c000d9d1 100644 +--- a/arch/arm/boot/dts/imx51.dtsi ++++ b/arch/arm/boot/dts/imx51.dtsi +@@ -498,7 +498,7 @@ + status = "disabled"; + }; + +- sdma: sdma@83fb0000 { ++ sdma: dma-controller@83fb0000 { + compatible = "fsl,imx51-sdma", "fsl,imx35-sdma"; + reg = <0x83fb0000 0x4000>; + interrupts = <6>; +diff --git a/arch/arm/boot/dts/imx53.dtsi b/arch/arm/boot/dts/imx53.dtsi +index 2cf3909cca2f8..ca1bea42cc0e2 100644 +--- a/arch/arm/boot/dts/imx53.dtsi ++++ b/arch/arm/boot/dts/imx53.dtsi +@@ -710,7 +710,7 @@ + status = "disabled"; + }; + +- sdma: sdma@63fb0000 { ++ sdma: dma-controller@63fb0000 { + compatible = "fsl,imx53-sdma", "fsl,imx35-sdma"; + reg = <0x63fb0000 0x4000>; + interrupts = <6>; +diff --git a/arch/arm/boot/dts/imx6qdl.dtsi b/arch/arm/boot/dts/imx6qdl.dtsi +index 8520ffc1779b6..60fd903ead3aa 100644 +--- a/arch/arm/boot/dts/imx6qdl.dtsi ++++ b/arch/arm/boot/dts/imx6qdl.dtsi +@@ -930,7 +930,7 @@ + interrupts = <0 125 IRQ_TYPE_LEVEL_HIGH>; + }; + +- sdma: sdma@20ec000 { ++ sdma: dma-controller@20ec000 { + compatible = "fsl,imx6q-sdma", "fsl,imx35-sdma"; + reg = <0x020ec000 0x4000>; + interrupts = <0 2 IRQ_TYPE_LEVEL_HIGH>; +diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi +index 5b4dfc62030e8..0e0139246ad21 100644 +--- a/arch/arm/boot/dts/imx6sl.dtsi ++++ b/arch/arm/boot/dts/imx6sl.dtsi +@@ -752,7 +752,7 @@ + interrupts = <0 6 IRQ_TYPE_LEVEL_HIGH>; + }; + +- sdma: sdma@20ec000 { ++ sdma: dma-controller@20ec000 { + compatible = "fsl,imx6sl-sdma", "fsl,imx6q-sdma"; + reg = <0x020ec000 0x4000>; + interrupts = <0 2 IRQ_TYPE_LEVEL_HIGH>; +diff --git a/arch/arm/boot/dts/imx6sx.dtsi b/arch/arm/boot/dts/imx6sx.dtsi +index 3e779fd0a3961..ff4dc6d1b7578 100644 +--- a/arch/arm/boot/dts/imx6sx.dtsi ++++ b/arch/arm/boot/dts/imx6sx.dtsi +@@ -848,7 +848,7 @@ + reg = <0x020e4000 0x4000>; + }; + +- sdma: sdma@20ec000 { ++ sdma: dma-controller@20ec000 { + compatible = "fsl,imx6sx-sdma", "fsl,imx6q-sdma"; + reg = <0x020ec000 0x4000>; + interrupts = ; +diff --git a/arch/arm/boot/dts/imx6ul.dtsi b/arch/arm/boot/dts/imx6ul.dtsi +index eca8bf89ab88f..f920c7beb02fa 100644 +--- a/arch/arm/boot/dts/imx6ul.dtsi ++++ b/arch/arm/boot/dts/imx6ul.dtsi +@@ -744,7 +744,7 @@ + status = "disabled"; + }; + +- sdma: sdma@20ec000 { ++ sdma: dma-controller@20ec000 { + compatible = "fsl,imx6ul-sdma", "fsl,imx6q-sdma", + "fsl,imx35-sdma"; + reg = <0x020ec000 0x4000>; +diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi +index f4d2009d998b7..5951f9a22af86 100644 +--- a/arch/arm/boot/dts/imx7s.dtsi ++++ b/arch/arm/boot/dts/imx7s.dtsi +@@ -1206,7 +1206,7 @@ + status = "disabled"; + }; + +- sdma: sdma@30bd0000 { ++ sdma: dma-controller@30bd0000 { + compatible = "fsl,imx7d-sdma", "fsl,imx35-sdma"; + reg = <0x30bd0000 0x10000>; + interrupts = ; +-- +2.40.1 + diff --git a/queue-5.15/arm-dts-imx7s-drop-dma-apb-interrupt-names.patch b/queue-5.15/arm-dts-imx7s-drop-dma-apb-interrupt-names.patch new file mode 100644 index 00000000000..853673c7481 --- /dev/null +++ b/queue-5.15/arm-dts-imx7s-drop-dma-apb-interrupt-names.patch @@ -0,0 +1,37 @@ +From dd1fa39e4f09e589a5eecc512c99a8d23b1cca95 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 17 Dec 2022 02:08:53 +0100 +Subject: ARM: dts: imx7s: Drop dma-apb interrupt-names + +From: Marek Vasut + +[ Upstream commit 9928f0a9e7c0cee3360ca1442b4001d34ad67556 ] + +Drop "interrupt-names" property, since it is broken. The drivers/dma/mxs-dma.c +in Linux kernel does not use it, the property contains duplicate array entries +in existing DTs, and even malformed entries (gmpi, should have been gpmi). Get +rid of that optional property altogether. + +Signed-off-by: Marek Vasut +Signed-off-by: Shawn Guo +Stable-dep-of: be18293e47cb ("ARM: dts: imx: Set default tuning step for imx7d usdhc") +Signed-off-by: Sasha Levin +--- + arch/arm/boot/dts/imx7s.dtsi | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/arch/arm/boot/dts/imx7s.dtsi b/arch/arm/boot/dts/imx7s.dtsi +index 5951f9a22af86..5d62781451cb0 100644 +--- a/arch/arm/boot/dts/imx7s.dtsi ++++ b/arch/arm/boot/dts/imx7s.dtsi +@@ -1246,7 +1246,6 @@ + , + , + ; +- interrupt-names = "gpmi0", "gpmi1", "gpmi2", "gpmi3"; + #dma-cells = <1>; + dma-channels = <4>; + clocks = <&clks IMX7D_NAND_USDHC_BUS_RAWNAND_CLK>; +-- +2.40.1 + diff --git a/queue-5.15/asoc-atmel-fix-the-8k-sample-parameter-in-i2sc-maste.patch b/queue-5.15/asoc-atmel-fix-the-8k-sample-parameter-in-i2sc-maste.patch new file mode 100644 index 00000000000..024cb32859d --- /dev/null +++ b/queue-5.15/asoc-atmel-fix-the-8k-sample-parameter-in-i2sc-maste.patch @@ -0,0 +1,46 @@ +From 8742ca65ba0c4fc22d0e498f88dd90eac0c4e764 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 15 Jul 2023 11:06:20 +0800 +Subject: ASoC: atmel: Fix the 8K sample parameter in I2SC master + +From: Guiting Shen + +[ Upstream commit f85739c0b2b0d98a32f5ca4fcc5501d2b76df4f6 ] + +The 8K sample parameter of 12.288Mhz main system bus clock doesn't work +because the I2SC_MR.IMCKDIV must not be 0 according to the sama5d2 +series datasheet(I2SC Mode Register of Register Summary). + +So use the 6.144Mhz instead of 12.288Mhz to support 8K sample. + +Signed-off-by: Guiting Shen +Link: https://lore.kernel.org/r/20230715030620.62328-1-aarongt.shen@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/atmel/atmel-i2s.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/atmel/atmel-i2s.c b/sound/soc/atmel/atmel-i2s.c +index 6b3d9c05eaf27..4cb0605f6daa2 100644 +--- a/sound/soc/atmel/atmel-i2s.c ++++ b/sound/soc/atmel/atmel-i2s.c +@@ -163,11 +163,14 @@ struct atmel_i2s_gck_param { + + #define I2S_MCK_12M288 12288000UL + #define I2S_MCK_11M2896 11289600UL ++#define I2S_MCK_6M144 6144000UL + + /* mck = (32 * (imckfs+1) / (imckdiv+1)) * fs */ + static const struct atmel_i2s_gck_param gck_params[] = { ++ /* mck = 6.144Mhz */ ++ { 8000, I2S_MCK_6M144, 1, 47}, /* mck = 768 fs */ ++ + /* mck = 12.288MHz */ +- { 8000, I2S_MCK_12M288, 0, 47}, /* mck = 1536 fs */ + { 16000, I2S_MCK_12M288, 1, 47}, /* mck = 768 fs */ + { 24000, I2S_MCK_12M288, 3, 63}, /* mck = 512 fs */ + { 32000, I2S_MCK_12M288, 3, 47}, /* mck = 384 fs */ +-- +2.40.1 + diff --git a/queue-5.15/asoc-codecs-es8316-fix-dmic-config.patch b/queue-5.15/asoc-codecs-es8316-fix-dmic-config.patch new file mode 100644 index 00000000000..f008657b1fa --- /dev/null +++ b/queue-5.15/asoc-codecs-es8316-fix-dmic-config.patch @@ -0,0 +1,36 @@ +From fb58c584c77f1f7bceb9254e9734058f1cfbc15e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 19 Jul 2023 13:47:22 +0800 +Subject: ASoc: codecs: ES8316: Fix DMIC config + +From: Edgar + +[ Upstream commit d20d35d1ad62c6cca36368c1e8f29335a068659e ] + +According to the datasheet, the DMIC config should +be changed to { 0, 2 ,3 } + +Signed-off-by: Edgar +Link: https://lore.kernel.org/r/20230719054722.401954-1-ljijcj@163.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/es8316.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c +index b36ccfc54cd69..93549f8ee130c 100644 +--- a/sound/soc/codecs/es8316.c ++++ b/sound/soc/codecs/es8316.c +@@ -153,7 +153,7 @@ static const char * const es8316_dmic_txt[] = { + "dmic data at high level", + "dmic data at low level", + }; +-static const unsigned int es8316_dmic_values[] = { 0, 1, 2 }; ++static const unsigned int es8316_dmic_values[] = { 0, 2, 3 }; + static const struct soc_enum es8316_dmic_src_enum = + SOC_VALUE_ENUM_SINGLE(ES8316_ADC_DMIC, 0, 3, + ARRAY_SIZE(es8316_dmic_txt), +-- +2.40.1 + diff --git a/queue-5.15/asoc-da7219-check-for-failure-reading-aad-irq-events.patch b/queue-5.15/asoc-da7219-check-for-failure-reading-aad-irq-events.patch new file mode 100644 index 00000000000..7be505787f8 --- /dev/null +++ b/queue-5.15/asoc-da7219-check-for-failure-reading-aad-irq-events.patch @@ -0,0 +1,51 @@ +From 81ae16fe38933d101b00120add4cc93383f1a56b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 17 Jul 2023 21:37:37 +0200 +Subject: ASoC: da7219: Check for failure reading AAD IRQ events + +From: Dmytro Maluka + +[ Upstream commit f0691dc16206f21b13c464434366e2cd632b8ed7 ] + +When handling an AAD interrupt, if IRQ events read failed (for example, +due to i2c "Transfer while suspended" failure, i.e. when attempting to +read it while DA7219 is suspended, which may happen due to a spurious +AAD interrupt), the events array contains garbage uninitialized values. +So instead of trying to interprete those values and doing any actions +based on them (potentially resulting in misbehavior, e.g. reporting +bogus events), refuse to handle the interrupt. + +Signed-off-by: Dmytro Maluka +Link: https://lore.kernel.org/r/20230717193737.161784-3-dmy@semihalf.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/da7219-aad.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c +index 6b368ab945be5..7d18de959439f 100644 +--- a/sound/soc/codecs/da7219-aad.c ++++ b/sound/soc/codecs/da7219-aad.c +@@ -347,11 +347,15 @@ static irqreturn_t da7219_aad_irq_thread(int irq, void *data) + struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); + u8 events[DA7219_AAD_IRQ_REG_MAX]; + u8 statusa; +- int i, report = 0, mask = 0; ++ int i, ret, report = 0, mask = 0; + + /* Read current IRQ events */ +- regmap_bulk_read(da7219->regmap, DA7219_ACCDET_IRQ_EVENT_A, +- events, DA7219_AAD_IRQ_REG_MAX); ++ ret = regmap_bulk_read(da7219->regmap, DA7219_ACCDET_IRQ_EVENT_A, ++ events, DA7219_AAD_IRQ_REG_MAX); ++ if (ret) { ++ dev_warn_ratelimited(component->dev, "Failed to read IRQ events: %d\n", ret); ++ return IRQ_NONE; ++ } + + if (!events[DA7219_AAD_IRQ_REG_A] && !events[DA7219_AAD_IRQ_REG_B]) + return IRQ_NONE; +-- +2.40.1 + diff --git a/queue-5.15/asoc-da7219-flush-pending-aad-irq-when-suspending.patch b/queue-5.15/asoc-da7219-flush-pending-aad-irq-when-suspending.patch new file mode 100644 index 00000000000..198e2df3e33 --- /dev/null +++ b/queue-5.15/asoc-da7219-flush-pending-aad-irq-when-suspending.patch @@ -0,0 +1,77 @@ +From f5ce9fcb7a5124a24c81962847d79a519a037d8f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 17 Jul 2023 21:37:36 +0200 +Subject: ASoC: da7219: Flush pending AAD IRQ when suspending + +From: Dmytro Maluka + +[ Upstream commit 91e292917dad64ab8d1d5ca2ab3069ad9dac6f72 ] + +da7219_aad_suspend() disables jack detection, which should prevent +generating new interrupts by DA7219 while suspended. However, there is a +theoretical possibility that there is a pending interrupt generated just +before suspending DA7219 and not handled yet, so the IRQ handler may +still run after DA7219 is suspended. To prevent that, wait until the +pending IRQ handling is done. + +This patch arose as an attempt to fix the following I2C failure +occurring sometimes during system suspend or resume: + +[ 355.876211] i2c_designware i2c_designware.3: Transfer while suspended +[ 355.876245] WARNING: CPU: 2 PID: 3576 at drivers/i2c/busses/i2c-designware-master.c:570 i2c_dw_xfer+0x411/0x440 +... +[ 355.876462] Call Trace: +[ 355.876468] +[ 355.876475] ? update_load_avg+0x1b3/0x615 +[ 355.876484] __i2c_transfer+0x101/0x1d8 +[ 355.876494] i2c_transfer+0x74/0x10d +[ 355.876504] regmap_i2c_read+0x6a/0x9c +[ 355.876513] _regmap_raw_read+0x179/0x223 +[ 355.876521] regmap_raw_read+0x1e1/0x28e +[ 355.876527] regmap_bulk_read+0x17d/0x1ba +[ 355.876532] ? __wake_up+0xed/0x1bb +[ 355.876542] da7219_aad_irq_thread+0x54/0x2c9 [snd_soc_da7219 5fb8ebb2179cf2fea29af090f3145d68ed8e2184] +[ 355.876556] irq_thread+0x13c/0x231 +[ 355.876563] ? irq_forced_thread_fn+0x5f/0x5f +[ 355.876570] ? irq_thread_fn+0x4d/0x4d +[ 355.876576] kthread+0x13a/0x152 +[ 355.876581] ? synchronize_irq+0xc3/0xc3 +[ 355.876587] ? kthread_blkcg+0x31/0x31 +[ 355.876592] ret_from_fork+0x1f/0x30 +[ 355.876601] + +which indicates that the AAD IRQ handler is unexpectedly running when +DA7219 is suspended, and as a result, is trying to read data from DA7219 +over I2C and is hitting the I2C driver "Transfer while suspended" +failure. + +However, with this patch the above failure is still reproducible. So +this patch does not fix any real observed issue so far, but at least is +useful for confirming that the above issue is not caused by a pending +IRQ but rather looks like a DA7219 hardware issue with an IRQ +unexpectedly generated after jack detection is already disabled. + +Signed-off-by: Dmytro Maluka +Link: https://lore.kernel.org/r/20230717193737.161784-2-dmy@semihalf.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/da7219-aad.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sound/soc/codecs/da7219-aad.c b/sound/soc/codecs/da7219-aad.c +index 7998fdd3b378e..6b368ab945be5 100644 +--- a/sound/soc/codecs/da7219-aad.c ++++ b/sound/soc/codecs/da7219-aad.c +@@ -854,6 +854,8 @@ void da7219_aad_suspend(struct snd_soc_component *component) + } + } + } ++ ++ synchronize_irq(da7219_aad->irq); + } + + void da7219_aad_resume(struct snd_soc_component *component) +-- +2.40.1 + diff --git a/queue-5.15/asoc-rt5682-sdw-fix-for-jd-event-handling-in-clockst.patch b/queue-5.15/asoc-rt5682-sdw-fix-for-jd-event-handling-in-clockst.patch new file mode 100644 index 00000000000..18e3f1b8c67 --- /dev/null +++ b/queue-5.15/asoc-rt5682-sdw-fix-for-jd-event-handling-in-clockst.patch @@ -0,0 +1,46 @@ +From c01743ce11b567beb2dd87e477552622599fc0c5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 21 Jul 2023 17:06:43 +0800 +Subject: ASoC: rt5682-sdw: fix for JD event handling in ClockStop Mode0 + +From: Shuming Fan + +[ Upstream commit 02fb23d72720df2b6be3f29fc5787ca018eb92c3 ] + +When the system suspends, peripheral Imp-defined interrupt is disabled. +When system level resume is invoked, the peripheral Imp-defined interrupts +should be enabled to handle JD events. + +Signed-off-by: Shuming Fan +Reported-by: Vijendar Mukunda +Link: https://lore.kernel.org/r/20230721090643.128213-1-shumingf@realtek.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/rt5682-sdw.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/rt5682-sdw.c b/sound/soc/codecs/rt5682-sdw.c +index f04e18c32489d..9fdd9afe00da4 100644 +--- a/sound/soc/codecs/rt5682-sdw.c ++++ b/sound/soc/codecs/rt5682-sdw.c +@@ -786,8 +786,15 @@ static int __maybe_unused rt5682_dev_resume(struct device *dev) + if (!rt5682->first_hw_init) + return 0; + +- if (!slave->unattach_request) ++ if (!slave->unattach_request) { ++ if (rt5682->disable_irq == true) { ++ mutex_lock(&rt5682->disable_irq_lock); ++ sdw_write_no_pm(slave, SDW_SCP_INTMASK1, SDW_SCP_INT1_IMPL_DEF); ++ rt5682->disable_irq = false; ++ mutex_unlock(&rt5682->disable_irq_lock); ++ } + goto regmap_sync; ++ } + + time = wait_for_completion_timeout(&slave->initialization_complete, + msecs_to_jiffies(RT5682_PROBE_TIMEOUT)); +-- +2.40.1 + diff --git a/queue-5.15/asoc-rt711-fix-for-jd-event-handling-in-clockstop-mo.patch b/queue-5.15/asoc-rt711-fix-for-jd-event-handling-in-clockstop-mo.patch new file mode 100644 index 00000000000..2bff7c18c7f --- /dev/null +++ b/queue-5.15/asoc-rt711-fix-for-jd-event-handling-in-clockstop-mo.patch @@ -0,0 +1,46 @@ +From 0738ad573b2e4542cb29fdcfa721483adfa21180 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 21 Jul 2023 17:06:54 +0800 +Subject: ASoC: rt711: fix for JD event handling in ClockStop Mode0 + +From: Shuming Fan + +[ Upstream commit b69de265bd0e877015a00fbba453ef72af162e0f ] + +When the system suspends, peripheral Imp-defined interrupt is disabled. +When system level resume is invoked, the peripheral Imp-defined interrupts +should be enabled to handle JD events. + +Signed-off-by: Shuming Fan +Reported-by: Vijendar Mukunda +Link: https://lore.kernel.org/r/20230721090654.128230-1-shumingf@realtek.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/rt711-sdw.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/rt711-sdw.c b/sound/soc/codecs/rt711-sdw.c +index 4fe68bcf2a7c2..9545b8a7eb192 100644 +--- a/sound/soc/codecs/rt711-sdw.c ++++ b/sound/soc/codecs/rt711-sdw.c +@@ -541,8 +541,15 @@ static int __maybe_unused rt711_dev_resume(struct device *dev) + if (!rt711->first_hw_init) + return 0; + +- if (!slave->unattach_request) ++ if (!slave->unattach_request) { ++ if (rt711->disable_irq == true) { ++ mutex_lock(&rt711->disable_irq_lock); ++ sdw_write_no_pm(slave, SDW_SCP_INTMASK1, SDW_SCP_INT1_IMPL_DEF); ++ rt711->disable_irq = false; ++ mutex_unlock(&rt711->disable_irq_lock); ++ } + goto regmap_sync; ++ } + + time = wait_for_completion_timeout(&slave->initialization_complete, + msecs_to_jiffies(RT711_PROBE_TIMEOUT)); +-- +2.40.1 + diff --git a/queue-5.15/asoc-rt711-sdca-fix-for-jd-event-handling-in-clockst.patch b/queue-5.15/asoc-rt711-sdca-fix-for-jd-event-handling-in-clockst.patch new file mode 100644 index 00000000000..fa32921c257 --- /dev/null +++ b/queue-5.15/asoc-rt711-sdca-fix-for-jd-event-handling-in-clockst.patch @@ -0,0 +1,48 @@ +From 1fe5b9a6e588b689bdd1ba71f71c76ee5cc37de1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 21 Jul 2023 17:07:11 +0800 +Subject: ASoC: rt711-sdca: fix for JD event handling in ClockStop Mode0 + +From: Shuming Fan + +[ Upstream commit 23adeb7056acd4fd866969f4afb91441776cc4f5 ] + +When the system suspends, peripheral SDCA interrupts are disabled. +When system level resume is invoked, the peripheral SDCA interrupts +should be enabled to handle JD events. +Enable SDCA interrupts in resume sequence when ClockStop Mode0 is applied. + +Signed-off-by: Shuming Fan +Reported-by: Vijendar Mukunda +Link: https://lore.kernel.org/r/20230721090711.128247-1-shumingf@realtek.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/codecs/rt711-sdca-sdw.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/sound/soc/codecs/rt711-sdca-sdw.c b/sound/soc/codecs/rt711-sdca-sdw.c +index 31e77d462ef34..4faf6b8544ddd 100644 +--- a/sound/soc/codecs/rt711-sdca-sdw.c ++++ b/sound/soc/codecs/rt711-sdca-sdw.c +@@ -442,8 +442,16 @@ static int __maybe_unused rt711_sdca_dev_resume(struct device *dev) + if (!rt711->first_hw_init) + return 0; + +- if (!slave->unattach_request) ++ if (!slave->unattach_request) { ++ if (rt711->disable_irq == true) { ++ mutex_lock(&rt711->disable_irq_lock); ++ sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK1, SDW_SCP_SDCA_INTMASK_SDCA_0); ++ sdw_write_no_pm(slave, SDW_SCP_SDCA_INTMASK2, SDW_SCP_SDCA_INTMASK_SDCA_8); ++ rt711->disable_irq = false; ++ mutex_unlock(&rt711->disable_irq_lock); ++ } + goto regmap_sync; ++ } + + time = wait_for_completion_timeout(&slave->initialization_complete, + msecs_to_jiffies(RT711_PROBE_TIMEOUT)); +-- +2.40.1 + diff --git a/queue-5.15/ata-pata_arasan_cf-use-dev_err_probe-instead-dev_err.patch b/queue-5.15/ata-pata_arasan_cf-use-dev_err_probe-instead-dev_err.patch new file mode 100644 index 00000000000..9a55a85a90d --- /dev/null +++ b/queue-5.15/ata-pata_arasan_cf-use-dev_err_probe-instead-dev_err.patch @@ -0,0 +1,40 @@ +From 11da7cd45d4ea5a692c05a2d898667bad034b45f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 25 Jul 2023 11:06:25 +0800 +Subject: ata: pata_arasan_cf: Use dev_err_probe() instead dev_err() in + data_xfer() + +From: Minjie Du + +[ Upstream commit 4139f992c49356391fb086c0c8ce51f66c26d623 ] + +It is possible for dma_request_chan() to return EPROBE_DEFER, which +means acdev->host->dev is not ready yet. At this point dev_err() will +have no output. Use dev_err_probe() instead. + +Signed-off-by: Minjie Du +Acked-by: Viresh Kumar +Reviewed-by: Sergey Shtylyov +Signed-off-by: Damien Le Moal +Signed-off-by: Sasha Levin +--- + drivers/ata/pata_arasan_cf.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c +index 63f39440a9b42..4ba02f082f962 100644 +--- a/drivers/ata/pata_arasan_cf.c ++++ b/drivers/ata/pata_arasan_cf.c +@@ -528,7 +528,8 @@ static void data_xfer(struct work_struct *work) + /* dma_request_channel may sleep, so calling from process context */ + acdev->dma_chan = dma_request_chan(acdev->host->dev, "data"); + if (IS_ERR(acdev->dma_chan)) { +- dev_err(acdev->host->dev, "Unable to get dma_chan\n"); ++ dev_err_probe(acdev->host->dev, PTR_ERR(acdev->dma_chan), ++ "Unable to get dma_chan\n"); + acdev->dma_chan = NULL; + goto chan_request_fail; + } +-- +2.40.1 + diff --git a/queue-5.15/bnx2x-fix-page-fault-following-eeh-recovery.patch b/queue-5.15/bnx2x-fix-page-fault-following-eeh-recovery.patch new file mode 100644 index 00000000000..a9f2a8ccbbc --- /dev/null +++ b/queue-5.15/bnx2x-fix-page-fault-following-eeh-recovery.patch @@ -0,0 +1,55 @@ +From 23bf3ea2854cb00cbc98597027ca2b43c3474265 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Jun 2023 16:01:43 -0400 +Subject: bnx2x: fix page fault following EEH recovery + +From: David Christensen + +[ Upstream commit 7ebe4eda4265642859507d1b3ca330d8c196cfe5 ] + +In the last step of the EEH recovery process, the EEH driver calls into +bnx2x_io_resume() to re-initialize the NIC hardware via the function +bnx2x_nic_load(). If an error occurs during bnx2x_nic_load(), OS and +hardware resources are released and an error code is returned to the +caller. When called from bnx2x_io_resume(), the return code is ignored +and the network interface is brought up unconditionally. Later attempts +to send a packet via this interface result in a page fault due to a null +pointer reference. + +This patch checks the return code of bnx2x_nic_load(), prints an error +message if necessary, and does not enable the interface. + +Signed-off-by: David Christensen +Reviewed-by: Sridhar Samudrala +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +index 553f3de939574..9c26c46771f5e 100644 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +@@ -14317,11 +14317,16 @@ static void bnx2x_io_resume(struct pci_dev *pdev) + bp->fw_seq = SHMEM_RD(bp, func_mb[BP_FW_MB_IDX(bp)].drv_mb_header) & + DRV_MSG_SEQ_NUMBER_MASK; + +- if (netif_running(dev)) +- bnx2x_nic_load(bp, LOAD_NORMAL); ++ if (netif_running(dev)) { ++ if (bnx2x_nic_load(bp, LOAD_NORMAL)) { ++ netdev_err(bp->dev, "Error during driver initialization, try unloading/reloading the driver\n"); ++ goto done; ++ } ++ } + + netif_device_attach(dev); + ++done: + rtnl_unlock(); + } + +-- +2.40.1 + diff --git a/queue-5.15/clk-fixed-mmio-make-common_clk_fixed_mmio-depend-on-.patch b/queue-5.15/clk-fixed-mmio-make-common_clk_fixed_mmio-depend-on-.patch new file mode 100644 index 00000000000..a90b6c611e0 --- /dev/null +++ b/queue-5.15/clk-fixed-mmio-make-common_clk_fixed_mmio-depend-on-.patch @@ -0,0 +1,52 @@ +From 9a1feac25d5e4a9921de1ca74b498bf681aeacd8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 7 Jul 2023 21:58:51 +0800 +Subject: clk: fixed-mmio: make COMMON_CLK_FIXED_MMIO depend on HAS_IOMEM + +From: Baoquan He + +[ Upstream commit e7dd44f4f3166db45248414f5df8f615392de47a ] + +On s390 systems (aka mainframes), it has classic channel devices for +networking and permanent storage that are currently even more common +than PCI devices. Hence it could have a fully functional s390 kernel +with CONFIG_PCI=n, then the relevant iomem mapping functions +[including ioremap(), devm_ioremap(), etc.] are not available. + +Here let COMMON_CLK_FIXED_MMIO depend on HAS_IOMEM so that it won't +be built to cause below compiling error if PCI is unset: + +------ +ld: drivers/clk/clk-fixed-mmio.o: in function `fixed_mmio_clk_setup': +clk-fixed-mmio.c:(.text+0x5e): undefined reference to `of_iomap' +ld: clk-fixed-mmio.c:(.text+0xba): undefined reference to `iounmap' +------ + +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202306211329.ticOJCSv-lkp@intel.com/ +Signed-off-by: Baoquan He +Cc: Michael Turquette +Cc: Stephen Boyd +Cc: linux-clk@vger.kernel.org +Link: https://lore.kernel.org/r/20230707135852.24292-8-bhe@redhat.com +Signed-off-by: Stephen Boyd +Signed-off-by: Sasha Levin +--- + drivers/clk/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig +index 100e474ff3dc5..d12465c227514 100644 +--- a/drivers/clk/Kconfig ++++ b/drivers/clk/Kconfig +@@ -380,6 +380,7 @@ config COMMON_CLK_BD718XX + config COMMON_CLK_FIXED_MMIO + bool "Clock driver for Memory Mapped Fixed values" + depends on COMMON_CLK && OF ++ depends on HAS_IOMEM + help + Support for Memory Mapped IO Fixed clocks + +-- +2.40.1 + diff --git a/queue-5.15/drm-amd-display-exit-idle-optimizations-before-attem.patch b/queue-5.15/drm-amd-display-exit-idle-optimizations-before-attem.patch new file mode 100644 index 00000000000..02e2aa98994 --- /dev/null +++ b/queue-5.15/drm-amd-display-exit-idle-optimizations-before-attem.patch @@ -0,0 +1,45 @@ +From b536b46d5e3f97bd18dd0035ee020258afc96d50 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 12 Jul 2023 16:50:15 -0400 +Subject: drm/amd/display: Exit idle optimizations before attempt to access PHY + +From: Leo Chen + +[ Upstream commit de612738e9771bd66aeb20044486c457c512f684 ] + +[Why & How] +DMUB may hang when powering down pixel clocks due to no dprefclk. + +It is fixed by exiting idle optimization before the attempt to access PHY. + +Reviewed-by: Nicholas Kazlauskas +Acked-by: Alex Hung +Signed-off-by: Leo Chen +Tested-by: Daniel Wheeler +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +index 46d7e75e4553e..52142d272c868 100644 +--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c ++++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +@@ -1744,10 +1744,13 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context) + hws->funcs.edp_backlight_control(edp_link_with_sink, false); + } + /*resume from S3, no vbios posting, no need to power down again*/ ++ clk_mgr_exit_optimized_pwr_state(dc, dc->clk_mgr); ++ + power_down_all_hw_blocks(dc); + disable_vga_and_power_gate_all_controllers(dc); + if (edp_link_with_sink && !keep_edp_vdd_on) + dc->hwss.edp_power_control(edp_link_with_sink, false); ++ clk_mgr_optimize_pwr_state(dc, dc->clk_mgr); + } + bios_set_scratch_acc_mode_change(dc->ctx->dc_bios, 1); + } +-- +2.40.1 + diff --git a/queue-5.15/drm-amdgpu-match-against-exact-bootloader-status.patch b/queue-5.15/drm-amdgpu-match-against-exact-bootloader-status.patch new file mode 100644 index 00000000000..9c981a787b1 --- /dev/null +++ b/queue-5.15/drm-amdgpu-match-against-exact-bootloader-status.patch @@ -0,0 +1,53 @@ +From 77344eb567404877f0e129374f902b66663019bd Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 25 Jul 2023 19:11:54 +0530 +Subject: drm/amdgpu: Match against exact bootloader status + +From: Lijo Lazar + +[ Upstream commit d3de41ee5febe5c2d9989fe9810bce2bb54a3a8e ] + +On PSP v13.x ASICs, boot loader will set only the MSB to 1 and clear the +least significant bits for any command submission. Hence match against +the exact register value, otherwise a register value of all 0xFFs also +could falsely indicate that boot loader is ready. Also, from PSP v13.0.6 +and newer, bits[7:0] will be used to indicate command error status. + +Signed-off-by: Lijo Lazar +Acked-by: Alex Deucher +Signed-off-by: Alex Deucher +Signed-off-by: Sasha Levin +--- + drivers/gpu/drm/amd/amdgpu/psp_v13_0.c | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +index 47a500f64db20..bcf356df1ef33 100644 +--- a/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +@@ -101,14 +101,15 @@ static int psp_v13_0_wait_for_bootloader(struct psp_context *psp) + int ret; + int retry_loop; + ++ /* Wait for bootloader to signify that it is ready having bit 31 of ++ * C2PMSG_35 set to 1. All other bits are expected to be cleared. ++ * If there is an error in processing command, bits[7:0] will be set. ++ * This is applicable for PSP v13.0.6 and newer. ++ */ + for (retry_loop = 0; retry_loop < 10; retry_loop++) { +- /* Wait for bootloader to signify that is +- ready having bit 31 of C2PMSG_35 set to 1 */ +- ret = psp_wait_for(psp, +- SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_35), +- 0x80000000, +- 0x80000000, +- false); ++ ret = psp_wait_for( ++ psp, SOC15_REG_OFFSET(MP0, 0, regMP0_SMN_C2PMSG_35), ++ 0x80000000, 0xffffffff, false); + + if (ret == 0) + return 0; +-- +2.40.1 + diff --git a/queue-5.15/ethernet-atheros-fix-return-value-check-in-atl1c_tso.patch b/queue-5.15/ethernet-atheros-fix-return-value-check-in-atl1c_tso.patch new file mode 100644 index 00000000000..ed77381e01d --- /dev/null +++ b/queue-5.15/ethernet-atheros-fix-return-value-check-in-atl1c_tso.patch @@ -0,0 +1,42 @@ +From c47bf32a18a099deb14533942df77b36ca1f9ead Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 20 Jul 2023 22:42:08 +0800 +Subject: ethernet: atheros: fix return value check in atl1c_tso_csum() + +From: Yuanjun Gong + +[ Upstream commit 8d01da0a1db237c44c92859ce3612df7af8d3a53 ] + +in atl1c_tso_csum, it should check the return value of pskb_trim(), +and return an error code if an unexpected value is returned +by pskb_trim(). + +Signed-off-by: Yuanjun Gong +Reviewed-by: Simon Horman +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +index 5cbd815c737e7..dad21b4fbc0bc 100644 +--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c ++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +@@ -2104,8 +2104,11 @@ static int atl1c_tso_csum(struct atl1c_adapter *adapter, + real_len = (((unsigned char *)ip_hdr(skb) - skb->data) + + ntohs(ip_hdr(skb)->tot_len)); + +- if (real_len < skb->len) +- pskb_trim(skb, real_len); ++ if (real_len < skb->len) { ++ err = pskb_trim(skb, real_len); ++ if (err) ++ return err; ++ } + + hdr_len = (skb_transport_offset(skb) + tcp_hdrlen(skb)); + if (unlikely(skb->len == hdr_len)) { +-- +2.40.1 + diff --git a/queue-5.15/fs-nls-make-load_nls-take-a-const-parameter.patch b/queue-5.15/fs-nls-make-load_nls-take-a-const-parameter.patch new file mode 100644 index 00000000000..6a14119bd08 --- /dev/null +++ b/queue-5.15/fs-nls-make-load_nls-take-a-const-parameter.patch @@ -0,0 +1,66 @@ +From 19ff6dd7dd94ecded0b53e9907b087498c5cb5c1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 24 Jul 2023 10:10:56 +0800 +Subject: fs/nls: make load_nls() take a const parameter + +From: Winston Wen + +[ Upstream commit c1ed39ec116272935528ca9b348b8ee79b0791da ] + +load_nls() take a char * parameter, use it to find nls module in list or +construct the module name to load it. + +This change make load_nls() take a const parameter, so we don't need do +some cast like this: + + ses->local_nls = load_nls((char *)ctx->local_nls->charset); + +Suggested-by: Stephen Rothwell +Signed-off-by: Winston Wen +Reviewed-by: Paulo Alcantara +Reviewed-by: Christian Brauner +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/nls/nls_base.c | 4 ++-- + include/linux/nls.h | 2 +- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c +index 52ccd34b1e792..a026dbd3593f6 100644 +--- a/fs/nls/nls_base.c ++++ b/fs/nls/nls_base.c +@@ -272,7 +272,7 @@ int unregister_nls(struct nls_table * nls) + return -EINVAL; + } + +-static struct nls_table *find_nls(char *charset) ++static struct nls_table *find_nls(const char *charset) + { + struct nls_table *nls; + spin_lock(&nls_lock); +@@ -288,7 +288,7 @@ static struct nls_table *find_nls(char *charset) + return nls; + } + +-struct nls_table *load_nls(char *charset) ++struct nls_table *load_nls(const char *charset) + { + return try_then_request_module(find_nls(charset), "nls_%s", charset); + } +diff --git a/include/linux/nls.h b/include/linux/nls.h +index 499e486b3722d..e0bf8367b274a 100644 +--- a/include/linux/nls.h ++++ b/include/linux/nls.h +@@ -47,7 +47,7 @@ enum utf16_endian { + /* nls_base.c */ + extern int __register_nls(struct nls_table *, struct module *); + extern int unregister_nls(struct nls_table *); +-extern struct nls_table *load_nls(char *); ++extern struct nls_table *load_nls(const char *charset); + extern void unload_nls(struct nls_table *); + extern struct nls_table *load_nls_default(void); + #define register_nls(nls) __register_nls((nls), THIS_MODULE) +-- +2.40.1 + diff --git a/queue-5.15/idmaengine-make-fsl_edma-and-intel_idma64-depends-on.patch b/queue-5.15/idmaengine-make-fsl_edma-and-intel_idma64-depends-on.patch new file mode 100644 index 00000000000..eb52d83d8db --- /dev/null +++ b/queue-5.15/idmaengine-make-fsl_edma-and-intel_idma64-depends-on.patch @@ -0,0 +1,58 @@ +From 56dd8a39c45a65f8c93463354861bf93741ad408 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 7 Jul 2023 21:58:45 +0800 +Subject: idmaengine: make FSL_EDMA and INTEL_IDMA64 depends on HAS_IOMEM + +From: Baoquan He + +[ Upstream commit b1e213a9e31c20206f111ec664afcf31cbfe0dbb ] + +On s390 systems (aka mainframes), it has classic channel devices for +networking and permanent storage that are currently even more common +than PCI devices. Hence it could have a fully functional s390 kernel +with CONFIG_PCI=n, then the relevant iomem mapping functions +[including ioremap(), devm_ioremap(), etc.] are not available. + +Here let FSL_EDMA and INTEL_IDMA64 depend on HAS_IOMEM so that it +won't be built to cause below compiling error if PCI is unset. + +-------- +ERROR: modpost: "devm_platform_ioremap_resource" [drivers/dma/fsl-edma.ko] undefined! +ERROR: modpost: "devm_platform_ioremap_resource" [drivers/dma/idma64.ko] undefined! +-------- + +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202306211329.ticOJCSv-lkp@intel.com/ +Signed-off-by: Baoquan He +Cc: Vinod Koul +Cc: dmaengine@vger.kernel.org +Link: https://lore.kernel.org/r/20230707135852.24292-2-bhe@redhat.com +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/dma/Kconfig | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig +index 95344ae49e532..e1beddcc8c84a 100644 +--- a/drivers/dma/Kconfig ++++ b/drivers/dma/Kconfig +@@ -202,6 +202,7 @@ config FSL_DMA + config FSL_EDMA + tristate "Freescale eDMA engine support" + depends on OF ++ depends on HAS_IOMEM + select DMA_ENGINE + select DMA_VIRTUAL_CHANNELS + help +@@ -271,6 +272,7 @@ config IMX_SDMA + + config INTEL_IDMA64 + tristate "Intel integrated DMA 64-bit support" ++ depends on HAS_IOMEM + select DMA_ENGINE + select DMA_VIRTUAL_CHANNELS + help +-- +2.40.1 + diff --git a/queue-5.15/kprobes-prohibit-probing-on-cfi-preamble-symbol.patch b/queue-5.15/kprobes-prohibit-probing-on-cfi-preamble-symbol.patch new file mode 100644 index 00000000000..a6bde20e5e4 --- /dev/null +++ b/queue-5.15/kprobes-prohibit-probing-on-cfi-preamble-symbol.patch @@ -0,0 +1,56 @@ +From 582976542fa8dbd8be0cf1c9dd96abf6ea72da60 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 11 Jul 2023 10:50:47 +0900 +Subject: kprobes: Prohibit probing on CFI preamble symbol + +From: Masami Hiramatsu (Google) + +[ Upstream commit de02f2ac5d8cfb311f44f2bf144cc20002f1fbbd ] + +Do not allow to probe on "__cfi_" or "__pfx_" started symbol, because those +are used for CFI and not executed. Probing it will break the CFI. + +Link: https://lore.kernel.org/all/168904024679.116016.18089228029322008512.stgit@devnote2/ + +Signed-off-by: Masami Hiramatsu (Google) +Reviewed-by: Steven Rostedt (Google) +Signed-off-by: Sasha Levin +--- + kernel/kprobes.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/kernel/kprobes.c b/kernel/kprobes.c +index 7e9fa1b7ff671..6cf561322bbe6 100644 +--- a/kernel/kprobes.c ++++ b/kernel/kprobes.c +@@ -1545,6 +1545,17 @@ int __weak arch_check_ftrace_location(struct kprobe *p) + return 0; + } + ++static bool is_cfi_preamble_symbol(unsigned long addr) ++{ ++ char symbuf[KSYM_NAME_LEN]; ++ ++ if (lookup_symbol_name(addr, symbuf)) ++ return false; ++ ++ return str_has_prefix("__cfi_", symbuf) || ++ str_has_prefix("__pfx_", symbuf); ++} ++ + static int check_kprobe_address_safe(struct kprobe *p, + struct module **probed_mod) + { +@@ -1563,7 +1574,8 @@ static int check_kprobe_address_safe(struct kprobe *p, + within_kprobe_blacklist((unsigned long) p->addr) || + jump_label_text_reserved(p->addr, p->addr) || + static_call_text_reserved(p->addr, p->addr) || +- find_bug((unsigned long)p->addr)) { ++ find_bug((unsigned long)p->addr) || ++ is_cfi_preamble_symbol((unsigned long)p->addr)) { + ret = -EINVAL; + goto out; + } +-- +2.40.1 + diff --git a/queue-5.15/ksmbd-fix-out-of-bounds-in-smb3_decrypt_req.patch b/queue-5.15/ksmbd-fix-out-of-bounds-in-smb3_decrypt_req.patch new file mode 100644 index 00000000000..eb184276a28 --- /dev/null +++ b/queue-5.15/ksmbd-fix-out-of-bounds-in-smb3_decrypt_req.patch @@ -0,0 +1,37 @@ +From 0db7cb35f376fec19df58d0350aded28aeabbd9f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 22 Jul 2023 00:09:28 +0900 +Subject: ksmbd: fix out of bounds in smb3_decrypt_req() + +From: Namjae Jeon + +[ Upstream commit dc318846f3dd54574a36ae97fc8d8b75dd7cdb1e ] + +smb3_decrypt_req() validate if pdu_length is smaller than +smb2_transform_hdr size. + +Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21589 +Signed-off-by: Namjae Jeon +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/ksmbd/smb2pdu.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c +index 7983e8c9c89d0..f5506853ac0fa 100644 +--- a/fs/ksmbd/smb2pdu.c ++++ b/fs/ksmbd/smb2pdu.c +@@ -8649,7 +8649,8 @@ int smb3_decrypt_req(struct ksmbd_work *work) + struct smb2_transform_hdr *tr_hdr = (struct smb2_transform_hdr *)buf; + int rc = 0; + +- if (buf_data_size < sizeof(struct smb2_hdr)) { ++ if (pdu_length < sizeof(struct smb2_transform_hdr) || ++ buf_data_size < sizeof(struct smb2_hdr)) { + pr_err("Transform message is too small (%u)\n", + pdu_length); + return -ECONNABORTED; +-- +2.40.1 + diff --git a/queue-5.15/ksmbd-no-response-from-compound-read.patch b/queue-5.15/ksmbd-no-response-from-compound-read.patch new file mode 100644 index 00000000000..1132504b3ef --- /dev/null +++ b/queue-5.15/ksmbd-no-response-from-compound-read.patch @@ -0,0 +1,41 @@ +From c2f5b4cede4e6e6b73b4f23f3cbb794dcba8dba3 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 23 Jul 2023 15:22:33 +0900 +Subject: ksmbd: no response from compound read + +From: Namjae Jeon + +[ Upstream commit e202a1e8634b186da38cbbff85382ea2b9e297cf ] + +ksmbd doesn't support compound read. If client send read-read in +compound to ksmbd, there can be memory leak from read buffer. +Windows and linux clients doesn't send it to server yet. For now, +No response from compound read. compound read will be supported soon. + +Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21587, ZDI-CAN-21588 +Signed-off-by: Namjae Jeon +Signed-off-by: Steve French +Signed-off-by: Sasha Levin +--- + fs/ksmbd/smb2pdu.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c +index f5506853ac0fa..e0b54cd70f041 100644 +--- a/fs/ksmbd/smb2pdu.c ++++ b/fs/ksmbd/smb2pdu.c +@@ -6253,6 +6253,11 @@ int smb2_read(struct ksmbd_work *work) + + rsp_org = work->response_buf; + WORK_BUFFERS(work, req, rsp); ++ if (work->next_smb2_rcv_hdr_off) { ++ work->send_no_response = 1; ++ err = -EOPNOTSUPP; ++ goto out; ++ } + + if (test_share_config_flag(work->tcon->share_conf, + KSMBD_SHARE_FLAG_PIPE)) { +-- +2.40.1 + diff --git a/queue-5.15/m68k-fix-invalid-.section-syntax.patch b/queue-5.15/m68k-fix-invalid-.section-syntax.patch new file mode 100644 index 00000000000..f4080313262 --- /dev/null +++ b/queue-5.15/m68k-fix-invalid-.section-syntax.patch @@ -0,0 +1,100 @@ +From 1b5164061c495596f010adb655dac91193692d81 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 16 Jun 2023 17:36:10 +0200 +Subject: m68k: Fix invalid .section syntax + +From: Ben Hutchings + +[ Upstream commit 922a9bd138101e3e5718f0f4d40dba68ef89bb43 ] + +gas supports several different forms for .section for ELF targets, +including: + .section NAME [, "FLAGS"[, @TYPE[,FLAG_SPECIFIC_ARGUMENTS]]] +and: + .section "NAME"[, #FLAGS...] + +In several places we use a mix of these two forms: + .section NAME, #FLAGS... + +A current development snapshot of binutils (2.40.50.20230611) treats +this mixed syntax as an error. + +Change to consistently use: + .section NAME, "FLAGS" +as is used elsewhere in the kernel. + +Link: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=m68k&ver=6.4%7Erc6-1%7Eexp1&stamp=1686907300&raw=1 +Signed-off-by: Ben Hutchings +Tested-by: Jan-Benedict Glaw +Link: https://lore.kernel.org/r/ZIyBaueWT9jnTwRC@decadent.org.uk +Signed-off-by: Geert Uytterhoeven +Signed-off-by: Sasha Levin +--- + arch/m68k/fpsp040/skeleton.S | 4 ++-- + arch/m68k/ifpsp060/os.S | 4 ++-- + arch/m68k/kernel/relocate_kernel.S | 4 ++-- + 3 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/arch/m68k/fpsp040/skeleton.S b/arch/m68k/fpsp040/skeleton.S +index 439395aa6fb42..081922c72daaa 100644 +--- a/arch/m68k/fpsp040/skeleton.S ++++ b/arch/m68k/fpsp040/skeleton.S +@@ -499,13 +499,13 @@ in_ea: + dbf %d0,morein + rts + +- .section .fixup,#alloc,#execinstr ++ .section .fixup,"ax" + .even + 1: + jbsr fpsp040_die + jbra .Lnotkern + +- .section __ex_table,#alloc ++ .section __ex_table,"a" + .align 4 + + .long in_ea,1b +diff --git a/arch/m68k/ifpsp060/os.S b/arch/m68k/ifpsp060/os.S +index 7a0d6e4280665..89e2ec224ab6c 100644 +--- a/arch/m68k/ifpsp060/os.S ++++ b/arch/m68k/ifpsp060/os.S +@@ -379,11 +379,11 @@ _060_real_access: + + + | Execption handling for movs access to illegal memory +- .section .fixup,#alloc,#execinstr ++ .section .fixup,"ax" + .even + 1: moveq #-1,%d1 + rts +-.section __ex_table,#alloc ++.section __ex_table,"a" + .align 4 + .long dmrbuae,1b + .long dmrwuae,1b +diff --git a/arch/m68k/kernel/relocate_kernel.S b/arch/m68k/kernel/relocate_kernel.S +index ab0f1e7d46535..f7667079e08e9 100644 +--- a/arch/m68k/kernel/relocate_kernel.S ++++ b/arch/m68k/kernel/relocate_kernel.S +@@ -26,7 +26,7 @@ ENTRY(relocate_new_kernel) + lea %pc@(.Lcopy),%a4 + 2: addl #0x00000000,%a4 /* virt_to_phys() */ + +- .section ".m68k_fixup","aw" ++ .section .m68k_fixup,"aw" + .long M68K_FIXUP_MEMOFFSET, 2b+2 + .previous + +@@ -49,7 +49,7 @@ ENTRY(relocate_new_kernel) + lea %pc@(.Lcont040),%a4 + 5: addl #0x00000000,%a4 /* virt_to_phys() */ + +- .section ".m68k_fixup","aw" ++ .section .m68k_fixup,"aw" + .long M68K_FIXUP_MEMOFFSET, 5b+2 + .previous + +-- +2.40.1 + diff --git a/queue-5.15/media-pci-cx23885-fix-error-handling-for-cx23885-ats.patch b/queue-5.15/media-pci-cx23885-fix-error-handling-for-cx23885-ats.patch new file mode 100644 index 00000000000..e3284d82493 --- /dev/null +++ b/queue-5.15/media-pci-cx23885-fix-error-handling-for-cx23885-ats.patch @@ -0,0 +1,63 @@ +From 59558a64bba4b5b1eb011c796f3c6cb3487b9554 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 10 Jan 2023 10:09:00 +0100 +Subject: media: pci: cx23885: fix error handling for cx23885 ATSC boards + +From: Nikolay Burykin + +[ Upstream commit 4aaa96b59df5fac41ba891969df6b092061ea9d7 ] + +After having been assigned to NULL value at cx23885-dvb.c:1202, +pointer '0' is dereferenced at cx23885-dvb.c:2469. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Signed-off-by: Nikolay Burykin +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Sasha Levin +--- + drivers/media/pci/cx23885/cx23885-dvb.c | 12 ------------ + 1 file changed, 12 deletions(-) + +diff --git a/drivers/media/pci/cx23885/cx23885-dvb.c b/drivers/media/pci/cx23885/cx23885-dvb.c +index 45c2f4afceb82..9b437faf2c3f6 100644 +--- a/drivers/media/pci/cx23885/cx23885-dvb.c ++++ b/drivers/media/pci/cx23885/cx23885-dvb.c +@@ -2459,16 +2459,10 @@ static int dvb_register(struct cx23885_tsport *port) + request_module("%s", info.type); + client_tuner = i2c_new_client_device(&dev->i2c_bus[1].i2c_adap, &info); + if (!i2c_client_has_driver(client_tuner)) { +- module_put(client_demod->dev.driver->owner); +- i2c_unregister_device(client_demod); +- port->i2c_client_demod = NULL; + goto frontend_detach; + } + if (!try_module_get(client_tuner->dev.driver->owner)) { + i2c_unregister_device(client_tuner); +- module_put(client_demod->dev.driver->owner); +- i2c_unregister_device(client_demod); +- port->i2c_client_demod = NULL; + goto frontend_detach; + } + port->i2c_client_tuner = client_tuner; +@@ -2505,16 +2499,10 @@ static int dvb_register(struct cx23885_tsport *port) + request_module("%s", info.type); + client_tuner = i2c_new_client_device(&dev->i2c_bus[1].i2c_adap, &info); + if (!i2c_client_has_driver(client_tuner)) { +- module_put(client_demod->dev.driver->owner); +- i2c_unregister_device(client_demod); +- port->i2c_client_demod = NULL; + goto frontend_detach; + } + if (!try_module_get(client_tuner->dev.driver->owner)) { + i2c_unregister_device(client_tuner); +- module_put(client_demod->dev.driver->owner); +- i2c_unregister_device(client_demod); +- port->i2c_client_demod = NULL; + goto frontend_detach; + } + port->i2c_client_tuner = client_tuner; +-- +2.40.1 + diff --git a/queue-5.15/media-pulse8-cec-handle-possible-ping-error.patch b/queue-5.15/media-pulse8-cec-handle-possible-ping-error.patch new file mode 100644 index 00000000000..091f38d333d --- /dev/null +++ b/queue-5.15/media-pulse8-cec-handle-possible-ping-error.patch @@ -0,0 +1,42 @@ +From fdcd6c3893d0bb9c052e65196f862918f06a5610 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 6 Jun 2023 06:38:15 +0200 +Subject: media: pulse8-cec: handle possible ping error + +From: Dmitry Antipov + +[ Upstream commit 92cbf865ea2e0f2997ff97815c6db182eb23df1b ] + +Handle (and warn about) possible error waiting for MSGCODE_PING result. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Signed-off-by: Dmitry Antipov +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Sasha Levin +--- + drivers/media/cec/usb/pulse8/pulse8-cec.c | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/drivers/media/cec/usb/pulse8/pulse8-cec.c b/drivers/media/cec/usb/pulse8/pulse8-cec.c +index 04b13cdc38d2c..ba67587bd43ec 100644 +--- a/drivers/media/cec/usb/pulse8/pulse8-cec.c ++++ b/drivers/media/cec/usb/pulse8/pulse8-cec.c +@@ -809,8 +809,11 @@ static void pulse8_ping_eeprom_work_handler(struct work_struct *work) + + mutex_lock(&pulse8->lock); + cmd = MSGCODE_PING; +- pulse8_send_and_wait(pulse8, &cmd, 1, +- MSGCODE_COMMAND_ACCEPTED, 0); ++ if (pulse8_send_and_wait(pulse8, &cmd, 1, ++ MSGCODE_COMMAND_ACCEPTED, 0)) { ++ dev_warn(pulse8->dev, "failed to ping EEPROM\n"); ++ goto unlock; ++ } + + if (pulse8->vers < 2) + goto unlock; +-- +2.40.1 + diff --git a/queue-5.15/net-hns3-restore-user-pause-configure-when-disable-a.patch b/queue-5.15/net-hns3-restore-user-pause-configure-when-disable-a.patch new file mode 100644 index 00000000000..926496a9645 --- /dev/null +++ b/queue-5.15/net-hns3-restore-user-pause-configure-when-disable-a.patch @@ -0,0 +1,70 @@ +From 149ead52662e5b251086b097a58be1bd6692f37a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 7 Aug 2023 19:34:49 +0800 +Subject: net: hns3: restore user pause configure when disable autoneg + +From: Jian Shen + +[ Upstream commit 15159ec0c831b565820c2de05114ea1b4cf07681 ] + +Restore the mac pause state to user configuration when autoneg is disabled + +Signed-off-by: Jian Shen +Signed-off-by: Peiyang Wang +Signed-off-by: Jijie Shao +Reviewed-by: Leon Romanovsky +Link: https://lore.kernel.org/r/20230807113452.474224-2-shaojijie@huawei.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 ++++- + drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 2 +- + drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h | 1 + + 3 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +index 847ebb31d4701..1d424b1ee6cd3 100644 +--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c ++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +@@ -10993,9 +10993,12 @@ int hclge_cfg_flowctrl(struct hclge_dev *hdev) + u32 rx_pause, tx_pause; + u8 flowctl; + +- if (!phydev->link || !phydev->autoneg) ++ if (!phydev->link) + return 0; + ++ if (!phydev->autoneg) ++ return hclge_mac_pause_setup_hw(hdev); ++ + local_advertising = linkmode_adv_to_lcl_adv_t(phydev->advertising); + + if (phydev->pause) +diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c +index e7cb6a81e5b67..f5fe5e437bcd1 100644 +--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c ++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c +@@ -1429,7 +1429,7 @@ static int hclge_bp_setup_hw(struct hclge_dev *hdev, u8 tc) + return 0; + } + +-static int hclge_mac_pause_setup_hw(struct hclge_dev *hdev) ++int hclge_mac_pause_setup_hw(struct hclge_dev *hdev) + { + bool tx_en, rx_en; + +diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h +index 2c5256d7f9962..e1f2feaba5454 100644 +--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h ++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h +@@ -233,6 +233,7 @@ int hclge_pfc_pause_en_cfg(struct hclge_dev *hdev, u8 tx_rx_bitmap, + u8 pfc_bitmap); + int hclge_mac_pause_en_cfg(struct hclge_dev *hdev, bool tx, bool rx); + int hclge_pause_addr_cfg(struct hclge_dev *hdev, const u8 *mac_addr); ++int hclge_mac_pause_setup_hw(struct hclge_dev *hdev); + void hclge_pfc_rx_stats_get(struct hclge_dev *hdev, u64 *stats); + void hclge_pfc_tx_stats_get(struct hclge_dev *hdev, u64 *stats); + int hclge_tm_qs_shaper_cfg(struct hclge_vport *vport, int max_tx_rate); +-- +2.40.1 + diff --git a/queue-5.15/net-usb-qmi_wwan-add-quectel-em05gv2.patch b/queue-5.15/net-usb-qmi_wwan-add-quectel-em05gv2.patch new file mode 100644 index 00000000000..fc9abcab7ab --- /dev/null +++ b/queue-5.15/net-usb-qmi_wwan-add-quectel-em05gv2.patch @@ -0,0 +1,64 @@ +From 437aa84161141b5bd16978d5ba0ba514e7d6aba0 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 27 Jul 2023 20:00:43 +0000 +Subject: net: usb: qmi_wwan: add Quectel EM05GV2 + +From: Martin Kohn + +[ Upstream commit d4480c9bb9258db9ddf2e632f6ef81e96b41089c ] + +Add support for Quectel EM05GV2 (G=global) with vendor ID +0x2c7c and product ID 0x030e + +Enabling DTR on this modem was necessary to ensure stable operation. +Patch for usb: serial: option: is also in progress. + +T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=480 MxCh= 0 +D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 +P: Vendor=2c7c ProdID=030e Rev= 3.18 +S: Manufacturer=Quectel +S: Product=Quectel EM05-G +C:* #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA +I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option +E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=83(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=85(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=option +E: Ad=87(I) Atr=03(Int.) MxPS= 10 Ivl=32ms +E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms +I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan +E: Ad=89(I) Atr=03(Int.) MxPS= 8 Ivl=32ms +E: Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms +E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms + +Signed-off-by: Martin Kohn +Link: https://lore.kernel.org/r/AM0PR04MB57648219DE893EE04FA6CC759701A@AM0PR04MB5764.eurprd04.prod.outlook.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Sasha Levin +--- + drivers/net/usb/qmi_wwan.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c +index 9dde1f8358e3f..5c516bf4d3a5f 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -1412,6 +1412,7 @@ static const struct usb_device_id products[] = { + {QMI_QUIRK_SET_DTR(0x2c7c, 0x0191, 4)}, /* Quectel EG91 */ + {QMI_QUIRK_SET_DTR(0x2c7c, 0x0195, 4)}, /* Quectel EG95 */ + {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */ ++ {QMI_QUIRK_SET_DTR(0x2c7c, 0x030e, 4)}, /* Quectel EM05GV2 */ + {QMI_QUIRK_SET_DTR(0x2cb7, 0x0104, 4)}, /* Fibocom NL678 series */ + {QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */ + {QMI_FIXED_INTF(0x0489, 0xe0b5, 0)}, /* Foxconn T77W968 LTE with eSIM support*/ +-- +2.40.1 + diff --git a/queue-5.15/netlabel-fix-shift-wrapping-bug-in-netlbl_catmap_set.patch b/queue-5.15/netlabel-fix-shift-wrapping-bug-in-netlbl_catmap_set.patch new file mode 100644 index 00000000000..692b86f46e2 --- /dev/null +++ b/queue-5.15/netlabel-fix-shift-wrapping-bug-in-netlbl_catmap_set.patch @@ -0,0 +1,38 @@ +From 69b49e7265056bdb802114f02b0dd416ebc74f17 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 8 Jun 2023 16:57:54 +0300 +Subject: netlabel: fix shift wrapping bug in netlbl_catmap_setlong() + +From: Dmitry Mastykin + +[ Upstream commit b403643d154d15176b060b82f7fc605210033edd ] + +There is a shift wrapping bug in this code on 32-bit architectures. +NETLBL_CATMAP_MAPTYPE is u64, bitmap is unsigned long. +Every second 32-bit word of catmap becomes corrupted. + +Signed-off-by: Dmitry Mastykin +Acked-by: Paul Moore +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/netlabel/netlabel_kapi.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/net/netlabel/netlabel_kapi.c b/net/netlabel/netlabel_kapi.c +index 54c0830039470..27511c90a26f4 100644 +--- a/net/netlabel/netlabel_kapi.c ++++ b/net/netlabel/netlabel_kapi.c +@@ -857,7 +857,8 @@ int netlbl_catmap_setlong(struct netlbl_lsm_catmap **catmap, + + offset -= iter->startbit; + idx = offset / NETLBL_CATMAP_MAPSIZE; +- iter->bitmap[idx] |= bitmap << (offset % NETLBL_CATMAP_MAPSIZE); ++ iter->bitmap[idx] |= (NETLBL_CATMAP_MAPTYPE)bitmap ++ << (offset % NETLBL_CATMAP_MAPSIZE); + + return 0; + } +-- +2.40.1 + diff --git a/queue-5.15/ovl-always-reevaluate-the-file-signature-for-ima.patch b/queue-5.15/ovl-always-reevaluate-the-file-signature-for-ima.patch new file mode 100644 index 00000000000..4c94f154fea --- /dev/null +++ b/queue-5.15/ovl-always-reevaluate-the-file-signature-for-ima.patch @@ -0,0 +1,44 @@ +From 544915d18e1da97390084c88930bc4cced8e37df Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 25 Jul 2023 17:56:46 -0400 +Subject: ovl: Always reevaluate the file signature for IMA + +From: Eric Snowberg + +[ Upstream commit 18b44bc5a67275641fb26f2c54ba7eef80ac5950 ] + +Commit db1d1e8b9867 ("IMA: use vfs_getattr_nosec to get the i_version") +partially closed an IMA integrity issue when directly modifying a file +on the lower filesystem. If the overlay file is first opened by a user +and later the lower backing file is modified by root, but the extended +attribute is NOT updated, the signature validation succeeds with the old +original signature. + +Update the super_block s_iflags to SB_I_IMA_UNVERIFIABLE_SIGNATURE to +force signature reevaluation on every file access until a fine grained +solution can be found. + +Signed-off-by: Eric Snowberg +Signed-off-by: Mimi Zohar +Signed-off-by: Linus Torvalds +Signed-off-by: Sasha Levin +--- + fs/overlayfs/super.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c +index 5310271cf2e38..e18025b5c8872 100644 +--- a/fs/overlayfs/super.c ++++ b/fs/overlayfs/super.c +@@ -2140,7 +2140,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent) + ovl_trusted_xattr_handlers; + sb->s_fs_info = ofs; + sb->s_flags |= SB_POSIXACL; +- sb->s_iflags |= SB_I_SKIP_SYNC; ++ sb->s_iflags |= SB_I_SKIP_SYNC | SB_I_IMA_UNVERIFIABLE_SIGNATURE; + + err = -ENOMEM; + root_dentry = ovl_get_root(sb, upperpath.dentry, oe); +-- +2.40.1 + diff --git a/queue-5.15/phy-qcom-snps-femto-v2-use-qcom_snps_hsphy_suspend-r.patch b/queue-5.15/phy-qcom-snps-femto-v2-use-qcom_snps_hsphy_suspend-r.patch new file mode 100644 index 00000000000..dbe1403ed9a --- /dev/null +++ b/queue-5.15/phy-qcom-snps-femto-v2-use-qcom_snps_hsphy_suspend-r.patch @@ -0,0 +1,48 @@ +From f7ccd924bd16b02c44de390a4f4ecc2e50e36af2 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 29 Jun 2023 10:45:40 -0400 +Subject: phy: qcom-snps-femto-v2: use qcom_snps_hsphy_suspend/resume error + code + +From: Adrien Thierry + +[ Upstream commit 8932089b566c24ea19b57e37704c492678de1420 ] + +The return value from qcom_snps_hsphy_suspend/resume is not used. Make +sure qcom_snps_hsphy_runtime_suspend/resume return this value as well. + +Signed-off-by: Adrien Thierry +Link: https://lore.kernel.org/r/20230629144542.14906-4-athierry@redhat.com +Signed-off-by: Vinod Koul +Signed-off-by: Sasha Levin +--- + drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +index abb9264569336..173d166ed8295 100644 +--- a/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c ++++ b/drivers/phy/qualcomm/phy-qcom-snps-femto-v2.c +@@ -171,8 +171,7 @@ static int __maybe_unused qcom_snps_hsphy_runtime_suspend(struct device *dev) + if (!hsphy->phy_initialized) + return 0; + +- qcom_snps_hsphy_suspend(hsphy); +- return 0; ++ return qcom_snps_hsphy_suspend(hsphy); + } + + static int __maybe_unused qcom_snps_hsphy_runtime_resume(struct device *dev) +@@ -182,8 +181,7 @@ static int __maybe_unused qcom_snps_hsphy_runtime_resume(struct device *dev) + if (!hsphy->phy_initialized) + return 0; + +- qcom_snps_hsphy_resume(hsphy); +- return 0; ++ return qcom_snps_hsphy_resume(hsphy); + } + + static int qcom_snps_hsphy_set_mode(struct phy *phy, enum phy_mode mode, +-- +2.40.1 + diff --git a/queue-5.15/platform-mellanox-fix-mlxbf-tmfifo-not-handling-all-.patch b/queue-5.15/platform-mellanox-fix-mlxbf-tmfifo-not-handling-all-.patch new file mode 100644 index 00000000000..060e71e058b --- /dev/null +++ b/queue-5.15/platform-mellanox-fix-mlxbf-tmfifo-not-handling-all-.patch @@ -0,0 +1,40 @@ +From eca076d95d35be1b0123443376649a7e93fec851 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 21 Aug 2023 11:06:27 -0400 +Subject: platform/mellanox: Fix mlxbf-tmfifo not handling all virtio CONSOLE + notifications + +From: Shih-Yi Chen + +[ Upstream commit 0848cab765c634597636810bf76d0934003cce28 ] + +rshim console does not show all entries of dmesg. + +Fixed by setting MLXBF_TM_TX_LWM_IRQ for every CONSOLE notification. + +Signed-off-by: Shih-Yi Chen +Reviewed-by: Liming Sung +Reviewed-by: David Thompson +Link: https://lore.kernel.org/r/20230821150627.26075-1-shihyic@nvidia.com +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/mellanox/mlxbf-tmfifo.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/platform/mellanox/mlxbf-tmfifo.c b/drivers/platform/mellanox/mlxbf-tmfifo.c +index 38800e86ed8ad..64d22ecf3cddd 100644 +--- a/drivers/platform/mellanox/mlxbf-tmfifo.c ++++ b/drivers/platform/mellanox/mlxbf-tmfifo.c +@@ -868,6 +868,7 @@ static bool mlxbf_tmfifo_virtio_notify(struct virtqueue *vq) + tm_vdev = fifo->vdev[VIRTIO_ID_CONSOLE]; + mlxbf_tmfifo_console_output(tm_vdev, vring); + spin_unlock_irqrestore(&fifo->spin_lock[0], flags); ++ set_bit(MLXBF_TM_TX_LWM_IRQ, &fifo->pend_events); + } else if (test_and_set_bit(MLXBF_TM_TX_LWM_IRQ, + &fifo->pend_events)) { + return true; +-- +2.40.1 + diff --git a/queue-5.15/platform-x86-huawei-wmi-silence-ambient-light-sensor.patch b/queue-5.15/platform-x86-huawei-wmi-silence-ambient-light-sensor.patch new file mode 100644 index 00000000000..90210b1dba3 --- /dev/null +++ b/queue-5.15/platform-x86-huawei-wmi-silence-ambient-light-sensor.patch @@ -0,0 +1,55 @@ +From 330f68f8c16e69b6f3638547ff13175618c5418f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 22 Jul 2023 18:59:20 +0300 +Subject: platform/x86: huawei-wmi: Silence ambient light sensor + +From: Konstantin Shelekhin + +[ Upstream commit c21733754cd6ecbca346f2adf9b17d4cfa50504f ] + +Currently huawei-wmi causes a lot of spam in dmesg on my +Huawei MateBook X Pro 2022: + + ... + [36409.328463] input input9: Unknown key pressed, code: 0x02c1 + [36411.335104] input input9: Unknown key pressed, code: 0x02c1 + [36412.338674] input input9: Unknown key pressed, code: 0x02c1 + [36414.848564] input input9: Unknown key pressed, code: 0x02c1 + [36416.858706] input input9: Unknown key pressed, code: 0x02c1 + ... + +Fix that by ignoring events generated by ambient light sensor. + +This issue was reported on GitHub and resolved with the following merge +request: + + https://github.com/aymanbagabas/Huawei-WMI/pull/70 + +I've contacted the mainter of this repo and he gave me the "go ahead" to +send this patch to the maling list. + +Signed-off-by: Konstantin Shelekhin +Link: https://lore.kernel.org/r/20230722155922.173856-1-k.shelekhin@ftml.net +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/huawei-wmi.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/platform/x86/huawei-wmi.c b/drivers/platform/x86/huawei-wmi.c +index 935562c870c3d..23ebd0c046e16 100644 +--- a/drivers/platform/x86/huawei-wmi.c ++++ b/drivers/platform/x86/huawei-wmi.c +@@ -86,6 +86,8 @@ static const struct key_entry huawei_wmi_keymap[] = { + { KE_IGNORE, 0x293, { KEY_KBDILLUMTOGGLE } }, + { KE_IGNORE, 0x294, { KEY_KBDILLUMUP } }, + { KE_IGNORE, 0x295, { KEY_KBDILLUMUP } }, ++ // Ignore Ambient Light Sensoring ++ { KE_KEY, 0x2c1, { KEY_RESERVED } }, + { KE_END, 0 } + }; + +-- +2.40.1 + diff --git a/queue-5.15/platform-x86-intel-hid-add-hp-dragonfly-g2-to-vgbs-d.patch b/queue-5.15/platform-x86-intel-hid-add-hp-dragonfly-g2-to-vgbs-d.patch new file mode 100644 index 00000000000..a31734ba502 --- /dev/null +++ b/queue-5.15/platform-x86-intel-hid-add-hp-dragonfly-g2-to-vgbs-d.patch @@ -0,0 +1,51 @@ +From 816092bef2300eb058f9e11a5548164b791bc82c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 16 Jul 2023 21:32:13 +0300 +Subject: platform/x86/intel/hid: Add HP Dragonfly G2 to VGBS DMI quirks + +From: Maxim Mikityanskiy + +[ Upstream commit 7783e97f8558ad7a4d1748922461bc88483fbcdf ] + +HP Elite Dragonfly G2 (a convertible laptop/tablet) has a reliable VGBS +method. If VGBS is not called on boot, the firmware sends an initial +0xcd event shortly after calling the BTNL method, but only if the device +is booted in the laptop mode. However, if the device is booted in the +tablet mode and VGBS is not called, there is no initial 0xcc event, and +the input device for SW_TABLET_MODE is not registered up until the user +turns the device into the laptop mode. + +Call VGBS on boot on this device to get the initial state of +SW_TABLET_MODE in a reliable way. + +Tested with BIOS 1.13.1. + +Signed-off-by: Maxim Mikityanskiy +Link: https://lore.kernel.org/r/20230716183213.64173-1-maxtram95@gmail.com +Reviewed-by: Hans de Goede +Signed-off-by: Hans de Goede +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/intel/hid.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/drivers/platform/x86/intel/hid.c b/drivers/platform/x86/intel/hid.c +index 73ecbdfcfb7c0..f59a3cc9767b9 100644 +--- a/drivers/platform/x86/intel/hid.c ++++ b/drivers/platform/x86/intel/hid.c +@@ -138,6 +138,12 @@ static const struct dmi_system_id dmi_vgbs_allow_list[] = { + DMI_MATCH(DMI_PRODUCT_NAME, "Surface Go"), + }, + }, ++ { ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "HP"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "HP Elite Dragonfly G2 Notebook PC"), ++ }, ++ }, + { } + }; + +-- +2.40.1 + diff --git a/queue-5.15/platform-x86-intel-hid-always-call-btnl-acpi-method.patch b/queue-5.15/platform-x86-intel-hid-always-call-btnl-acpi-method.patch new file mode 100644 index 00000000000..8c88d3f5cb1 --- /dev/null +++ b/queue-5.15/platform-x86-intel-hid-always-call-btnl-acpi-method.patch @@ -0,0 +1,73 @@ +From b7782dda8be6d867933440f8c158d72002dd13c9 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 15 Jul 2023 20:15:16 +0200 +Subject: platform/x86: intel: hid: Always call BTNL ACPI method + +From: Hans de Goede + +[ Upstream commit e3ab18de2b09361d6f0e4aafb9cfd6d002ce43a1 ] + +On a HP Elite Dragonfly G2 the 0xcc and 0xcd events for SW_TABLET_MODE +are only send after the BTNL ACPI method has been called. + +Likely more devices need this, so make the BTNL ACPI method unconditional +instead of only doing it on devices with a 5 button array. + +Note this also makes the intel_button_array_enable() call in probe() +unconditional, that function does its own priv->array check. This makes +the intel_button_array_enable() call in probe() consistent with the calls +done on suspend/resume which also rely on the priv->array check inside +the function. + +Reported-by: Maxim Mikityanskiy +Closes: https://lore.kernel.org/platform-driver-x86/20230712175023.31651-1-maxtram95@gmail.com/ +Signed-off-by: Hans de Goede +Link: https://lore.kernel.org/r/20230715181516.5173-1-hdegoede@redhat.com +Signed-off-by: Sasha Levin +--- + drivers/platform/x86/intel/hid.c | 21 +++++++++------------ + 1 file changed, 9 insertions(+), 12 deletions(-) + +diff --git a/drivers/platform/x86/intel/hid.c b/drivers/platform/x86/intel/hid.c +index 4d1c78635114e..73ecbdfcfb7c0 100644 +--- a/drivers/platform/x86/intel/hid.c ++++ b/drivers/platform/x86/intel/hid.c +@@ -608,7 +608,7 @@ static bool button_array_present(struct platform_device *device) + static int intel_hid_probe(struct platform_device *device) + { + acpi_handle handle = ACPI_HANDLE(&device->dev); +- unsigned long long mode; ++ unsigned long long mode, dummy; + struct intel_hid_priv *priv; + acpi_status status; + int err; +@@ -673,18 +673,15 @@ static int intel_hid_probe(struct platform_device *device) + if (err) + goto err_remove_notify; + +- if (priv->array) { +- unsigned long long dummy; ++ intel_button_array_enable(&device->dev, true); + +- intel_button_array_enable(&device->dev, true); +- +- /* Call button load method to enable HID power button */ +- if (!intel_hid_evaluate_method(handle, INTEL_HID_DSM_BTNL_FN, +- &dummy)) { +- dev_warn(&device->dev, +- "failed to enable HID power button\n"); +- } +- } ++ /* ++ * Call button load method to enable HID power button ++ * Always do this since it activates events on some devices without ++ * a button array too. ++ */ ++ if (!intel_hid_evaluate_method(handle, INTEL_HID_DSM_BTNL_FN, &dummy)) ++ dev_warn(&device->dev, "failed to enable HID power button\n"); + + device_init_wakeup(&device->dev, true); + /* +-- +2.40.1 + diff --git a/queue-5.15/s390-dasd-fix-hanging-device-after-request-requeue.patch b/queue-5.15/s390-dasd-fix-hanging-device-after-request-requeue.patch new file mode 100644 index 00000000000..26aa95f043c --- /dev/null +++ b/queue-5.15/s390-dasd-fix-hanging-device-after-request-requeue.patch @@ -0,0 +1,222 @@ +From 78a7f958f35b38f505f86c5854c77ad1a72cde6f Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 21 Jul 2023 21:36:46 +0200 +Subject: s390/dasd: fix hanging device after request requeue + +From: Stefan Haberland + +[ Upstream commit 8a2278ce9c25048d999fe1a3561def75d963f471 ] + +The DASD device driver has a function to requeue requests to the +blocklayer. +This function is used in various cases when basic settings for the device +have to be changed like High Performance Ficon related parameters or copy +pair settings. + +The functions iterates over the device->ccw_queue and also removes the +requests from the block->ccw_queue. +In case the device is started on an alias device instead of the base +device it might be removed from the block->ccw_queue without having it +canceled properly before. This might lead to a hanging device since the +request is no longer on a queue and can not be handled properly. + +Fix by iterating over the block->ccw_queue instead of the +device->ccw_queue. This will take care of all blocklayer related requests +and handle them on all associated DASD devices. + +Signed-off-by: Stefan Haberland +Reviewed-by: Jan Hoeppner +Link: https://lore.kernel.org/r/20230721193647.3889634-4-sth@linux.ibm.com +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + drivers/s390/block/dasd.c | 125 +++++++++++++++----------------------- + 1 file changed, 48 insertions(+), 77 deletions(-) + +diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c +index ed897dc499ff6..0c6ab288201e5 100644 +--- a/drivers/s390/block/dasd.c ++++ b/drivers/s390/block/dasd.c +@@ -2948,41 +2948,32 @@ static void _dasd_wake_block_flush_cb(struct dasd_ccw_req *cqr, void *data) + * Requeue a request back to the block request queue + * only works for block requests + */ +-static int _dasd_requeue_request(struct dasd_ccw_req *cqr) ++static void _dasd_requeue_request(struct dasd_ccw_req *cqr) + { +- struct dasd_block *block = cqr->block; + struct request *req; + +- if (!block) +- return -EINVAL; + /* + * If the request is an ERP request there is nothing to requeue. + * This will be done with the remaining original request. + */ + if (cqr->refers) +- return 0; ++ return; + spin_lock_irq(&cqr->dq->lock); + req = (struct request *) cqr->callback_data; + blk_mq_requeue_request(req, true); + spin_unlock_irq(&cqr->dq->lock); + +- return 0; ++ return; + } + +-/* +- * Go through all request on the dasd_block request queue, cancel them +- * on the respective dasd_device, and return them to the generic +- * block layer. +- */ +-static int dasd_flush_block_queue(struct dasd_block *block) ++static int _dasd_requests_to_flushqueue(struct dasd_block *block, ++ struct list_head *flush_queue) + { + struct dasd_ccw_req *cqr, *n; +- int rc, i; +- struct list_head flush_queue; + unsigned long flags; ++ int rc, i; + +- INIT_LIST_HEAD(&flush_queue); +- spin_lock_bh(&block->queue_lock); ++ spin_lock_irqsave(&block->queue_lock, flags); + rc = 0; + restart: + list_for_each_entry_safe(cqr, n, &block->ccw_queue, blocklist) { +@@ -2997,13 +2988,32 @@ static int dasd_flush_block_queue(struct dasd_block *block) + * is returned from the dasd_device layer. + */ + cqr->callback = _dasd_wake_block_flush_cb; +- for (i = 0; cqr != NULL; cqr = cqr->refers, i++) +- list_move_tail(&cqr->blocklist, &flush_queue); ++ for (i = 0; cqr; cqr = cqr->refers, i++) ++ list_move_tail(&cqr->blocklist, flush_queue); + if (i > 1) + /* moved more than one request - need to restart */ + goto restart; + } +- spin_unlock_bh(&block->queue_lock); ++ spin_unlock_irqrestore(&block->queue_lock, flags); ++ ++ return rc; ++} ++ ++/* ++ * Go through all request on the dasd_block request queue, cancel them ++ * on the respective dasd_device, and return them to the generic ++ * block layer. ++ */ ++static int dasd_flush_block_queue(struct dasd_block *block) ++{ ++ struct dasd_ccw_req *cqr, *n; ++ struct list_head flush_queue; ++ unsigned long flags; ++ int rc; ++ ++ INIT_LIST_HEAD(&flush_queue); ++ rc = _dasd_requests_to_flushqueue(block, &flush_queue); ++ + /* Now call the callback function of flushed requests */ + restart_cb: + list_for_each_entry_safe(cqr, n, &flush_queue, blocklist) { +@@ -3926,75 +3936,36 @@ EXPORT_SYMBOL_GPL(dasd_generic_space_avail); + */ + static int dasd_generic_requeue_all_requests(struct dasd_device *device) + { ++ struct dasd_block *block = device->block; + struct list_head requeue_queue; + struct dasd_ccw_req *cqr, *n; +- struct dasd_ccw_req *refers; + int rc; + +- INIT_LIST_HEAD(&requeue_queue); +- spin_lock_irq(get_ccwdev_lock(device->cdev)); +- rc = 0; +- list_for_each_entry_safe(cqr, n, &device->ccw_queue, devlist) { +- /* Check status and move request to flush_queue */ +- if (cqr->status == DASD_CQR_IN_IO) { +- rc = device->discipline->term_IO(cqr); +- if (rc) { +- /* unable to terminate requeust */ +- dev_err(&device->cdev->dev, +- "Unable to terminate request %p " +- "on suspend\n", cqr); +- spin_unlock_irq(get_ccwdev_lock(device->cdev)); +- dasd_put_device(device); +- return rc; +- } +- } +- list_move_tail(&cqr->devlist, &requeue_queue); +- } +- spin_unlock_irq(get_ccwdev_lock(device->cdev)); +- +- list_for_each_entry_safe(cqr, n, &requeue_queue, devlist) { +- wait_event(dasd_flush_wq, +- (cqr->status != DASD_CQR_CLEAR_PENDING)); ++ if (!block) ++ return 0; + +- /* +- * requeue requests to blocklayer will only work +- * for block device requests +- */ +- if (_dasd_requeue_request(cqr)) +- continue; ++ INIT_LIST_HEAD(&requeue_queue); ++ rc = _dasd_requests_to_flushqueue(block, &requeue_queue); + +- /* remove requests from device and block queue */ +- list_del_init(&cqr->devlist); +- while (cqr->refers != NULL) { +- refers = cqr->refers; +- /* remove the request from the block queue */ +- list_del(&cqr->blocklist); +- /* free the finished erp request */ +- dasd_free_erp_request(cqr, cqr->memdev); +- cqr = refers; ++ /* Now call the callback function of flushed requests */ ++restart_cb: ++ list_for_each_entry_safe(cqr, n, &requeue_queue, blocklist) { ++ wait_event(dasd_flush_wq, (cqr->status < DASD_CQR_QUEUED)); ++ /* Process finished ERP request. */ ++ if (cqr->refers) { ++ spin_lock_bh(&block->queue_lock); ++ __dasd_process_erp(block->base, cqr); ++ spin_unlock_bh(&block->queue_lock); ++ /* restart list_for_xx loop since dasd_process_erp ++ * might remove multiple elements ++ */ ++ goto restart_cb; + } +- +- /* +- * _dasd_requeue_request already checked for a valid +- * blockdevice, no need to check again +- * all erp requests (cqr->refers) have a cqr->block +- * pointer copy from the original cqr +- */ ++ _dasd_requeue_request(cqr); + list_del_init(&cqr->blocklist); + cqr->block->base->discipline->free_cp( + cqr, (struct request *) cqr->callback_data); + } +- +- /* +- * if requests remain then they are internal request +- * and go back to the device queue +- */ +- if (!list_empty(&requeue_queue)) { +- /* move freeze_queue to start of the ccw_queue */ +- spin_lock_irq(get_ccwdev_lock(device->cdev)); +- list_splice_tail(&requeue_queue, &device->ccw_queue); +- spin_unlock_irq(get_ccwdev_lock(device->cdev)); +- } + dasd_schedule_device_bh(device); + return rc; + } +-- +2.40.1 + diff --git a/queue-5.15/s390-dasd-use-correct-number-of-retries-for-erp-requ.patch b/queue-5.15/s390-dasd-use-correct-number-of-retries-for-erp-requ.patch new file mode 100644 index 00000000000..17d409b63ce --- /dev/null +++ b/queue-5.15/s390-dasd-use-correct-number-of-retries-for-erp-requ.patch @@ -0,0 +1,45 @@ +From 26dfb1f9d6bd4e1a41d74a184244802c7b7a036d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 21 Jul 2023 21:36:45 +0200 +Subject: s390/dasd: use correct number of retries for ERP requests + +From: Stefan Haberland + +[ Upstream commit acea28a6b74f458defda7417d2217b051ba7d444 ] + +If a DASD request fails an error recovery procedure (ERP) request might +be built as a copy of the original request to do error recovery. + +The ERP request gets a number of retries assigned. +This number is always 256 no matter what other value might have been set +for the original request. This is not what is expected when a user +specifies a certain amount of retries for the device via sysfs. + +Correctly use the number of retries of the original request for ERP +requests. + +Signed-off-by: Stefan Haberland +Reviewed-by: Jan Hoeppner +Link: https://lore.kernel.org/r/20230721193647.3889634-3-sth@linux.ibm.com +Signed-off-by: Jens Axboe +Signed-off-by: Sasha Levin +--- + drivers/s390/block/dasd_3990_erp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/s390/block/dasd_3990_erp.c b/drivers/s390/block/dasd_3990_erp.c +index 4691a3c35d725..c2d4ea74e0d00 100644 +--- a/drivers/s390/block/dasd_3990_erp.c ++++ b/drivers/s390/block/dasd_3990_erp.c +@@ -2436,7 +2436,7 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr) + erp->block = cqr->block; + erp->magic = cqr->magic; + erp->expires = cqr->expires; +- erp->retries = 256; ++ erp->retries = device->default_retries; + erp->buildclk = get_tod_clock(); + erp->status = DASD_CQR_FILLED; + +-- +2.40.1 + diff --git a/queue-5.15/scsi-lpfc-fix-incorrect-big-endian-type-assignment-i.patch b/queue-5.15/scsi-lpfc-fix-incorrect-big-endian-type-assignment-i.patch new file mode 100644 index 00000000000..a9565485d93 --- /dev/null +++ b/queue-5.15/scsi-lpfc-fix-incorrect-big-endian-type-assignment-i.patch @@ -0,0 +1,62 @@ +From 31a6039665fcc86422654d88039fcb7b94d66b25 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 14 Jun 2023 10:59:44 -0700 +Subject: scsi: lpfc: Fix incorrect big endian type assignment in bsg loopback + path + +From: Justin Tee + +[ Upstream commit 9cefd6e7e0a77b0fbca5c793f6fb6821b0962775 ] + +The kernel test robot reported sparse warnings regarding incorrect type +assignment for __be16 variables in bsg loopback path. + +Change the flagged lines to use the be16_to_cpu() and cpu_to_be16() macros +appropriately. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20230614175944.3577-1-justintee8345@gmail.com +Reported-by: kernel test robot +Closes: https://lore.kernel.org/oe-kbuild-all/202306110819.sDIKiGgg-lkp@intel.com/ +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/lpfc/lpfc_bsg.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/drivers/scsi/lpfc/lpfc_bsg.c b/drivers/scsi/lpfc/lpfc_bsg.c +index fdf08cb572071..ed827f198cb68 100644 +--- a/drivers/scsi/lpfc/lpfc_bsg.c ++++ b/drivers/scsi/lpfc/lpfc_bsg.c +@@ -911,7 +911,7 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, + struct lpfc_iocbq *piocbq) + { + uint32_t evt_req_id = 0; +- uint32_t cmd; ++ u16 cmd; + struct lpfc_dmabuf *dmabuf = NULL; + struct lpfc_bsg_event *evt; + struct event_data *evt_dat = NULL; +@@ -936,7 +936,7 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, + + ct_req = (struct lpfc_sli_ct_request *)bdeBuf1->virt; + evt_req_id = ct_req->FsType; +- cmd = ct_req->CommandResponse.bits.CmdRsp; ++ cmd = be16_to_cpu(ct_req->CommandResponse.bits.CmdRsp); + + spin_lock_irqsave(&phba->ct_ev_lock, flags); + list_for_each_entry(evt, &phba->ct_ev_waiters, node) { +@@ -3243,8 +3243,8 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job) + ctreq->RevisionId.bits.InId = 0; + ctreq->FsType = SLI_CT_ELX_LOOPBACK; + ctreq->FsSubType = 0; +- ctreq->CommandResponse.bits.CmdRsp = ELX_LOOPBACK_DATA; +- ctreq->CommandResponse.bits.Size = size; ++ ctreq->CommandResponse.bits.CmdRsp = cpu_to_be16(ELX_LOOPBACK_DATA); ++ ctreq->CommandResponse.bits.Size = cpu_to_be16(size); + segment_offset = ELX_LOOPBACK_HEADER_SZ; + } else + segment_offset = 0; +-- +2.40.1 + diff --git a/queue-5.15/scsi-lpfc-remove-reftag-check-in-dif-paths.patch b/queue-5.15/scsi-lpfc-remove-reftag-check-in-dif-paths.patch new file mode 100644 index 00000000000..0bdcf774da3 --- /dev/null +++ b/queue-5.15/scsi-lpfc-remove-reftag-check-in-dif-paths.patch @@ -0,0 +1,108 @@ +From 60a9368dca1ed97fae47980ff05e88c52b121b77 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 3 Aug 2023 14:19:32 -0700 +Subject: scsi: lpfc: Remove reftag check in DIF paths + +From: Justin Tee + +[ Upstream commit 8eebf0e84f0614cebc7347f7bbccba4056d77d42 ] + +When preparing protection DIF I/O for DMA, the driver obtains reference +tags from scsi_prot_ref_tag(). Previously, there was a wrong assumption +that an all 0xffffffff value meant error and thus the driver failed the +I/O. This patch removes the evaluation code and accepts whatever the upper +layer returns. + +Signed-off-by: Justin Tee +Link: https://lore.kernel.org/r/20230803211932.155745-1-justintee8345@gmail.com +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/lpfc/lpfc_scsi.c | 20 +++----------------- + 1 file changed, 3 insertions(+), 17 deletions(-) + +diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c +index edae98a35fc3b..4813adec0301d 100644 +--- a/drivers/scsi/lpfc/lpfc_scsi.c ++++ b/drivers/scsi/lpfc/lpfc_scsi.c +@@ -117,8 +117,6 @@ lpfc_sli4_set_rsp_sgl_last(struct lpfc_hba *phba, + } + } + +-#define LPFC_INVALID_REFTAG ((u32)-1) +- + /** + * lpfc_update_stats - Update statistical data for the command completion + * @vport: The virtual port on which this call is executing. +@@ -1042,8 +1040,6 @@ lpfc_bg_err_inject(struct lpfc_hba *phba, struct scsi_cmnd *sc, + + sgpe = scsi_prot_sglist(sc); + lba = scsi_prot_ref_tag(sc); +- if (lba == LPFC_INVALID_REFTAG) +- return 0; + + /* First check if we need to match the LBA */ + if (phba->lpfc_injerr_lba != LPFC_INJERR_LBA_OFF) { +@@ -1624,8 +1620,6 @@ lpfc_bg_setup_bpl(struct lpfc_hba *phba, struct scsi_cmnd *sc, + + /* extract some info from the scsi command for pde*/ + reftag = scsi_prot_ref_tag(sc); +- if (reftag == LPFC_INVALID_REFTAG) +- goto out; + + #ifdef CONFIG_SCSI_LPFC_DEBUG_FS + rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); +@@ -1787,8 +1781,6 @@ lpfc_bg_setup_bpl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, + /* extract some info from the scsi command */ + blksize = scsi_prot_interval(sc); + reftag = scsi_prot_ref_tag(sc); +- if (reftag == LPFC_INVALID_REFTAG) +- goto out; + + #ifdef CONFIG_SCSI_LPFC_DEBUG_FS + rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); +@@ -2018,8 +2010,6 @@ lpfc_bg_setup_sgl(struct lpfc_hba *phba, struct scsi_cmnd *sc, + + /* extract some info from the scsi command for pde*/ + reftag = scsi_prot_ref_tag(sc); +- if (reftag == LPFC_INVALID_REFTAG) +- goto out; + + #ifdef CONFIG_SCSI_LPFC_DEBUG_FS + rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); +@@ -2219,8 +2209,6 @@ lpfc_bg_setup_sgl_prot(struct lpfc_hba *phba, struct scsi_cmnd *sc, + /* extract some info from the scsi command */ + blksize = scsi_prot_interval(sc); + reftag = scsi_prot_ref_tag(sc); +- if (reftag == LPFC_INVALID_REFTAG) +- goto out; + + #ifdef CONFIG_SCSI_LPFC_DEBUG_FS + rc = lpfc_bg_err_inject(phba, sc, &reftag, NULL, 1); +@@ -2812,8 +2800,6 @@ lpfc_calc_bg_err(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_cmd) + + src = (struct scsi_dif_tuple *)sg_virt(sgpe); + start_ref_tag = scsi_prot_ref_tag(cmd); +- if (start_ref_tag == LPFC_INVALID_REFTAG) +- goto out; + start_app_tag = src->app_tag; + len = sgpe->length; + while (src && protsegcnt) { +@@ -3660,11 +3646,11 @@ lpfc_bg_scsi_prep_dma_buf_s4(struct lpfc_hba *phba, + scsi_cmnd->sc_data_direction); + + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, +- "9084 Cannot setup S/G List for HBA" +- "IO segs %d/%d SGL %d SCSI %d: %d %d\n", ++ "9084 Cannot setup S/G List for HBA " ++ "IO segs %d/%d SGL %d SCSI %d: %d %d %d\n", + lpfc_cmd->seg_cnt, lpfc_cmd->prot_seg_cnt, + phba->cfg_total_seg_cnt, phba->cfg_sg_seg_cnt, +- prot_group_type, num_sge); ++ prot_group_type, num_sge, ret); + + lpfc_cmd->seg_cnt = 0; + lpfc_cmd->prot_seg_cnt = 0; +-- +2.40.1 + diff --git a/queue-5.15/scsi-qedi-fix-potential-deadlock-on-qedi_percpu-p_wo.patch b/queue-5.15/scsi-qedi-fix-potential-deadlock-on-qedi_percpu-p_wo.patch new file mode 100644 index 00000000000..23db8bb0c4f --- /dev/null +++ b/queue-5.15/scsi-qedi-fix-potential-deadlock-on-qedi_percpu-p_wo.patch @@ -0,0 +1,67 @@ +From e3225eaf764e32f98c91ff9918178b15d4fa889c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 26 Jul 2023 12:56:55 +0000 +Subject: scsi: qedi: Fix potential deadlock on &qedi_percpu->p_work_lock + +From: Chengfeng Ye + +[ Upstream commit dd64f80587190265ca8a0f4be6c64c2fda6d3ac2 ] + +As &qedi_percpu->p_work_lock is acquired by hard IRQ qedi_msix_handler(), +other acquisitions of the same lock under process context should disable +IRQ, otherwise deadlock could happen if the IRQ preempts the execution +while the lock is held in process context on the same CPU. + +qedi_cpu_offline() is one such function which acquires the lock in process +context. + +[Deadlock Scenario] +qedi_cpu_offline() + ->spin_lock(&p->p_work_lock) + + ->qedi_msix_handler() + ->edi_process_completions() + ->spin_lock_irqsave(&p->p_work_lock, flags); (deadlock here) + +This flaw was found by an experimental static analysis tool I am developing +for IRQ-related deadlocks. + +The tentative patch fix the potential deadlock by spin_lock_irqsave() +under process context. + +Signed-off-by: Chengfeng Ye +Link: https://lore.kernel.org/r/20230726125655.4197-1-dg573847474@gmail.com +Acked-by: Manish Rangankar +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/qedi/qedi_main.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c +index d2fe8ae97abc9..b36edbef5b82f 100644 +--- a/drivers/scsi/qedi/qedi_main.c ++++ b/drivers/scsi/qedi/qedi_main.c +@@ -1979,8 +1979,9 @@ static int qedi_cpu_offline(unsigned int cpu) + struct qedi_percpu_s *p = this_cpu_ptr(&qedi_percpu); + struct qedi_work *work, *tmp; + struct task_struct *thread; ++ unsigned long flags; + +- spin_lock_bh(&p->p_work_lock); ++ spin_lock_irqsave(&p->p_work_lock, flags); + thread = p->iothread; + p->iothread = NULL; + +@@ -1991,7 +1992,7 @@ static int qedi_cpu_offline(unsigned int cpu) + kfree(work); + } + +- spin_unlock_bh(&p->p_work_lock); ++ spin_unlock_irqrestore(&p->p_work_lock, flags); + if (thread) + kthread_stop(thread); + return 0; +-- +2.40.1 + diff --git a/queue-5.15/scsi-storvsc-always-set-no_report_opcodes.patch b/queue-5.15/scsi-storvsc-always-set-no_report_opcodes.patch new file mode 100644 index 00000000000..0f20920a977 --- /dev/null +++ b/queue-5.15/scsi-storvsc-always-set-no_report_opcodes.patch @@ -0,0 +1,48 @@ +From 8e05468559537d9dd5ed2081fc811b85f52f339e Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Jun 2023 13:38:21 -0700 +Subject: scsi: storvsc: Always set no_report_opcodes + +From: Michael Kelley + +[ Upstream commit 31d16e712bdcaee769de4780f72ff8d6cd3f0589 ] + +Hyper-V synthetic SCSI devices do not support the MAINTENANCE_IN SCSI +command, so scsi_report_opcode() always fails, resulting in messages like +this: + +hv_storvsc : tag#205 cmd 0xa3 status: scsi 0x2 srb 0x86 hv 0xc0000001 + +The recently added support for command duration limits calls +scsi_report_opcode() four times as each device comes online, which +significantly increases the number of messages logged in a system with many +disks. + +Fix the problem by always marking Hyper-V synthetic SCSI devices as not +supporting scsi_report_opcode(). With this setting, the MAINTENANCE_IN SCSI +command is not issued and no messages are logged. + +Signed-off-by: Michael Kelley +Link: https://lore.kernel.org/r/1686343101-18930-1-git-send-email-mikelley@microsoft.com +Signed-off-by: Martin K. Petersen +Signed-off-by: Sasha Levin +--- + drivers/scsi/storvsc_drv.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c +index 9f8ebbec7bc39..5caf7bd5877f9 100644 +--- a/drivers/scsi/storvsc_drv.c ++++ b/drivers/scsi/storvsc_drv.c +@@ -1627,6 +1627,8 @@ static int storvsc_device_configure(struct scsi_device *sdevice) + { + blk_queue_rq_timeout(sdevice->request_queue, (storvsc_timeout * HZ)); + ++ /* storvsc devices don't support MAINTENANCE_IN SCSI cmd */ ++ sdevice->no_report_opcodes = 1; + sdevice->no_write_same = 1; + + /* +-- +2.40.1 + diff --git a/queue-5.15/sctp-handle-invalid-error-codes-without-calling-bug.patch b/queue-5.15/sctp-handle-invalid-error-codes-without-calling-bug.patch new file mode 100644 index 00000000000..75b401ab308 --- /dev/null +++ b/queue-5.15/sctp-handle-invalid-error-codes-without-calling-bug.patch @@ -0,0 +1,45 @@ +From 592bd5d2ba845450986e375a17ef11ff50eba20a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 9 Jun 2023 14:04:43 +0300 +Subject: sctp: handle invalid error codes without calling BUG() + +From: Dan Carpenter + +[ Upstream commit a0067dfcd9418fd3b0632bc59210d120d038a9c6 ] + +The sctp_sf_eat_auth() function is supposed to return enum sctp_disposition +values but if the call to sctp_ulpevent_make_authkey() fails, it returns +-ENOMEM. + +This results in calling BUG() inside the sctp_side_effects() function. +Calling BUG() is an over reaction and not helpful. Call WARN_ON_ONCE() +instead. + +This code predates git. + +Signed-off-by: Dan Carpenter +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + net/sctp/sm_sideeffect.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c +index 463c4a58d2c36..970c6a486a9b0 100644 +--- a/net/sctp/sm_sideeffect.c ++++ b/net/sctp/sm_sideeffect.c +@@ -1251,7 +1251,10 @@ static int sctp_side_effects(enum sctp_event_type event_type, + default: + pr_err("impossible disposition %d in state %d, event_type %d, event_id %d\n", + status, state, event_type, subtype.chunk); +- BUG(); ++ error = status; ++ if (error >= 0) ++ error = -EINVAL; ++ WARN_ON_ONCE(1); + break; + } + +-- +2.40.1 + diff --git a/queue-5.15/security-keys-perform-capable-check-only-on-privileg.patch b/queue-5.15/security-keys-perform-capable-check-only-on-privileg.patch new file mode 100644 index 00000000000..ff1a763bcea --- /dev/null +++ b/queue-5.15/security-keys-perform-capable-check-only-on-privileg.patch @@ -0,0 +1,66 @@ +From 25b1029a9a3463b051de3e2fe7fa3529d74a9836 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 11 May 2023 14:32:52 +0200 +Subject: security: keys: perform capable check only on privileged operations +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Christian Göttsche + +[ Upstream commit 2d7f105edbb3b2be5ffa4d833abbf9b6965e9ce7 ] + +If the current task fails the check for the queried capability via +`capable(CAP_SYS_ADMIN)` LSMs like SELinux generate a denial message. +Issuing such denial messages unnecessarily can lead to a policy author +granting more privileges to a subject than needed to silence them. + +Reorder CAP_SYS_ADMIN checks after the check whether the operation is +actually privileged. + +Signed-off-by: Christian Göttsche +Reviewed-by: Jarkko Sakkinen +Signed-off-by: Jarkko Sakkinen +Signed-off-by: Sasha Levin +--- + security/keys/keyctl.c | 11 ++++++++--- + 1 file changed, 8 insertions(+), 3 deletions(-) + +diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c +index 96a92a645216d..cfb5000876922 100644 +--- a/security/keys/keyctl.c ++++ b/security/keys/keyctl.c +@@ -980,14 +980,19 @@ long keyctl_chown_key(key_serial_t id, uid_t user, gid_t group) + ret = -EACCES; + down_write(&key->sem); + +- if (!capable(CAP_SYS_ADMIN)) { ++ { ++ bool is_privileged_op = false; ++ + /* only the sysadmin can chown a key to some other UID */ + if (user != (uid_t) -1 && !uid_eq(key->uid, uid)) +- goto error_put; ++ is_privileged_op = true; + + /* only the sysadmin can set the key's GID to a group other + * than one of those that the current process subscribes to */ + if (group != (gid_t) -1 && !gid_eq(gid, key->gid) && !in_group_p(gid)) ++ is_privileged_op = true; ++ ++ if (is_privileged_op && !capable(CAP_SYS_ADMIN)) + goto error_put; + } + +@@ -1088,7 +1093,7 @@ long keyctl_setperm_key(key_serial_t id, key_perm_t perm) + down_write(&key->sem); + + /* if we're not the sysadmin, we can only change a key that we own */ +- if (capable(CAP_SYS_ADMIN) || uid_eq(key->uid, current_fsuid())) { ++ if (uid_eq(key->uid, current_fsuid()) || capable(CAP_SYS_ADMIN)) { + key->perm = perm; + notify_key(key, NOTIFY_KEY_SETATTR, 0); + ret = 0; +-- +2.40.1 + diff --git a/queue-5.15/series b/queue-5.15/series new file mode 100644 index 00000000000..7e16d3bd5ef --- /dev/null +++ b/queue-5.15/series @@ -0,0 +1,49 @@ +arm-dts-imx-update-sdma-node-name-format.patch +arm-dts-imx7s-drop-dma-apb-interrupt-names.patch +arm-dts-imx-adjust-dma-apbh-node-name.patch +arm-dts-imx-set-default-tuning-step-for-imx7d-usdhc.patch +phy-qcom-snps-femto-v2-use-qcom_snps_hsphy_suspend-r.patch +media-pulse8-cec-handle-possible-ping-error.patch +media-pci-cx23885-fix-error-handling-for-cx23885-ats.patch +9p-virtio-make-sure-offs-is-initialized-in-zc_reques.patch +ksmbd-fix-out-of-bounds-in-smb3_decrypt_req.patch +ksmbd-no-response-from-compound-read.patch +asoc-da7219-flush-pending-aad-irq-when-suspending.patch +asoc-da7219-check-for-failure-reading-aad-irq-events.patch +ethernet-atheros-fix-return-value-check-in-atl1c_tso.patch +vxlan-generalize-vxlan_parse_gpe_hdr-and-remove-unus.patch +m68k-fix-invalid-.section-syntax.patch +s390-dasd-use-correct-number-of-retries-for-erp-requ.patch +s390-dasd-fix-hanging-device-after-request-requeue.patch +fs-nls-make-load_nls-take-a-const-parameter.patch +asoc-rt5682-sdw-fix-for-jd-event-handling-in-clockst.patch +asoc-codecs-es8316-fix-dmic-config.patch +asoc-rt711-fix-for-jd-event-handling-in-clockstop-mo.patch +asoc-rt711-sdca-fix-for-jd-event-handling-in-clockst.patch +asoc-atmel-fix-the-8k-sample-parameter-in-i2sc-maste.patch +alsa-usb-audio-add-quirk-for-microsoft-modern-wirele.patch +platform-x86-intel-hid-always-call-btnl-acpi-method.patch +platform-x86-intel-hid-add-hp-dragonfly-g2-to-vgbs-d.patch +platform-x86-huawei-wmi-silence-ambient-light-sensor.patch +drm-amd-display-exit-idle-optimizations-before-attem.patch +ovl-always-reevaluate-the-file-signature-for-ima.patch +ata-pata_arasan_cf-use-dev_err_probe-instead-dev_err.patch +security-keys-perform-capable-check-only-on-privileg.patch +kprobes-prohibit-probing-on-cfi-preamble-symbol.patch +clk-fixed-mmio-make-common_clk_fixed_mmio-depend-on-.patch +vmbus_testing-fix-wrong-python-syntax-for-integer-va.patch +net-usb-qmi_wwan-add-quectel-em05gv2.patch +wifi-brcmfmac-fix-field-spanning-write-in-brcmf_scan.patch +idmaengine-make-fsl_edma-and-intel_idma64-depends-on.patch +scsi-lpfc-remove-reftag-check-in-dif-paths.patch +scsi-qedi-fix-potential-deadlock-on-qedi_percpu-p_wo.patch +net-hns3-restore-user-pause-configure-when-disable-a.patch +drm-amdgpu-match-against-exact-bootloader-status.patch +netlabel-fix-shift-wrapping-bug-in-netlbl_catmap_set.patch +bnx2x-fix-page-fault-following-eeh-recovery.patch +sctp-handle-invalid-error-codes-without-calling-bug.patch +scsi-storvsc-always-set-no_report_opcodes.patch +scsi-lpfc-fix-incorrect-big-endian-type-assignment-i.patch +alsa-seq-oss-fix-racy-open-close-of-midi-devices.patch +tracing-introduce-pipe_cpumask-to-avoid-race-on-trac.patch +platform-mellanox-fix-mlxbf-tmfifo-not-handling-all-.patch diff --git a/queue-5.15/tracing-introduce-pipe_cpumask-to-avoid-race-on-trac.patch b/queue-5.15/tracing-introduce-pipe_cpumask-to-avoid-race-on-trac.patch new file mode 100644 index 00000000000..e4261017b41 --- /dev/null +++ b/queue-5.15/tracing-introduce-pipe_cpumask-to-avoid-race-on-trac.patch @@ -0,0 +1,211 @@ +From 66fbdc55ac057a8bd32c9bed2df7eb10d13a7a9d Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 18 Aug 2023 10:26:45 +0800 +Subject: tracing: Introduce pipe_cpumask to avoid race on trace_pipes + +From: Zheng Yejian + +[ Upstream commit c2489bb7e6be2e8cdced12c16c42fa128403ac03 ] + +There is race issue when concurrently splice_read main trace_pipe and +per_cpu trace_pipes which will result in data read out being different +from what actually writen. + +As suggested by Steven: + > I believe we should add a ref count to trace_pipe and the per_cpu + > trace_pipes, where if they are opened, nothing else can read it. + > + > Opening trace_pipe locks all per_cpu ref counts, if any of them are + > open, then the trace_pipe open will fail (and releases any ref counts + > it had taken). + > + > Opening a per_cpu trace_pipe will up the ref count for just that + > CPU buffer. This will allow multiple tasks to read different per_cpu + > trace_pipe files, but will prevent the main trace_pipe file from + > being opened. + +But because we only need to know whether per_cpu trace_pipe is open or +not, using a cpumask instead of using ref count may be easier. + +After this patch, users will find that: + - Main trace_pipe can be opened by only one user, and if it is + opened, all per_cpu trace_pipes cannot be opened; + - Per_cpu trace_pipes can be opened by multiple users, but each per_cpu + trace_pipe can only be opened by one user. And if one of them is + opened, main trace_pipe cannot be opened. + +Link: https://lore.kernel.org/linux-trace-kernel/20230818022645.1948314-1-zhengyejian1@huawei.com + +Suggested-by: Steven Rostedt (Google) +Signed-off-by: Zheng Yejian +Reviewed-by: Masami Hiramatsu (Google) +Signed-off-by: Steven Rostedt (Google) +Signed-off-by: Sasha Levin +--- + kernel/trace/trace.c | 55 ++++++++++++++++++++++++++++++++++++++------ + kernel/trace/trace.h | 2 ++ + 2 files changed, 50 insertions(+), 7 deletions(-) + +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 8769cd18f622f..92b381aab8f2b 100644 +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -6587,10 +6587,36 @@ tracing_max_lat_write(struct file *filp, const char __user *ubuf, + + #endif + ++static int open_pipe_on_cpu(struct trace_array *tr, int cpu) ++{ ++ if (cpu == RING_BUFFER_ALL_CPUS) { ++ if (cpumask_empty(tr->pipe_cpumask)) { ++ cpumask_setall(tr->pipe_cpumask); ++ return 0; ++ } ++ } else if (!cpumask_test_cpu(cpu, tr->pipe_cpumask)) { ++ cpumask_set_cpu(cpu, tr->pipe_cpumask); ++ return 0; ++ } ++ return -EBUSY; ++} ++ ++static void close_pipe_on_cpu(struct trace_array *tr, int cpu) ++{ ++ if (cpu == RING_BUFFER_ALL_CPUS) { ++ WARN_ON(!cpumask_full(tr->pipe_cpumask)); ++ cpumask_clear(tr->pipe_cpumask); ++ } else { ++ WARN_ON(!cpumask_test_cpu(cpu, tr->pipe_cpumask)); ++ cpumask_clear_cpu(cpu, tr->pipe_cpumask); ++ } ++} ++ + static int tracing_open_pipe(struct inode *inode, struct file *filp) + { + struct trace_array *tr = inode->i_private; + struct trace_iterator *iter; ++ int cpu; + int ret; + + ret = tracing_check_open_get_tr(tr); +@@ -6598,13 +6624,16 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp) + return ret; + + mutex_lock(&trace_types_lock); ++ cpu = tracing_get_cpu(inode); ++ ret = open_pipe_on_cpu(tr, cpu); ++ if (ret) ++ goto fail_pipe_on_cpu; + + /* create a buffer to store the information to pass to userspace */ + iter = kzalloc(sizeof(*iter), GFP_KERNEL); + if (!iter) { + ret = -ENOMEM; +- __trace_array_put(tr); +- goto out; ++ goto fail_alloc_iter; + } + + trace_seq_init(&iter->seq); +@@ -6627,7 +6656,7 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp) + + iter->tr = tr; + iter->array_buffer = &tr->array_buffer; +- iter->cpu_file = tracing_get_cpu(inode); ++ iter->cpu_file = cpu; + mutex_init(&iter->mutex); + filp->private_data = iter; + +@@ -6637,12 +6666,15 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp) + nonseekable_open(inode, filp); + + tr->trace_ref++; +-out: ++ + mutex_unlock(&trace_types_lock); + return ret; + + fail: + kfree(iter); ++fail_alloc_iter: ++ close_pipe_on_cpu(tr, cpu); ++fail_pipe_on_cpu: + __trace_array_put(tr); + mutex_unlock(&trace_types_lock); + return ret; +@@ -6659,7 +6691,7 @@ static int tracing_release_pipe(struct inode *inode, struct file *file) + + if (iter->trace->pipe_close) + iter->trace->pipe_close(iter); +- ++ close_pipe_on_cpu(tr, iter->cpu_file); + mutex_unlock(&trace_types_lock); + + free_cpumask_var(iter->started); +@@ -9311,6 +9343,9 @@ static struct trace_array *trace_array_create(const char *name) + if (!alloc_cpumask_var(&tr->tracing_cpumask, GFP_KERNEL)) + goto out_free_tr; + ++ if (!alloc_cpumask_var(&tr->pipe_cpumask, GFP_KERNEL)) ++ goto out_free_tr; ++ + tr->trace_flags = global_trace.trace_flags & ~ZEROED_TRACE_FLAGS; + + cpumask_copy(tr->tracing_cpumask, cpu_all_mask); +@@ -9352,6 +9387,7 @@ static struct trace_array *trace_array_create(const char *name) + out_free_tr: + ftrace_free_ftrace_ops(tr); + free_trace_buffers(tr); ++ free_cpumask_var(tr->pipe_cpumask); + free_cpumask_var(tr->tracing_cpumask); + kfree(tr->name); + kfree(tr); +@@ -9454,6 +9490,7 @@ static int __remove_instance(struct trace_array *tr) + } + kfree(tr->topts); + ++ free_cpumask_var(tr->pipe_cpumask); + free_cpumask_var(tr->tracing_cpumask); + kfree(tr->name); + kfree(tr); +@@ -10164,12 +10201,14 @@ __init static int tracer_alloc_buffers(void) + if (trace_create_savedcmd() < 0) + goto out_free_temp_buffer; + ++ if (!alloc_cpumask_var(&global_trace.pipe_cpumask, GFP_KERNEL)) ++ goto out_free_savedcmd; ++ + /* TODO: make the number of buffers hot pluggable with CPUS */ + if (allocate_trace_buffers(&global_trace, ring_buf_size) < 0) { + MEM_FAIL(1, "tracer: failed to allocate ring buffer!\n"); +- goto out_free_savedcmd; ++ goto out_free_pipe_cpumask; + } +- + if (global_trace.buffer_disabled) + tracing_off(); + +@@ -10222,6 +10261,8 @@ __init static int tracer_alloc_buffers(void) + + return 0; + ++out_free_pipe_cpumask: ++ free_cpumask_var(global_trace.pipe_cpumask); + out_free_savedcmd: + free_saved_cmdlines_buffer(savedcmd); + out_free_temp_buffer: +diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h +index 43058077a4def..90ab921884b10 100644 +--- a/kernel/trace/trace.h ++++ b/kernel/trace/trace.h +@@ -367,6 +367,8 @@ struct trace_array { + struct list_head events; + struct trace_event_file *trace_marker_file; + cpumask_var_t tracing_cpumask; /* only trace on set CPUs */ ++ /* one per_cpu trace_pipe can be opened by only one user */ ++ cpumask_var_t pipe_cpumask; + int ref; + int trace_ref; + #ifdef CONFIG_FUNCTION_TRACER +-- +2.40.1 + diff --git a/queue-5.15/vmbus_testing-fix-wrong-python-syntax-for-integer-va.patch b/queue-5.15/vmbus_testing-fix-wrong-python-syntax-for-integer-va.patch new file mode 100644 index 00000000000..648a428d6eb --- /dev/null +++ b/queue-5.15/vmbus_testing-fix-wrong-python-syntax-for-integer-va.patch @@ -0,0 +1,52 @@ +From 22892a7ff7f72d2613254282dbcf62ee3d684a66 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 5 Jul 2023 19:14:07 +0530 +Subject: vmbus_testing: fix wrong python syntax for integer value comparison + +From: Ani Sinha + +[ Upstream commit ed0cf84e9cc42e6310961c87709621f1825c2bb8 ] + +It is incorrect in python to compare integer values using the "is" keyword. +The "is" keyword in python is used to compare references to two objects, +not their values. Newer version of python3 (version 3.8) throws a warning +when such incorrect comparison is made. For value comparison, "==" should +be used. + +Fix this in the code and suppress the following warning: + +/usr/sbin/vmbus_testing:167: SyntaxWarning: "is" with a literal. Did you mean "=="? + +Signed-off-by: Ani Sinha +Link: https://lore.kernel.org/r/20230705134408.6302-1-anisinha@redhat.com +Signed-off-by: Wei Liu +Signed-off-by: Sasha Levin +--- + tools/hv/vmbus_testing | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tools/hv/vmbus_testing b/tools/hv/vmbus_testing +index e7212903dd1d9..4467979d8f699 100755 +--- a/tools/hv/vmbus_testing ++++ b/tools/hv/vmbus_testing +@@ -164,7 +164,7 @@ def recursive_file_lookup(path, file_map): + def get_all_devices_test_status(file_map): + + for device in file_map: +- if (get_test_state(locate_state(device, file_map)) is 1): ++ if (get_test_state(locate_state(device, file_map)) == 1): + print("Testing = ON for: {}" + .format(device.split("/")[5])) + else: +@@ -203,7 +203,7 @@ def write_test_files(path, value): + def set_test_state(state_path, state_value, quiet): + + write_test_files(state_path, state_value) +- if (get_test_state(state_path) is 1): ++ if (get_test_state(state_path) == 1): + if (not quiet): + print("Testing = ON for device: {}" + .format(state_path.split("/")[5])) +-- +2.40.1 + diff --git a/queue-5.15/vxlan-generalize-vxlan_parse_gpe_hdr-and-remove-unus.patch b/queue-5.15/vxlan-generalize-vxlan_parse_gpe_hdr-and-remove-unus.patch new file mode 100644 index 00000000000..e6199c07c85 --- /dev/null +++ b/queue-5.15/vxlan-generalize-vxlan_parse_gpe_hdr-and-remove-unus.patch @@ -0,0 +1,114 @@ +From 34d26d71c3b405721e2c6954d12b286ade9bb4a5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 21 Jul 2023 16:30:46 +0200 +Subject: vxlan: generalize vxlan_parse_gpe_hdr and remove unused args + +From: Jiri Benc + +[ Upstream commit 17a0a64448b568442a101de09575f81ffdc45d15 ] + +The vxlan_parse_gpe_hdr function extracts the next protocol value from +the GPE header and marks GPE bits as parsed. + +In order to be used in the next patch, split the function into protocol +extraction and bit marking. The bit marking is meaningful only in +vxlan_rcv; move it directly there. + +Rename the function to vxlan_parse_gpe_proto to reflect what it now +does. Remove unused arguments skb and vxflags. Move the function earlier +in the file to allow it to be called from more places in the next patch. + +Signed-off-by: Jiri Benc +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + drivers/net/vxlan/vxlan_core.c | 58 ++++++++++++++++------------------ + 1 file changed, 28 insertions(+), 30 deletions(-) + +diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c +index 106b66570e046..41b1b23fdd3e9 100644 +--- a/drivers/net/vxlan/vxlan_core.c ++++ b/drivers/net/vxlan/vxlan_core.c +@@ -730,6 +730,32 @@ static int vxlan_fdb_append(struct vxlan_fdb *f, + return 1; + } + ++static bool vxlan_parse_gpe_proto(struct vxlanhdr *hdr, __be16 *protocol) ++{ ++ struct vxlanhdr_gpe *gpe = (struct vxlanhdr_gpe *)hdr; ++ ++ /* Need to have Next Protocol set for interfaces in GPE mode. */ ++ if (!gpe->np_applied) ++ return false; ++ /* "The initial version is 0. If a receiver does not support the ++ * version indicated it MUST drop the packet. ++ */ ++ if (gpe->version != 0) ++ return false; ++ /* "When the O bit is set to 1, the packet is an OAM packet and OAM ++ * processing MUST occur." However, we don't implement OAM ++ * processing, thus drop the packet. ++ */ ++ if (gpe->oam_flag) ++ return false; ++ ++ *protocol = tun_p_to_eth_p(gpe->next_protocol); ++ if (!*protocol) ++ return false; ++ ++ return true; ++} ++ + static struct vxlanhdr *vxlan_gro_remcsum(struct sk_buff *skb, + unsigned int off, + struct vxlanhdr *vh, size_t hdrlen, +@@ -1738,35 +1764,6 @@ static void vxlan_parse_gbp_hdr(struct vxlanhdr *unparsed, + unparsed->vx_flags &= ~VXLAN_GBP_USED_BITS; + } + +-static bool vxlan_parse_gpe_hdr(struct vxlanhdr *unparsed, +- __be16 *protocol, +- struct sk_buff *skb, u32 vxflags) +-{ +- struct vxlanhdr_gpe *gpe = (struct vxlanhdr_gpe *)unparsed; +- +- /* Need to have Next Protocol set for interfaces in GPE mode. */ +- if (!gpe->np_applied) +- return false; +- /* "The initial version is 0. If a receiver does not support the +- * version indicated it MUST drop the packet. +- */ +- if (gpe->version != 0) +- return false; +- /* "When the O bit is set to 1, the packet is an OAM packet and OAM +- * processing MUST occur." However, we don't implement OAM +- * processing, thus drop the packet. +- */ +- if (gpe->oam_flag) +- return false; +- +- *protocol = tun_p_to_eth_p(gpe->next_protocol); +- if (!*protocol) +- return false; +- +- unparsed->vx_flags &= ~VXLAN_GPE_USED_BITS; +- return true; +-} +- + static bool vxlan_set_mac(struct vxlan_dev *vxlan, + struct vxlan_sock *vs, + struct sk_buff *skb, __be32 vni) +@@ -1867,8 +1864,9 @@ static int vxlan_rcv(struct sock *sk, struct sk_buff *skb) + * used by VXLAN extensions if explicitly requested. + */ + if (vs->flags & VXLAN_F_GPE) { +- if (!vxlan_parse_gpe_hdr(&unparsed, &protocol, skb, vs->flags)) ++ if (!vxlan_parse_gpe_proto(&unparsed, &protocol)) + goto drop; ++ unparsed.vx_flags &= ~VXLAN_GPE_USED_BITS; + raw_proto = true; + } + +-- +2.40.1 + diff --git a/queue-5.15/wifi-brcmfmac-fix-field-spanning-write-in-brcmf_scan.patch b/queue-5.15/wifi-brcmfmac-fix-field-spanning-write-in-brcmf_scan.patch new file mode 100644 index 00000000000..04cbadb8721 --- /dev/null +++ b/queue-5.15/wifi-brcmfmac-fix-field-spanning-write-in-brcmf_scan.patch @@ -0,0 +1,66 @@ +From 9813ecf344ccf3a44f38ca52fad57eb215e156b6 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 29 Jul 2023 16:05:00 +0200 +Subject: wifi: brcmfmac: Fix field-spanning write in + brcmf_scan_params_v2_to_v1() + +From: Hans de Goede + +[ Upstream commit 16e455a465fca91907af0108f3d013150386df30 ] + +Using brcmfmac with 6.5-rc3 on a brcmfmac43241b4-sdio triggers +a backtrace caused by the following field-spanning warning: + +memcpy: detected field-spanning write (size 120) of single field + "¶ms_le->channel_list[0]" at + drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:1072 (size 2) + +The driver still works after this warning. The warning was introduced by the +new field-spanning write checks which were enabled recently. + +Fix this by replacing the channel_list[1] declaration at the end of +the struct with a flexible array declaration. + +Most users of struct brcmf_scan_params_le calculate the size to alloc +using the size of the non flex-array part of the struct + needed extra +space, so they do not care about sizeof(struct brcmf_scan_params_le). + +brcmf_notify_escan_complete() however uses the struct on the stack, +expecting there to be room for at least 1 entry in the channel-list +to store the special -1 abort channel-id. + +To make this work use an anonymous union with a padding member +added + the actual channel_list flexible array. + +Cc: Kees Cook +Signed-off-by: Hans de Goede +Reviewed-by: Kees Cook +Reviewed-by: Franky Lin +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/20230729140500.27892-1-hdegoede@redhat.com +Signed-off-by: Sasha Levin +--- + .../net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +index ff2ef557f0ead..2a1590cc73ab2 100644 +--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h ++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +@@ -383,7 +383,12 @@ struct brcmf_scan_params_le { + * fixed parameter portion is assumed, otherwise + * ssid in the fixed portion is ignored + */ +- __le16 channel_list[1]; /* list of chanspecs */ ++ union { ++ __le16 padding; /* Reserve space for at least 1 entry for abort ++ * which uses an on stack brcmf_scan_params_le ++ */ ++ DECLARE_FLEX_ARRAY(__le16, channel_list); /* chanspecs */ ++ }; + }; + + struct brcmf_scan_results { +-- +2.40.1 +