From: Sasha Levin Date: Thu, 7 Sep 2023 00:08:06 +0000 (-0400) Subject: Fixes for 5.10 X-Git-Tag: v6.1.53~157 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=78446361d6b7bffb5cd6a4095ed1fb3eb8bfad36;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/9p-virtio-make-sure-offs-is-initialized-in-zc_reques.patch b/queue-5.10/9p-virtio-make-sure-offs-is-initialized-in-zc_reques.patch new file mode 100644 index 00000000000..3ebcadb3956 --- /dev/null +++ b/queue-5.10/9p-virtio-make-sure-offs-is-initialized-in-zc_reques.patch @@ -0,0 +1,43 @@ +From 504ffb1f2fdac3911e6a572798933ac705076c2b 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 f582351d84ecb..36b5f72e2165c 100644 +--- a/net/9p/trans_virtio.c ++++ b/net/9p/trans_virtio.c +@@ -394,7 +394,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.10/alsa-seq-oss-fix-racy-open-close-of-midi-devices.patch b/queue-5.10/alsa-seq-oss-fix-racy-open-close-of-midi-devices.patch new file mode 100644 index 00000000000..008cffb7132 --- /dev/null +++ b/queue-5.10/alsa-seq-oss-fix-racy-open-close-of-midi-devices.patch @@ -0,0 +1,128 @@ +From 2f06c5cc1768dff2491b81717f83b53b1769582d 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 f73ee0798aeab..be80ce72e0c72 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; + }; + + +@@ -171,6 +172,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 */ + strlcpy(mdev->name, pinfo->name, sizeof(mdev->name)); +@@ -319,14 +321,16 @@ 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; + + if ((mdev = get_mididev(dp, dev)) == NULL) + 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; +@@ -336,14 +340,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; +@@ -368,13 +372,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; + } + + /* +@@ -388,10 +396,9 @@ snd_seq_oss_midi_close(struct seq_oss_devinfo *dp, int dev) + + if ((mdev = get_mididev(dp, dev)) == NULL) + 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) { +@@ -410,6 +417,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.10/arm-dts-imx-adjust-dma-apbh-node-name.patch b/queue-5.10/arm-dts-imx-adjust-dma-apbh-node-name.patch new file mode 100644 index 00000000000..4f685290c6a --- /dev/null +++ b/queue-5.10/arm-dts-imx-adjust-dma-apbh-node-name.patch @@ -0,0 +1,109 @@ +From 682c22c6e35cb2dbaaa5c07a1d146815ea167db3 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 94dfbf5b3f34a..6cab8b66db805 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 e02dcf1bff165..e67d8dffba35c 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 39c1d702210a1..08332f70a8dc2 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 44a6e8c0e4075..c374fe2a6f19e 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 a834fce6d795e..2b664d457b461 100644 +--- a/arch/arm/boot/dts/imx7s.dtsi ++++ b/arch/arm/boot/dts/imx7s.dtsi +@@ -1210,7 +1210,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.10/arm-dts-imx-set-default-tuning-step-for-imx7d-usdhc.patch b/queue-5.10/arm-dts-imx-set-default-tuning-step-for-imx7d-usdhc.patch new file mode 100644 index 00000000000..94efc12ae04 --- /dev/null +++ b/queue-5.10/arm-dts-imx-set-default-tuning-step-for-imx7d-usdhc.patch @@ -0,0 +1,64 @@ +From cae261144718327878a09966c71188aa69222a6a 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 2b664d457b461..854c380cccea4 100644 +--- a/arch/arm/boot/dts/imx7s.dtsi ++++ b/arch/arm/boot/dts/imx7s.dtsi +@@ -1137,6 +1137,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"; + }; + +@@ -1149,6 +1151,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"; + }; + +@@ -1161,6 +1165,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.10/arm-dts-imx-update-sdma-node-name-format.patch b/queue-5.10/arm-dts-imx-update-sdma-node-name-format.patch new file mode 100644 index 00000000000..2e337063a9d --- /dev/null +++ b/queue-5.10/arm-dts-imx-update-sdma-node-name-format.patch @@ -0,0 +1,177 @@ +From 791faa453b6a40cf601163c4dcdb8068b4c8b7df 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 1ab19f1268f81..d24b1da18766b 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 45333f7e10eaa..0ee7e5547beaf 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 aba16252faab4..e7c4803ef866e 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 b6b2e6af9b966..ae51333c30b32 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 985e1be03ad64..d80063560a657 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 500eeaa3a27c5..f4e7f437ea506 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 7d81992dfafc6..e02dcf1bff165 100644 +--- a/arch/arm/boot/dts/imx6qdl.dtsi ++++ b/arch/arm/boot/dts/imx6qdl.dtsi +@@ -927,7 +927,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 629c6a7432d9b..39c1d702210a1 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 b40dd0c198028..44a6e8c0e4075 100644 +--- a/arch/arm/boot/dts/imx6ul.dtsi ++++ b/arch/arm/boot/dts/imx6ul.dtsi +@@ -743,7 +743,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 334e781663cc2..d9685f586ac07 100644 +--- a/arch/arm/boot/dts/imx7s.dtsi ++++ b/arch/arm/boot/dts/imx7s.dtsi +@@ -1177,7 +1177,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.10/arm-dts-imx7s-drop-dma-apb-interrupt-names.patch b/queue-5.10/arm-dts-imx7s-drop-dma-apb-interrupt-names.patch new file mode 100644 index 00000000000..d34a3f40084 --- /dev/null +++ b/queue-5.10/arm-dts-imx7s-drop-dma-apb-interrupt-names.patch @@ -0,0 +1,37 @@ +From a2a3609befe690c0cf9674315b4610857eced18e 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 d9685f586ac07..a834fce6d795e 100644 +--- a/arch/arm/boot/dts/imx7s.dtsi ++++ b/arch/arm/boot/dts/imx7s.dtsi +@@ -1217,7 +1217,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.10/asoc-atmel-fix-the-8k-sample-parameter-in-i2sc-maste.patch b/queue-5.10/asoc-atmel-fix-the-8k-sample-parameter-in-i2sc-maste.patch new file mode 100644 index 00000000000..a616c3dc54c --- /dev/null +++ b/queue-5.10/asoc-atmel-fix-the-8k-sample-parameter-in-i2sc-maste.patch @@ -0,0 +1,46 @@ +From 096e6eab4f5f0621a0d436814367922e3ffe5bfd 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 d870f56c44cfc..0341b31197670 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.10/asoc-codecs-es8316-fix-dmic-config.patch b/queue-5.10/asoc-codecs-es8316-fix-dmic-config.patch new file mode 100644 index 00000000000..09243f6989c --- /dev/null +++ b/queue-5.10/asoc-codecs-es8316-fix-dmic-config.patch @@ -0,0 +1,36 @@ +From 4060a5154a25a659782ec353d8ab0f1670034bf9 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 03ad34a275da2..dafbf73d4eede 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.10/asoc-da7219-check-for-failure-reading-aad-irq-events.patch b/queue-5.10/asoc-da7219-check-for-failure-reading-aad-irq-events.patch new file mode 100644 index 00000000000..c6a1228100d --- /dev/null +++ b/queue-5.10/asoc-da7219-check-for-failure-reading-aad-irq-events.patch @@ -0,0 +1,51 @@ +From a2c6bdecf391032c33be99d35837c4f0a8578ab4 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 7fbda445be8e8..b316d613a7090 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.10/asoc-da7219-flush-pending-aad-irq-when-suspending.patch b/queue-5.10/asoc-da7219-flush-pending-aad-irq-when-suspending.patch new file mode 100644 index 00000000000..f51ed7486f0 --- /dev/null +++ b/queue-5.10/asoc-da7219-flush-pending-aad-irq-when-suspending.patch @@ -0,0 +1,77 @@ +From 51b54e76fffc1e452deec7352e34b1fcd85b5283 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 48081d71c22c9..7fbda445be8e8 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.10/ata-pata_arasan_cf-use-dev_err_probe-instead-dev_err.patch b/queue-5.10/ata-pata_arasan_cf-use-dev_err_probe-instead-dev_err.patch new file mode 100644 index 00000000000..2499fb8540c --- /dev/null +++ b/queue-5.10/ata-pata_arasan_cf-use-dev_err_probe-instead-dev_err.patch @@ -0,0 +1,40 @@ +From 255a7de7599cdd0d063ea47f885f5bbcc59d1621 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.10/bnx2x-fix-page-fault-following-eeh-recovery.patch b/queue-5.10/bnx2x-fix-page-fault-following-eeh-recovery.patch new file mode 100644 index 00000000000..21278926a4c --- /dev/null +++ b/queue-5.10/bnx2x-fix-page-fault-following-eeh-recovery.patch @@ -0,0 +1,55 @@ +From b020275297d0675f172dc9c9b5bb26af3976011c 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 afb6d3ee1f564..c8cbf3ed128de 100644 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +@@ -14372,11 +14372,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.10/clk-fixed-mmio-make-common_clk_fixed_mmio-depend-on-.patch b/queue-5.10/clk-fixed-mmio-make-common_clk_fixed_mmio-depend-on-.patch new file mode 100644 index 00000000000..1e5bf75c739 --- /dev/null +++ b/queue-5.10/clk-fixed-mmio-make-common_clk_fixed_mmio-depend-on-.patch @@ -0,0 +1,52 @@ +From 01febacd0131fb195a4233ee8a540a8985aba5b6 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 4ae49eae45869..df739665f2063 100644 +--- a/drivers/clk/Kconfig ++++ b/drivers/clk/Kconfig +@@ -356,6 +356,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.10/drm-amd-display-exit-idle-optimizations-before-attem.patch b/queue-5.10/drm-amd-display-exit-idle-optimizations-before-attem.patch new file mode 100644 index 00000000000..33e631d4560 --- /dev/null +++ b/queue-5.10/drm-amd-display-exit-idle-optimizations-before-attem.patch @@ -0,0 +1,45 @@ +From a13eb9bda88539cc360dbb62be09a401750f02d5 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 e33fe0207b9e5..53e8defd34751 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 +@@ -1682,10 +1682,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); + } +-- +2.40.1 + diff --git a/queue-5.10/ethernet-atheros-fix-return-value-check-in-atl1c_tso.patch b/queue-5.10/ethernet-atheros-fix-return-value-check-in-atl1c_tso.patch new file mode 100644 index 00000000000..a4349d44227 --- /dev/null +++ b/queue-5.10/ethernet-atheros-fix-return-value-check-in-atl1c_tso.patch @@ -0,0 +1,42 @@ +From f75a098676ac91246c624eb06b88855e9f75fec8 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 3f65f2b370c57..2c5af0d7666aa 100644 +--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c ++++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c +@@ -1987,8 +1987,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.10/fs-nls-make-load_nls-take-a-const-parameter.patch b/queue-5.10/fs-nls-make-load_nls-take-a-const-parameter.patch new file mode 100644 index 00000000000..9dfce0e1994 --- /dev/null +++ b/queue-5.10/fs-nls-make-load_nls-take-a-const-parameter.patch @@ -0,0 +1,66 @@ +From c4756a7fe47e187df8018629a4ef19bd1fdd2336 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.10/idmaengine-make-fsl_edma-and-intel_idma64-depends-on.patch b/queue-5.10/idmaengine-make-fsl_edma-and-intel_idma64-depends-on.patch new file mode 100644 index 00000000000..335a746a91e --- /dev/null +++ b/queue-5.10/idmaengine-make-fsl_edma-and-intel_idma64-depends-on.patch @@ -0,0 +1,58 @@ +From 9e46943de1dbca319c55f52db22c42d57ef230b7 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 08013345d1f24..7e1bd79fbee8f 100644 +--- a/drivers/dma/Kconfig ++++ b/drivers/dma/Kconfig +@@ -208,6 +208,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 +@@ -277,6 +278,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.10/kprobes-prohibit-probing-on-cfi-preamble-symbol.patch b/queue-5.10/kprobes-prohibit-probing-on-cfi-preamble-symbol.patch new file mode 100644 index 00000000000..5bef0b971f2 --- /dev/null +++ b/queue-5.10/kprobes-prohibit-probing-on-cfi-preamble-symbol.patch @@ -0,0 +1,56 @@ +From 6b92d1ee75fd0fbbe3fa922f7f000f463e22dc24 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 86d71c49b4957..f1ea3123f3832 100644 +--- a/kernel/kprobes.c ++++ b/kernel/kprobes.c +@@ -1628,6 +1628,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) + { +@@ -1646,7 +1657,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.10/m68k-fix-invalid-.section-syntax.patch b/queue-5.10/m68k-fix-invalid-.section-syntax.patch new file mode 100644 index 00000000000..e2b8461d5d8 --- /dev/null +++ b/queue-5.10/m68k-fix-invalid-.section-syntax.patch @@ -0,0 +1,99 @@ +From f53643368ac2bcbb8354158cdf506b57a514adca 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 a8f41615d94a7..31a9c634c81ed 100644 +--- a/arch/m68k/fpsp040/skeleton.S ++++ b/arch/m68k/fpsp040/skeleton.S +@@ -499,12 +499,12 @@ in_ea: + dbf %d0,morein + rts + +- .section .fixup,#alloc,#execinstr ++ .section .fixup,"ax" + .even + 1: + jbra fpsp040_die + +- .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.10/media-pci-cx23885-fix-error-handling-for-cx23885-ats.patch b/queue-5.10/media-pci-cx23885-fix-error-handling-for-cx23885-ats.patch new file mode 100644 index 00000000000..8955279fe3b --- /dev/null +++ b/queue-5.10/media-pci-cx23885-fix-error-handling-for-cx23885-ats.patch @@ -0,0 +1,63 @@ +From 6bca7e3fabe03bf5902dcf35515a1739bbabf89c 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.10/media-pulse8-cec-handle-possible-ping-error.patch b/queue-5.10/media-pulse8-cec-handle-possible-ping-error.patch new file mode 100644 index 00000000000..bde8cbb6690 --- /dev/null +++ b/queue-5.10/media-pulse8-cec-handle-possible-ping-error.patch @@ -0,0 +1,42 @@ +From 00e9cfecd96f76c5984d4149c59507c63d6b9e6a 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.10/net-usb-qmi_wwan-add-quectel-em05gv2.patch b/queue-5.10/net-usb-qmi_wwan-add-quectel-em05gv2.patch new file mode 100644 index 00000000000..85a4126c6d2 --- /dev/null +++ b/queue-5.10/net-usb-qmi_wwan-add-quectel-em05gv2.patch @@ -0,0 +1,64 @@ +From 577397a121f3f88c4d083f90e1dc7681b5d03544 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 de6c561535346..5cf7f389bf4ef 100644 +--- a/drivers/net/usb/qmi_wwan.c ++++ b/drivers/net/usb/qmi_wwan.c +@@ -1351,6 +1351,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.10/netlabel-fix-shift-wrapping-bug-in-netlbl_catmap_set.patch b/queue-5.10/netlabel-fix-shift-wrapping-bug-in-netlbl_catmap_set.patch new file mode 100644 index 00000000000..e57a64b9365 --- /dev/null +++ b/queue-5.10/netlabel-fix-shift-wrapping-bug-in-netlbl_catmap_set.patch @@ -0,0 +1,38 @@ +From 470ea702e8611470276e1e29c12fe84c20503602 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 91b35b7c80d82..96059c99b915e 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.10/ovl-always-reevaluate-the-file-signature-for-ima.patch b/queue-5.10/ovl-always-reevaluate-the-file-signature-for-ima.patch new file mode 100644 index 00000000000..178405f7a5c --- /dev/null +++ b/queue-5.10/ovl-always-reevaluate-the-file-signature-for-ima.patch @@ -0,0 +1,44 @@ +From d26a3029e372f3af5c3d5ca0fb529254213c3db8 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 5d7df839902df..e0384095ca960 100644 +--- a/fs/overlayfs/super.c ++++ b/fs/overlayfs/super.c +@@ -2028,7 +2028,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent) + sb->s_xattr = ovl_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.10/phy-qcom-snps-femto-v2-use-qcom_snps_hsphy_suspend-r.patch b/queue-5.10/phy-qcom-snps-femto-v2-use-qcom_snps_hsphy_suspend-r.patch new file mode 100644 index 00000000000..c3734fa63ff --- /dev/null +++ b/queue-5.10/phy-qcom-snps-femto-v2-use-qcom_snps_hsphy_suspend-r.patch @@ -0,0 +1,48 @@ +From db3a5f2c406f279acf02ea1590bc14f0ecb567f6 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.10/platform-mellanox-fix-mlxbf-tmfifo-not-handling-all-.patch b/queue-5.10/platform-mellanox-fix-mlxbf-tmfifo-not-handling-all-.patch new file mode 100644 index 00000000000..61106be9c22 --- /dev/null +++ b/queue-5.10/platform-mellanox-fix-mlxbf-tmfifo-not-handling-all-.patch @@ -0,0 +1,40 @@ +From 57259e8f38869885fa98f1024eed24a593802dc0 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.10/platform-x86-huawei-wmi-silence-ambient-light-sensor.patch b/queue-5.10/platform-x86-huawei-wmi-silence-ambient-light-sensor.patch new file mode 100644 index 00000000000..02dcf2c45bd --- /dev/null +++ b/queue-5.10/platform-x86-huawei-wmi-silence-ambient-light-sensor.patch @@ -0,0 +1,55 @@ +From 4dcd2f36f1801d7fc0b65c952136228226f1f2e3 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.10/platform-x86-intel-hid-always-call-btnl-acpi-method.patch b/queue-5.10/platform-x86-intel-hid-always-call-btnl-acpi-method.patch new file mode 100644 index 00000000000..59ae01b241e --- /dev/null +++ b/queue-5.10/platform-x86-intel-hid-always-call-btnl-acpi-method.patch @@ -0,0 +1,73 @@ +From 346000b667223156105887c48547b9e3db6d2791 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 cebddefba2f42..0b0602fc43601 100644 +--- a/drivers/platform/x86/intel-hid.c ++++ b/drivers/platform/x86/intel-hid.c +@@ -458,7 +458,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; +@@ -510,18 +510,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.10/s390-dasd-fix-hanging-device-after-request-requeue.patch b/queue-5.10/s390-dasd-fix-hanging-device-after-request-requeue.patch new file mode 100644 index 00000000000..c8c41dce099 --- /dev/null +++ b/queue-5.10/s390-dasd-fix-hanging-device-after-request-requeue.patch @@ -0,0 +1,222 @@ +From 4a9740ca8d6699fdacd7b873ee4f36142116bfcd 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 792f8f5688085..09e932a7b17f4 100644 +--- a/drivers/s390/block/dasd.c ++++ b/drivers/s390/block/dasd.c +@@ -2985,41 +2985,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) { +@@ -3034,13 +3025,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) { +@@ -3977,75 +3987,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.10/s390-dasd-use-correct-number-of-retries-for-erp-requ.patch b/queue-5.10/s390-dasd-use-correct-number-of-retries-for-erp-requ.patch new file mode 100644 index 00000000000..d400fecb953 --- /dev/null +++ b/queue-5.10/s390-dasd-use-correct-number-of-retries-for-erp-requ.patch @@ -0,0 +1,45 @@ +From 3308a3cec43ebdee4de6ce23fc69940f2a9444c1 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.10/scsi-qedi-fix-potential-deadlock-on-qedi_percpu-p_wo.patch b/queue-5.10/scsi-qedi-fix-potential-deadlock-on-qedi_percpu-p_wo.patch new file mode 100644 index 00000000000..697e99495a2 --- /dev/null +++ b/queue-5.10/scsi-qedi-fix-potential-deadlock-on-qedi_percpu-p_wo.patch @@ -0,0 +1,67 @@ +From 29e38d097079e66510d6f3053aeacfb065bad5c2 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 cc2152c56d355..96e470746767a 100644 +--- a/drivers/scsi/qedi/qedi_main.c ++++ b/drivers/scsi/qedi/qedi_main.c +@@ -1981,8 +1981,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; + +@@ -1993,7 +1994,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.10/scsi-storvsc-always-set-no_report_opcodes.patch b/queue-5.10/scsi-storvsc-always-set-no_report_opcodes.patch new file mode 100644 index 00000000000..6feb0c12e49 --- /dev/null +++ b/queue-5.10/scsi-storvsc-always-set-no_report_opcodes.patch @@ -0,0 +1,48 @@ +From 7629170c0940ef8b21f41102f32acfb114878dbe 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 45d8549623442..37ad5f5256474 100644 +--- a/drivers/scsi/storvsc_drv.c ++++ b/drivers/scsi/storvsc_drv.c +@@ -1537,6 +1537,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.10/sctp-handle-invalid-error-codes-without-calling-bug.patch b/queue-5.10/sctp-handle-invalid-error-codes-without-calling-bug.patch new file mode 100644 index 00000000000..7ca06095845 --- /dev/null +++ b/queue-5.10/sctp-handle-invalid-error-codes-without-calling-bug.patch @@ -0,0 +1,45 @@ +From 96ab11eed2d071646f23af12bd23229edae2870a 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 d4e5969771f0f..30e9914526337 100644 +--- a/net/sctp/sm_sideeffect.c ++++ b/net/sctp/sm_sideeffect.c +@@ -1241,7 +1241,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.10/security-keys-perform-capable-check-only-on-privileg.patch b/queue-5.10/security-keys-perform-capable-check-only-on-privileg.patch new file mode 100644 index 00000000000..48dccd29bd3 --- /dev/null +++ b/queue-5.10/security-keys-perform-capable-check-only-on-privileg.patch @@ -0,0 +1,66 @@ +From bd4cdf0607c46a08d0f99adbb049109e4de735d5 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 61a614c21b9b6..e3ffaf5ad6394 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.10/series b/queue-5.10/series index e1def0428c4..ebd49a5cb92 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -21,3 +21,40 @@ nilfs2-fix-general-protection-fault-in-nilfs_lookup_dirty_data_buffers.patch nilfs2-fix-warning-in-mark_buffer_dirty-due-to-discarded-buffer-reuse.patch pinctrl-amd-don-t-show-invalid-config-param-errors.patch asoc-rt5682-fix-a-problem-with-error-handling-in-the-io-init-function-of-the-soundwire.patch +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 +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-codecs-es8316-fix-dmic-config.patch +asoc-atmel-fix-the-8k-sample-parameter-in-i2sc-maste.patch +platform-x86-intel-hid-always-call-btnl-acpi-method.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 +idmaengine-make-fsl_edma-and-intel_idma64-depends-on.patch +scsi-qedi-fix-potential-deadlock-on-qedi_percpu-p_wo.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 +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.10/tracing-introduce-pipe_cpumask-to-avoid-race-on-trac.patch b/queue-5.10/tracing-introduce-pipe_cpumask-to-avoid-race-on-trac.patch new file mode 100644 index 00000000000..d56bce46e5f --- /dev/null +++ b/queue-5.10/tracing-introduce-pipe_cpumask-to-avoid-race-on-trac.patch @@ -0,0 +1,211 @@ +From db4f6720e2906a3512e3cf71aea56e5c596f4f7b 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 597487a7f1bfb..2ded5012543bf 100644 +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -6255,10 +6255,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); +@@ -6266,13 +6292,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); +@@ -6295,7 +6324,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; + +@@ -6305,12 +6334,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; +@@ -6327,7 +6359,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); +@@ -8851,6 +8883,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); +@@ -8892,6 +8927,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); +@@ -8993,6 +9029,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); +@@ -9692,12 +9729,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(); + +@@ -9748,6 +9787,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 892b3d2f33b79..dfde855dafda7 100644 +--- a/kernel/trace/trace.h ++++ b/kernel/trace/trace.h +@@ -356,6 +356,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.10/vmbus_testing-fix-wrong-python-syntax-for-integer-va.patch b/queue-5.10/vmbus_testing-fix-wrong-python-syntax-for-integer-va.patch new file mode 100644 index 00000000000..297316e5fdd --- /dev/null +++ b/queue-5.10/vmbus_testing-fix-wrong-python-syntax-for-integer-va.patch @@ -0,0 +1,52 @@ +From 4245665a9d7091a6fa0f0e5fd95a7d5c59f1c0f0 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.10/vxlan-generalize-vxlan_parse_gpe_hdr-and-remove-unus.patch b/queue-5.10/vxlan-generalize-vxlan_parse_gpe_hdr-and-remove-unus.patch new file mode 100644 index 00000000000..2b4e875b870 --- /dev/null +++ b/queue-5.10/vxlan-generalize-vxlan_parse_gpe_hdr-and-remove-unus.patch @@ -0,0 +1,114 @@ +From 8349b82620d1effea2b75584481430983b669e0e 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 1ac9de69bde65..3096769e718ed 100644 +--- a/drivers/net/vxlan/vxlan_core.c ++++ b/drivers/net/vxlan/vxlan_core.c +@@ -729,6 +729,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, +@@ -1737,35 +1763,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) +@@ -1866,8 +1863,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 +