From: Sasha Levin Date: Thu, 19 Dec 2024 19:23:49 +0000 (-0500) Subject: Fixes for 5.10 X-Git-Tag: v6.1.122~52 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a1601db2267256c934f1eedcbd012ce943aff008;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.10 Signed-off-by: Sasha Levin --- diff --git a/queue-5.10/alsa-usb-fix-ubsan-warning-in-parse_audio_unit.patch b/queue-5.10/alsa-usb-fix-ubsan-warning-in-parse_audio_unit.patch new file mode 100644 index 00000000000..af60e6be4bf --- /dev/null +++ b/queue-5.10/alsa-usb-fix-ubsan-warning-in-parse_audio_unit.patch @@ -0,0 +1,47 @@ +From 7f9cf86aada94a2f5ef4e79f6ab8956862e81166 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jul 2024 12:09:44 -0400 +Subject: ALSA: usb: Fix UBSAN warning in parse_audio_unit() + +From: Takashi Iwai + +[ Upstream commit 2f38cf730caedaeacdefb7ff35b0a3c1168117f9 ] + +A malformed USB descriptor may pass the lengthy mixer description with +a lot of channels, and this may overflow the 32bit integer shift +size, as caught by syzbot UBSAN test. Although this won't cause any +real trouble, it's better to address. + +This patch introduces a sanity check of the number of channels to bail +out the parsing when too many channels are found. + +Reported-by: syzbot+78d5b129a762182225aa@syzkaller.appspotmail.com +Closes: https://lore.kernel.org/0000000000000adac5061d3c7355@google.com +Link: https://patch.msgid.link/20240715123619.26612-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Sasha Levin +--- + sound/usb/mixer.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c +index b598f8f0d06e..8826a588f5ab 100644 +--- a/sound/usb/mixer.c ++++ b/sound/usb/mixer.c +@@ -1932,6 +1932,13 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, + bmaControls = ftr->bmaControls; + } + ++ if (channels > 32) { ++ usb_audio_info(state->chip, ++ "usbmixer: too many channels (%d) in unit %d\n", ++ channels, unitid); ++ return -EINVAL; ++ } ++ + /* parse the source unit */ + err = parse_audio_unit(state, hdr->bSourceID); + if (err < 0) +-- +2.39.5 + diff --git a/queue-5.10/asoc-intel-sof_sdw-add-quirks-for-some-new-dell-lapt.patch b/queue-5.10/asoc-intel-sof_sdw-add-quirks-for-some-new-dell-lapt.patch new file mode 100644 index 00000000000..f6d3e1316f6 --- /dev/null +++ b/queue-5.10/asoc-intel-sof_sdw-add-quirks-for-some-new-dell-lapt.patch @@ -0,0 +1,52 @@ +From 65ba2936c65d6fac05e418d75f91dbca8817e05a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jul 2024 12:09:35 -0400 +Subject: ASoC: Intel: sof_sdw: Add quirks for some new Dell laptops + +From: Charles Keepax + +[ Upstream commit 91cdecaba791c74df6da0650e797fe1192cf2700 ] + +Add quirks for some new Dell laptops using Cirrus amplifiers in a bridge +configuration. + +Reviewed-by: Bard Liao +Signed-off-by: Charles Keepax +Signed-off-by: Pierre-Louis Bossart +Link: https://msgid.link/r/20240527193552.165567-11-pierre-louis.bossart@linux.intel.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + sound/soc/intel/boards/sof_sdw.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c +index 25bf73a7e7bf..ad3694d36d96 100644 +--- a/sound/soc/intel/boards/sof_sdw.c ++++ b/sound/soc/intel/boards/sof_sdw.c +@@ -234,6 +234,22 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { + }, + .driver_data = (void *)(RT711_JD2_100K), + }, ++ { ++ .callback = sof_sdw_quirk_cb, ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0CE3") ++ }, ++ .driver_data = (void *)(SOF_SIDECAR_AMPS), ++ }, ++ { ++ .callback = sof_sdw_quirk_cb, ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), ++ DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0CE4") ++ }, ++ .driver_data = (void *)(SOF_SIDECAR_AMPS), ++ }, + {} + }; + +-- +2.39.5 + diff --git a/queue-5.10/erofs-fix-incorrect-symlink-detection-in-fast-symlin.patch b/queue-5.10/erofs-fix-incorrect-symlink-detection-in-fast-symlin.patch new file mode 100644 index 00000000000..48b6a04beba --- /dev/null +++ b/queue-5.10/erofs-fix-incorrect-symlink-detection-in-fast-symlin.patch @@ -0,0 +1,78 @@ +From 80caa716774313b82cfbb2216976f99b68300c06 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Dec 2024 15:36:26 +0800 +Subject: erofs: fix incorrect symlink detection in fast symlink +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Gao Xiang + +commit 9ed50b8231e37b1ae863f5dec8153b98d9f389b4 upstream. + +Fast symlink can be used if the on-disk symlink data is stored +in the same block as the on-disk inode, so we don’t need to trigger +another I/O for symlink data. However, currently fs correction could be +reported _incorrectly_ if inode xattrs are too large. + +In fact, these should be valid images although they cannot be handled as +fast symlinks. + +Many thanks to Colin for reporting this! + +Reported-by: Colin Walters +Reported-by: https://honggfuzz.dev/ +Link: https://lore.kernel.org/r/bb2dd430-7de0-47da-ae5b-82ab2dd4d945@app.fastmail.com +Fixes: 431339ba9042 ("staging: erofs: add inode operations") +[ Note that it's a runtime misbehavior instead of a security issue. ] +Link: https://lore.kernel.org/r/20240909031911.1174718-1-hsiangkao@linux.alibaba.com +[ Gao Xiang: fix 5.10.y build warning due to `check_add_overflow`. ] +Signed-off-by: Gao Xiang +Signed-off-by: Sasha Levin +--- + fs/erofs/inode.c | 20 ++++++-------------- + 1 file changed, 6 insertions(+), 14 deletions(-) + +diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c +index 93a4ed665d93..60b4c4326dae 100644 +--- a/fs/erofs/inode.c ++++ b/fs/erofs/inode.c +@@ -198,11 +198,14 @@ static int erofs_fill_symlink(struct inode *inode, void *data, + unsigned int m_pofs) + { + struct erofs_inode *vi = EROFS_I(inode); ++ loff_t off; + char *lnk; + +- /* if it cannot be handled with fast symlink scheme */ +- if (vi->datalayout != EROFS_INODE_FLAT_INLINE || +- inode->i_size >= PAGE_SIZE || inode->i_size < 0) { ++ m_pofs += vi->xattr_isize; ++ /* check if it cannot be handled with fast symlink scheme */ ++ if (vi->datalayout != EROFS_INODE_FLAT_INLINE || inode->i_size < 0 || ++ check_add_overflow((loff_t)m_pofs, inode->i_size, &off) || ++ off > i_blocksize(inode)) { + inode->i_op = &erofs_symlink_iops; + return 0; + } +@@ -211,17 +214,6 @@ static int erofs_fill_symlink(struct inode *inode, void *data, + if (!lnk) + return -ENOMEM; + +- m_pofs += vi->xattr_isize; +- /* inline symlink data shouldn't cross page boundary as well */ +- if (m_pofs + inode->i_size > PAGE_SIZE) { +- kfree(lnk); +- erofs_err(inode->i_sb, +- "inline data cross block boundary @ nid %llu", +- vi->nid); +- DBG_BUGON(1); +- return -EFSCORRUPTED; +- } +- + memcpy(lnk, data + m_pofs, inode->i_size); + lnk[inode->i_size] = '\0'; + +-- +2.39.5 + diff --git a/queue-5.10/erofs-fix-order-max_order-warning-due-to-crafted-neg.patch b/queue-5.10/erofs-fix-order-max_order-warning-due-to-crafted-neg.patch new file mode 100644 index 00000000000..cc43e8d1798 --- /dev/null +++ b/queue-5.10/erofs-fix-order-max_order-warning-due-to-crafted-neg.patch @@ -0,0 +1,43 @@ +From 78d91930eb3a75028fd9bbf9242250f084d3d7d5 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Wed, 18 Dec 2024 15:36:25 +0800 +Subject: erofs: fix order >= MAX_ORDER warning due to crafted negative i_size + +From: Gao Xiang + +commit 1dd73601a1cba37a0ed5f89a8662c90191df5873 upstream. + +As syzbot reported [1], the root cause is that i_size field is a +signed type, and negative i_size is also less than EROFS_BLKSIZ. +As a consequence, it's handled as fast symlink unexpectedly. + +Let's fall back to the generic path to deal with such unusual i_size. + +[1] https://lore.kernel.org/r/000000000000ac8efa05e7feaa1f@google.com + +Reported-by: syzbot+f966c13b1b4fc0403b19@syzkaller.appspotmail.com +Fixes: 431339ba9042 ("staging: erofs: add inode operations") +Reviewed-by: Yue Hu +Link: https://lore.kernel.org/r/20220909023948.28925-1-hsiangkao@linux.alibaba.com +Signed-off-by: Gao Xiang +Signed-off-by: Sasha Levin +--- + fs/erofs/inode.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c +index 0a94a52a119f..93a4ed665d93 100644 +--- a/fs/erofs/inode.c ++++ b/fs/erofs/inode.c +@@ -202,7 +202,7 @@ static int erofs_fill_symlink(struct inode *inode, void *data, + + /* if it cannot be handled with fast symlink scheme */ + if (vi->datalayout != EROFS_INODE_FLAT_INLINE || +- inode->i_size >= PAGE_SIZE) { ++ inode->i_size >= PAGE_SIZE || inode->i_size < 0) { + inode->i_op = &erofs_symlink_iops; + return 0; + } +-- +2.39.5 + diff --git a/queue-5.10/i2c-pnx-fix-timeout-in-wait-functions.patch b/queue-5.10/i2c-pnx-fix-timeout-in-wait-functions.patch new file mode 100644 index 00000000000..844ea252cbc --- /dev/null +++ b/queue-5.10/i2c-pnx-fix-timeout-in-wait-functions.patch @@ -0,0 +1,48 @@ +From 1f169e9079bb14335c54b0a788213ba6e6fa18c1 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sat, 7 Dec 2024 00:19:34 +0100 +Subject: i2c: pnx: Fix timeout in wait functions + +From: Vladimir Riabchun + +[ Upstream commit 7363f2d4c18557c99c536b70489187bb4e05c412 ] + +Since commit f63b94be6942 ("i2c: pnx: Fix potential deadlock warning +from del_timer_sync() call in isr") jiffies are stored in +i2c_pnx_algo_data.timeout, but wait_timeout and wait_reset are still +using it as milliseconds. Convert jiffies back to milliseconds to wait +for the expected amount of time. + +Fixes: f63b94be6942 ("i2c: pnx: Fix potential deadlock warning from del_timer_sync() call in isr") +Signed-off-by: Vladimir Riabchun +Signed-off-by: Andi Shyti +Signed-off-by: Sasha Levin +--- + drivers/i2c/busses/i2c-pnx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c +index b6b5a65efcbb..5ff9218b4a62 100644 +--- a/drivers/i2c/busses/i2c-pnx.c ++++ b/drivers/i2c/busses/i2c-pnx.c +@@ -95,7 +95,7 @@ enum { + + static inline int wait_timeout(struct i2c_pnx_algo_data *data) + { +- long timeout = data->timeout; ++ long timeout = jiffies_to_msecs(data->timeout); + while (timeout > 0 && + (ioread32(I2C_REG_STS(data)) & mstatus_active)) { + mdelay(1); +@@ -106,7 +106,7 @@ static inline int wait_timeout(struct i2c_pnx_algo_data *data) + + static inline int wait_reset(struct i2c_pnx_algo_data *data) + { +- long timeout = data->timeout; ++ long timeout = jiffies_to_msecs(data->timeout); + while (timeout > 0 && + (ioread32(I2C_REG_CTL(data)) & mcntrl_reset)) { + mdelay(1); +-- +2.39.5 + diff --git a/queue-5.10/mips-loongson64-dts-fix-msi-node-for-ls7a.patch b/queue-5.10/mips-loongson64-dts-fix-msi-node-for-ls7a.patch new file mode 100644 index 00000000000..a4e20cefbd4 --- /dev/null +++ b/queue-5.10/mips-loongson64-dts-fix-msi-node-for-ls7a.patch @@ -0,0 +1,36 @@ +From 46f8affe9e2bc7be8b3eb3a64ff7f1ba69357840 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jul 2024 12:09:40 -0400 +Subject: MIPS: Loongson64: DTS: Fix msi node for ls7a + +From: Jiaxun Yang + +[ Upstream commit 98a9e2ac3755a353eefea8c52e23d5b0c50f3899 ] + +Add it to silent warning: +arch/mips/boot/dts/loongson/ls7a-pch.dtsi:68.16-416.5: Warning (interrupt_provider): /bus@10000000/pci@1a000000: '#interrupt-cells' found, but node is not an interrupt provider +arch/mips/boot/dts/loongson/loongson64g_4core_ls7a.dts:32.31-40.4: Warning (interrupt_provider): /bus@10000000/msi-controller@2ff00000: Missing '#interrupt-cells' in interrupt provider +arch/mips/boot/dts/loongson/loongson64g_4core_ls7a.dtb: Warning (interrupt_map): Failed prerequisite 'interrupt_provider' + +Signed-off-by: Jiaxun Yang +Signed-off-by: Thomas Bogendoerfer +Signed-off-by: Sasha Levin +--- + arch/mips/boot/dts/loongson/loongson64g_4core_ls7a.dts | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/mips/boot/dts/loongson/loongson64g_4core_ls7a.dts b/arch/mips/boot/dts/loongson/loongson64g_4core_ls7a.dts +index c945f8565d54..fb180cb2b8e2 100644 +--- a/arch/mips/boot/dts/loongson/loongson64g_4core_ls7a.dts ++++ b/arch/mips/boot/dts/loongson/loongson64g_4core_ls7a.dts +@@ -33,6 +33,7 @@ + compatible = "loongson,pch-msi-1.0"; + reg = <0 0x2ff00000 0 0x8>; + interrupt-controller; ++ #interrupt-cells = <1>; + msi-controller; + loongson,msi-base-vec = <64>; + loongson,msi-num-vecs = <192>; +-- +2.39.5 + diff --git a/queue-5.10/pci-add-acs-quirk-for-broadcom-bcm5760x-nic.patch b/queue-5.10/pci-add-acs-quirk-for-broadcom-bcm5760x-nic.patch new file mode 100644 index 00000000000..1bc97ca3809 --- /dev/null +++ b/queue-5.10/pci-add-acs-quirk-for-broadcom-bcm5760x-nic.patch @@ -0,0 +1,51 @@ +From 0a01dace90e7afd298cce5f3d39c144dfa4da7e8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jul 2024 12:09:34 -0400 +Subject: PCI: Add ACS quirk for Broadcom BCM5760X NIC +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Ajit Khaparde + +[ Upstream commit 524e057b2d66b61f9b63b6db30467ab7b0bb4796 ] + +The Broadcom BCM5760X NIC may be a multi-function device. + +While it does not advertise an ACS capability, peer-to-peer transactions +are not possible between the individual functions. So it is ok to treat +them as fully isolated. + +Add an ACS quirk for this device so the functions can be in independent +IOMMU groups and attached individually to userspace applications using +VFIO. + +[kwilczynski: commit log] +Link: https://lore.kernel.org/linux-pci/20240510204228.73435-1-ajit.khaparde@broadcom.com +Signed-off-by: Ajit Khaparde +Signed-off-by: Krzysztof Wilczyński +Signed-off-by: Bjorn Helgaas +Reviewed-by: Andy Gospodarek +Signed-off-by: Sasha Levin +--- + drivers/pci/quirks.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c +index 37cc08d70636..7c65513e55c2 100644 +--- a/drivers/pci/quirks.c ++++ b/drivers/pci/quirks.c +@@ -4956,6 +4956,10 @@ static const struct pci_dev_acs_enabled { + { PCI_VENDOR_ID_BROADCOM, 0x1750, pci_quirk_mf_endpoint_acs }, + { PCI_VENDOR_ID_BROADCOM, 0x1751, pci_quirk_mf_endpoint_acs }, + { PCI_VENDOR_ID_BROADCOM, 0x1752, pci_quirk_mf_endpoint_acs }, ++ { PCI_VENDOR_ID_BROADCOM, 0x1760, pci_quirk_mf_endpoint_acs }, ++ { PCI_VENDOR_ID_BROADCOM, 0x1761, pci_quirk_mf_endpoint_acs }, ++ { PCI_VENDOR_ID_BROADCOM, 0x1762, pci_quirk_mf_endpoint_acs }, ++ { PCI_VENDOR_ID_BROADCOM, 0x1763, pci_quirk_mf_endpoint_acs }, + { PCI_VENDOR_ID_BROADCOM, 0xD714, pci_quirk_brcm_acs }, + /* Amazon Annapurna Labs */ + { PCI_VENDOR_ID_AMAZON_ANNAPURNA_LABS, 0x0031, pci_quirk_al_acs }, +-- +2.39.5 + diff --git a/queue-5.10/pci-aer-disable-aer-service-on-suspend.patch b/queue-5.10/pci-aer-disable-aer-service-on-suspend.patch new file mode 100644 index 00000000000..f38a5401a7c --- /dev/null +++ b/queue-5.10/pci-aer-disable-aer-service-on-suspend.patch @@ -0,0 +1,68 @@ +From 2145f7510381022e3f6b26067297d8fa875ee12b Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jul 2024 12:09:41 -0400 +Subject: PCI/AER: Disable AER service on suspend + +From: Kai-Heng Feng + +[ Upstream commit 5afc2f763edc5daae4722ee46fea4e627d01fa90 ] + +If the link is powered off during suspend, electrical noise may cause +errors that are logged via AER. If the AER interrupt is enabled and shares +an IRQ with PME, that causes a spurious wakeup during suspend. + +Disable the AER interrupt during suspend to prevent this. Clear error +status before re-enabling IRQ interrupts during resume so we don't get an +interrupt for errors that occurred during the suspend/resume process. + +Link: https://bugzilla.kernel.org/show_bug.cgi?id=209149 +Link: https://bugzilla.kernel.org/show_bug.cgi?id=216295 +Link: https://bugzilla.kernel.org/show_bug.cgi?id=218090 +Link: https://lore.kernel.org/r/20240416043225.1462548-2-kai.heng.feng@canonical.com +Signed-off-by: Kai-Heng Feng +[bhelgaas: drop pci_ancestor_pr3_present() etc, commit log] +Signed-off-by: Bjorn Helgaas +Signed-off-by: Sasha Levin +--- + drivers/pci/pcie/aer.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c +index d58b02237075..974d56644973 100644 +--- a/drivers/pci/pcie/aer.c ++++ b/drivers/pci/pcie/aer.c +@@ -1373,6 +1373,22 @@ static int aer_probe(struct pcie_device *dev) + return 0; + } + ++static int aer_suspend(struct pcie_device *dev) ++{ ++ struct aer_rpc *rpc = get_service_data(dev); ++ ++ aer_disable_rootport(rpc); ++ return 0; ++} ++ ++static int aer_resume(struct pcie_device *dev) ++{ ++ struct aer_rpc *rpc = get_service_data(dev); ++ ++ aer_enable_rootport(rpc); ++ return 0; ++} ++ + /** + * aer_root_reset - reset Root Port hierarchy or RCEC + * @dev: pointer to Root Port or RCEC +@@ -1431,6 +1447,8 @@ static struct pcie_port_service_driver aerdriver = { + .service = PCIE_PORT_SERVICE_AER, + + .probe = aer_probe, ++ .suspend = aer_suspend, ++ .resume = aer_resume, + .remove = aer_remove, + }; + +-- +2.39.5 + diff --git a/queue-5.10/pci-use-preserve_config-in-place-of-pci_flags.patch b/queue-5.10/pci-use-preserve_config-in-place-of-pci_flags.patch new file mode 100644 index 00000000000..7c0a909f38f --- /dev/null +++ b/queue-5.10/pci-use-preserve_config-in-place-of-pci_flags.patch @@ -0,0 +1,77 @@ +From 07740f70454bad39bb230cfacb932b8608ab4b3c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jul 2024 12:09:36 -0400 +Subject: PCI: Use preserve_config in place of pci_flags + +From: Vidya Sagar + +[ Upstream commit 7246a4520b4bf1494d7d030166a11b5226f6d508 ] + +Use preserve_config in place of checking for PCI_PROBE_ONLY flag to enable +support for "linux,pci-probe-only" on a per host bridge basis. + +This also obviates the use of adding PCI_REASSIGN_ALL_BUS flag if +!PCI_PROBE_ONLY, as pci_assign_unassigned_root_bus_resources() takes care +of reassigning the resources that are not already claimed. + +Link: https://lore.kernel.org/r/20240508174138.3630283-5-vidyas@nvidia.com +Signed-off-by: Vidya Sagar +Signed-off-by: Bjorn Helgaas +Signed-off-by: Sasha Levin +--- + drivers/pci/controller/pci-host-common.c | 4 ---- + drivers/pci/probe.c | 20 +++++++++----------- + 2 files changed, 9 insertions(+), 15 deletions(-) + +diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c +index 6ce34a1deecb..2525bd043261 100644 +--- a/drivers/pci/controller/pci-host-common.c ++++ b/drivers/pci/controller/pci-host-common.c +@@ -71,10 +71,6 @@ int pci_host_common_probe(struct platform_device *pdev) + if (IS_ERR(cfg)) + return PTR_ERR(cfg); + +- /* Do not reassign resources if probe only */ +- if (!pci_has_flag(PCI_PROBE_ONLY)) +- pci_add_flags(PCI_REASSIGN_ALL_BUS); +- + bridge->sysdata = cfg; + bridge->ops = (struct pci_ops *)&ops->pci_ops; + +diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c +index 02a75f3b5920..b0ac721e047d 100644 +--- a/drivers/pci/probe.c ++++ b/drivers/pci/probe.c +@@ -3018,20 +3018,18 @@ int pci_host_probe(struct pci_host_bridge *bridge) + + bus = bridge->bus; + ++ /* If we must preserve the resource configuration, claim now */ ++ if (bridge->preserve_config) ++ pci_bus_claim_resources(bus); ++ + /* +- * We insert PCI resources into the iomem_resource and +- * ioport_resource trees in either pci_bus_claim_resources() +- * or pci_bus_assign_resources(). ++ * Assign whatever was left unassigned. If we didn't claim above, ++ * this will reassign everything. + */ +- if (pci_has_flag(PCI_PROBE_ONLY)) { +- pci_bus_claim_resources(bus); +- } else { +- pci_bus_size_bridges(bus); +- pci_bus_assign_resources(bus); ++ pci_assign_unassigned_root_bus_resources(bus); + +- list_for_each_entry(child, &bus->children, node) +- pcie_bus_configure_settings(child); +- } ++ list_for_each_entry(child, &bus->children, node) ++ pcie_bus_configure_settings(child); + + pci_bus_add_devices(bus); + return 0; +-- +2.39.5 + diff --git a/queue-5.10/series b/queue-5.10/series index 19e6f6cda0b..497fc9bbef7 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -1 +1,12 @@ net-sched-fix-ordering-of-qlen-adjustment.patch +asoc-intel-sof_sdw-add-quirks-for-some-new-dell-lapt.patch +pci-aer-disable-aer-service-on-suspend.patch +pci-use-preserve_config-in-place-of-pci_flags.patch +mips-loongson64-dts-fix-msi-node-for-ls7a.patch +alsa-usb-fix-ubsan-warning-in-parse_audio_unit.patch +pci-add-acs-quirk-for-broadcom-bcm5760x-nic.patch +usb-cdns3-add-quirk-flag-to-enable-suspend-residency.patch +usb-dwc2-gadget-don-t-write-invalid-mapped-sg-entrie.patch +i2c-pnx-fix-timeout-in-wait-functions.patch +erofs-fix-order-max_order-warning-due-to-crafted-neg.patch +erofs-fix-incorrect-symlink-detection-in-fast-symlin.patch diff --git a/queue-5.10/usb-cdns3-add-quirk-flag-to-enable-suspend-residency.patch b/queue-5.10/usb-cdns3-add-quirk-flag-to-enable-suspend-residency.patch new file mode 100644 index 00000000000..8ec2253d1b4 --- /dev/null +++ b/queue-5.10/usb-cdns3-add-quirk-flag-to-enable-suspend-residency.patch @@ -0,0 +1,86 @@ +From 9d88cd22686b5b266e1798341af3a5a248c245bb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jul 2024 12:09:37 -0400 +Subject: usb: cdns3: Add quirk flag to enable suspend residency + +From: Roger Quadros + +[ Upstream commit 0aca19e4037a4143273e90f1b44666b78b4dde9b ] + +Some platforms (e.g. ti,j721e-usb, ti,am64-usb) require +this bit to be set to workaround a lockup issue with PHY +short suspend intervals [1]. Add a platform quirk flag +to indicate if Suspend Residency should be enabled. + +[1] - https://www.ti.com/lit/er/sprz457h/sprz457h.pdf +i2409 - USB: USB2 PHY locks up due to short suspend + +Signed-off-by: Roger Quadros +Signed-off-by: Ravi Gunasekaran +Acked-by: Peter Chen +Link: https://lore.kernel.org/r/20240516044537.16801-2-r-gunasekaran@ti.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/cdns3/core.h | 1 + + drivers/usb/cdns3/drd.c | 10 +++++++++- + drivers/usb/cdns3/drd.h | 3 +++ + 3 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/drivers/usb/cdns3/core.h b/drivers/usb/cdns3/core.h +index 0d87871499ea..1cecc9721423 100644 +--- a/drivers/usb/cdns3/core.h ++++ b/drivers/usb/cdns3/core.h +@@ -44,6 +44,7 @@ struct cdns3_platform_data { + bool suspend, bool wakeup); + unsigned long quirks; + #define CDNS3_DEFAULT_PM_RUNTIME_ALLOW BIT(0) ++#define CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE BIT(1) + }; + + /** +diff --git a/drivers/usb/cdns3/drd.c b/drivers/usb/cdns3/drd.c +index 95863d44e3e0..7f33fe02c0ea 100644 +--- a/drivers/usb/cdns3/drd.c ++++ b/drivers/usb/cdns3/drd.c +@@ -358,7 +358,7 @@ static irqreturn_t cdns3_drd_irq(int irq, void *data) + int cdns3_drd_init(struct cdns3 *cdns) + { + void __iomem *regs; +- u32 state; ++ u32 state, reg; + int ret; + + regs = devm_ioremap_resource(cdns->dev, &cdns->otg_res); +@@ -400,6 +400,14 @@ int cdns3_drd_init(struct cdns3 *cdns) + cdns->otg_irq_regs = (struct cdns3_otg_irq_regs *) + &cdns->otg_v1_regs->ien; + writel(1, &cdns->otg_v1_regs->simulate); ++ ++ if (cdns->pdata && ++ (cdns->pdata->quirks & CDNS3_DRD_SUSPEND_RESIDENCY_ENABLE)) { ++ reg = readl(&cdns->otg_v1_regs->susp_ctrl); ++ reg |= SUSP_CTRL_SUSPEND_RESIDENCY_ENABLE; ++ writel(reg, &cdns->otg_v1_regs->susp_ctrl); ++ } ++ + cdns->version = CDNS3_CONTROLLER_V1; + } + +diff --git a/drivers/usb/cdns3/drd.h b/drivers/usb/cdns3/drd.h +index a767b6893938..729374f12cd7 100644 +--- a/drivers/usb/cdns3/drd.h ++++ b/drivers/usb/cdns3/drd.h +@@ -190,6 +190,9 @@ struct cdns3_otg_irq_regs { + /* OTGREFCLK - bitmasks */ + #define OTGREFCLK_STB_CLK_SWITCH_EN BIT(31) + ++/* SUPS_CTRL - bitmasks */ ++#define SUSP_CTRL_SUSPEND_RESIDENCY_ENABLE BIT(17) ++ + /* OVERRIDE - bitmasks */ + #define OVERRIDE_IDPULLUP BIT(0) + /* Only for CDNS3_CONTROLLER_V0 version */ +-- +2.39.5 + diff --git a/queue-5.10/usb-dwc2-gadget-don-t-write-invalid-mapped-sg-entrie.patch b/queue-5.10/usb-dwc2-gadget-don-t-write-invalid-mapped-sg-entrie.patch new file mode 100644 index 00000000000..6a17c0e612b --- /dev/null +++ b/queue-5.10/usb-dwc2-gadget-don-t-write-invalid-mapped-sg-entrie.patch @@ -0,0 +1,56 @@ +From aee744c745dd8dc4d598bc528f3ac1abf63803e8 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Sun, 28 Jul 2024 12:09:38 -0400 +Subject: usb: dwc2: gadget: Don't write invalid mapped sg entries into + dma_desc with iommu enabled + +From: Peng Hongchi + +[ Upstream commit 1134289b6b93d73721340b66c310fd985385e8fa ] + +When using dma_map_sg() to map the scatterlist with iommu enabled, +the entries in the scatterlist can be mergerd into less but longer +entries in the function __finalise_sg(). So that the number of +valid mapped entries is actually smaller than ureq->num_reqs,and +there are still some invalid entries in the scatterlist with +dma_addr=0xffffffff and len=0. Writing these invalid sg entries +into the dma_desc can cause a data transmission error. + +The function dma_map_sg() returns the number of valid map entries +and the return value is assigned to usb_request::num_mapped_sgs in +function usb_gadget_map_request_by_dev(). So that just write valid +mapped entries into dma_desc according to the usb_request::num_mapped_sgs, +and set the IOC bit if it's the last valid mapped entry. + +This patch poses no risk to no-iommu situation, cause +ureq->num_mapped_sgs equals ureq->num_sgs while using dma_direct_map_sg() +to map the scatterlist whith iommu disabled. + +Signed-off-by: Peng Hongchi +Link: https://lore.kernel.org/r/20240523100315.7226-1-hongchi.peng@siengine.com +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Sasha Levin +--- + drivers/usb/dwc2/gadget.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c +index d8b83665581f..af8a0bb5c508 100644 +--- a/drivers/usb/dwc2/gadget.c ++++ b/drivers/usb/dwc2/gadget.c +@@ -886,10 +886,10 @@ static void dwc2_gadget_config_nonisoc_xfer_ddma(struct dwc2_hsotg_ep *hs_ep, + } + + /* DMA sg buffer */ +- for_each_sg(ureq->sg, sg, ureq->num_sgs, i) { ++ for_each_sg(ureq->sg, sg, ureq->num_mapped_sgs, i) { + dwc2_gadget_fill_nonisoc_xfer_ddma_one(hs_ep, &desc, + sg_dma_address(sg) + sg->offset, sg_dma_len(sg), +- sg_is_last(sg)); ++ (i == (ureq->num_mapped_sgs - 1))); + desc_count += hs_ep->desc_count; + } + +-- +2.39.5 +