From 35c865f719a895a5b3d171e32863c97e88118cb8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 20 Jun 2025 07:45:11 +0200 Subject: [PATCH] 6.12-stable patches added patches: asoc-amd-sof_amd_sdw-fix-unlikely-uninitialized-variable-use-in-create_sdw_dailinks.patch asoc-meson-meson-card-utils-use-of_property_present-for-dt-parsing.patch asoc-qcom-sdm845-add-error-handling-in-sdm845_slim_snd_hw_params.patch configfs-do-not-override-creating-attribute-file-failure-in-populate_attrs.patch crypto-marvell-cesa-do-not-chain-submitted-requests.patch crypto-qat-add-shutdown-handler-to-qat_420xx.patch crypto-qat-add-shutdown-handler-to-qat_4xxx.patch crypto-qat-add-shutdown-handler-to-qat_c3xxx.patch crypto-qat-add-shutdown-handler-to-qat_c62x.patch crypto-qat-add-shutdown-handler-to-qat_dh895xcc.patch gfs2-move-msleep-to-sleepable-context.patch io_uring-account-drain-memory-to-cgroup.patch io_uring-kbuf-account-ring-io_buffer_list-memory.patch net-mlx5-add-error-handling-in-mlx5_query_nic_vport_node_guid.patch net-mlx5_core-add-error-handling-inmlx5_query_nic_vport_qkey_viol_cntr.patch powerpc-pseries-msi-avoid-reading-pci-device-registers-in-reduced-power-states.patch regulator-max20086-change-enable-gpio-to-optional.patch regulator-max20086-fix-max200086-chip-id.patch s390-pci-allow-re-add-of-a-reserved-but-not-yet-removed-device.patch s390-pci-prevent-self-deletion-in-disable_slot.patch s390-pci-remove-redundant-bus-removal-and-disable-from-zpci_release_device.patch s390-pci-serialize-device-addition-and-removal.patch series wifi-mt76-mt7925-fix-host-interrupt-register-initialization.patch wifi-p54-prevent-buffer-overflow-in-p54_rx_eeprom_readback.patch --- ...-variable-use-in-create_sdw_dailinks.patch | 38 ++++ ...e-of_property_present-for-dt-parsing.patch | 43 +++++ ...andling-in-sdm845_slim_snd_hw_params.patch | 41 ++++ ...ibute-file-failure-in-populate_attrs.patch | 39 ++++ ...cesa-do-not-chain-submitted-requests.patch | 156 +++++++++++++++ ...at-add-shutdown-handler-to-qat_420xx.patch | 58 ++++++ ...qat-add-shutdown-handler-to-qat_4xxx.patch | 61 ++++++ ...at-add-shutdown-handler-to-qat_c3xxx.patch | 63 +++++++ ...qat-add-shutdown-handler-to-qat_c62x.patch | 63 +++++++ ...add-shutdown-handler-to-qat_dh895xcc.patch | 63 +++++++ ...fs2-move-msleep-to-sleepable-context.patch | 42 +++++ ...uring-account-drain-memory-to-cgroup.patch | 33 ++++ ...f-account-ring-io_buffer_list-memory.patch | 34 ++++ ...ng-in-mlx5_query_nic_vport_node_guid.patch | 55 ++++++ ...nmlx5_query_nic_vport_qkey_viol_cntr.patch | 56 ++++++ ...ce-registers-in-reduced-power-states.patch | 57 ++++++ ...20086-change-enable-gpio-to-optional.patch | 38 ++++ ...lator-max20086-fix-max200086-chip-id.patch | 38 ++++ ...-reserved-but-not-yet-removed-device.patch | 178 ++++++++++++++++++ ...revent-self-deletion-in-disable_slot.patch | 53 ++++++ ...and-disable-from-zpci_release_device.patch | 43 +++++ ...erialize-device-addition-and-removal.patch | 86 +++++++++ queue-6.12/series | 24 +++ ...st-interrupt-register-initialization.patch | 47 +++++ ...r-overflow-in-p54_rx_eeprom_readback.patch | 114 +++++++++++ 25 files changed, 1523 insertions(+) create mode 100644 queue-6.12/asoc-amd-sof_amd_sdw-fix-unlikely-uninitialized-variable-use-in-create_sdw_dailinks.patch create mode 100644 queue-6.12/asoc-meson-meson-card-utils-use-of_property_present-for-dt-parsing.patch create mode 100644 queue-6.12/asoc-qcom-sdm845-add-error-handling-in-sdm845_slim_snd_hw_params.patch create mode 100644 queue-6.12/configfs-do-not-override-creating-attribute-file-failure-in-populate_attrs.patch create mode 100644 queue-6.12/crypto-marvell-cesa-do-not-chain-submitted-requests.patch create mode 100644 queue-6.12/crypto-qat-add-shutdown-handler-to-qat_420xx.patch create mode 100644 queue-6.12/crypto-qat-add-shutdown-handler-to-qat_4xxx.patch create mode 100644 queue-6.12/crypto-qat-add-shutdown-handler-to-qat_c3xxx.patch create mode 100644 queue-6.12/crypto-qat-add-shutdown-handler-to-qat_c62x.patch create mode 100644 queue-6.12/crypto-qat-add-shutdown-handler-to-qat_dh895xcc.patch create mode 100644 queue-6.12/gfs2-move-msleep-to-sleepable-context.patch create mode 100644 queue-6.12/io_uring-account-drain-memory-to-cgroup.patch create mode 100644 queue-6.12/io_uring-kbuf-account-ring-io_buffer_list-memory.patch create mode 100644 queue-6.12/net-mlx5-add-error-handling-in-mlx5_query_nic_vport_node_guid.patch create mode 100644 queue-6.12/net-mlx5_core-add-error-handling-inmlx5_query_nic_vport_qkey_viol_cntr.patch create mode 100644 queue-6.12/powerpc-pseries-msi-avoid-reading-pci-device-registers-in-reduced-power-states.patch create mode 100644 queue-6.12/regulator-max20086-change-enable-gpio-to-optional.patch create mode 100644 queue-6.12/regulator-max20086-fix-max200086-chip-id.patch create mode 100644 queue-6.12/s390-pci-allow-re-add-of-a-reserved-but-not-yet-removed-device.patch create mode 100644 queue-6.12/s390-pci-prevent-self-deletion-in-disable_slot.patch create mode 100644 queue-6.12/s390-pci-remove-redundant-bus-removal-and-disable-from-zpci_release_device.patch create mode 100644 queue-6.12/s390-pci-serialize-device-addition-and-removal.patch create mode 100644 queue-6.12/series create mode 100644 queue-6.12/wifi-mt76-mt7925-fix-host-interrupt-register-initialization.patch create mode 100644 queue-6.12/wifi-p54-prevent-buffer-overflow-in-p54_rx_eeprom_readback.patch diff --git a/queue-6.12/asoc-amd-sof_amd_sdw-fix-unlikely-uninitialized-variable-use-in-create_sdw_dailinks.patch b/queue-6.12/asoc-amd-sof_amd_sdw-fix-unlikely-uninitialized-variable-use-in-create_sdw_dailinks.patch new file mode 100644 index 0000000000..6080de42a7 --- /dev/null +++ b/queue-6.12/asoc-amd-sof_amd_sdw-fix-unlikely-uninitialized-variable-use-in-create_sdw_dailinks.patch @@ -0,0 +1,38 @@ +From 6b83ba4bc3ecb915476d688c9f00f3be57b49a0c Mon Sep 17 00:00:00 2001 +From: Vijendar Mukunda +Date: Tue, 6 May 2025 17:37:23 +0530 +Subject: ASoC: amd: sof_amd_sdw: Fix unlikely uninitialized variable use in create_sdw_dailinks() + +From: Vijendar Mukunda + +commit 6b83ba4bc3ecb915476d688c9f00f3be57b49a0c upstream. + +Initialize current_be_id to 0 in SOF based AMD generic SoundWire machine +driver to handle the unlikely case when there are no devices connected to +a DAI. +In this case create_sdw_dailink() would return without touching the passed +pointer to current_be_id. + +Found by gcc -fanalyzer + +Cc: stable@vger.kernel.org +Fixes: 6d8348ddc56ed ("ASoC: amd: acp: refactor SoundWire machine driver code") +Signed-off-by: Vijendar Mukunda +Link: https://patch.msgid.link/20250506120823.3621604-2-Vijendar.Mukunda@amd.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/amd/acp/acp-sdw-sof-mach.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/amd/acp/acp-sdw-sof-mach.c ++++ b/sound/soc/amd/acp/acp-sdw-sof-mach.c +@@ -267,7 +267,7 @@ static int create_sdw_dailinks(struct sn + + /* generate DAI links by each sdw link */ + while (sof_dais->initialised) { +- int current_be_id; ++ int current_be_id = 0; + + ret = create_sdw_dailink(card, sof_dais, dai_links, + ¤t_be_id, codec_conf); diff --git a/queue-6.12/asoc-meson-meson-card-utils-use-of_property_present-for-dt-parsing.patch b/queue-6.12/asoc-meson-meson-card-utils-use-of_property_present-for-dt-parsing.patch new file mode 100644 index 0000000000..ffa087cc53 --- /dev/null +++ b/queue-6.12/asoc-meson-meson-card-utils-use-of_property_present-for-dt-parsing.patch @@ -0,0 +1,43 @@ +From 171eb6f71e9e3ba6a7410a1d93f3ac213f39dae2 Mon Sep 17 00:00:00 2001 +From: Martin Blumenstingl +Date: Sat, 19 Apr 2025 23:34:48 +0200 +Subject: ASoC: meson: meson-card-utils: use of_property_present() for DT parsing + +From: Martin Blumenstingl + +commit 171eb6f71e9e3ba6a7410a1d93f3ac213f39dae2 upstream. + +Commit c141ecc3cecd ("of: Warn when of_property_read_bool() is used on +non-boolean properties") added a warning when trying to parse a property +with a value (boolean properties are defined as: absent = false, present +without any value = true). This causes a warning from meson-card-utils. + +meson-card-utils needs to know about the existence of the +"audio-routing" and/or "audio-widgets" properties in order to properly +parse them. Switch to of_property_present() in order to silence the +following warning messages during boot: + OF: /sound: Read of boolean property 'audio-routing' with a value. + OF: /sound: Read of boolean property 'audio-widgets' with a value. + +Fixes: 7864a79f37b5 ("ASoC: meson: add axg sound card support") +Tested-by: Christian Hewitt +Cc: stable@vger.kernel.org +Signed-off-by: Martin Blumenstingl +Link: https://patch.msgid.link/20250419213448.59647-1-martin.blumenstingl@googlemail.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/meson/meson-card-utils.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/soc/meson/meson-card-utils.c ++++ b/sound/soc/meson/meson-card-utils.c +@@ -231,7 +231,7 @@ static int meson_card_parse_of_optional( + const char *p)) + { + /* If property is not provided, don't fail ... */ +- if (!of_property_read_bool(card->dev->of_node, propname)) ++ if (!of_property_present(card->dev->of_node, propname)) + return 0; + + /* ... but do fail if it is provided and the parsing fails */ diff --git a/queue-6.12/asoc-qcom-sdm845-add-error-handling-in-sdm845_slim_snd_hw_params.patch b/queue-6.12/asoc-qcom-sdm845-add-error-handling-in-sdm845_slim_snd_hw_params.patch new file mode 100644 index 0000000000..26db8a98c8 --- /dev/null +++ b/queue-6.12/asoc-qcom-sdm845-add-error-handling-in-sdm845_slim_snd_hw_params.patch @@ -0,0 +1,41 @@ +From 688abe2860fd9c644705b9e11cb9649eb891b879 Mon Sep 17 00:00:00 2001 +From: Wentao Liang +Date: Mon, 19 May 2025 15:57:39 +0800 +Subject: ASoC: qcom: sdm845: Add error handling in sdm845_slim_snd_hw_params() + +From: Wentao Liang + +commit 688abe2860fd9c644705b9e11cb9649eb891b879 upstream. + +The function sdm845_slim_snd_hw_params() calls the functuion +snd_soc_dai_set_channel_map() but does not check its return +value. A proper implementation can be found in msm_snd_hw_params(). + +Add error handling for snd_soc_dai_set_channel_map(). If the +function fails and it is not a unsupported error, return the +error code immediately. + +Fixes: 5caf64c633a3 ("ASoC: qcom: sdm845: add support to DB845c and Lenovo Yoga") +Cc: stable@vger.kernel.org # v5.6 +Signed-off-by: Wentao Liang +Reviewed-by: Dmitry Baryshkov +Link: https://patch.msgid.link/20250519075739.1458-1-vulab@iscas.ac.cn +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + sound/soc/qcom/sdm845.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/sound/soc/qcom/sdm845.c ++++ b/sound/soc/qcom/sdm845.c +@@ -91,6 +91,10 @@ static int sdm845_slim_snd_hw_params(str + else + ret = snd_soc_dai_set_channel_map(cpu_dai, tx_ch_cnt, + tx_ch, 0, NULL); ++ if (ret != 0 && ret != -ENOTSUPP) { ++ dev_err(rtd->dev, "failed to set cpu chan map, err:%d\n", ret); ++ return ret; ++ } + } + + return 0; diff --git a/queue-6.12/configfs-do-not-override-creating-attribute-file-failure-in-populate_attrs.patch b/queue-6.12/configfs-do-not-override-creating-attribute-file-failure-in-populate_attrs.patch new file mode 100644 index 0000000000..ca7e4c6c55 --- /dev/null +++ b/queue-6.12/configfs-do-not-override-creating-attribute-file-failure-in-populate_attrs.patch @@ -0,0 +1,39 @@ +From f830edbae247b89228c3e09294151b21e0dc849c Mon Sep 17 00:00:00 2001 +From: Zijun Hu +Date: Wed, 7 May 2025 19:50:26 +0800 +Subject: configfs: Do not override creating attribute file failure in populate_attrs() + +From: Zijun Hu + +commit f830edbae247b89228c3e09294151b21e0dc849c upstream. + +populate_attrs() may override failure for creating attribute files +by success for creating subsequent bin attribute files, and have +wrong return value. + +Fix by creating bin attribute files under successfully creating +attribute files. + +Fixes: 03607ace807b ("configfs: implement binary attributes") +Cc: stable@vger.kernel.org +Reviewed-by: Joel Becker +Reviewed-by: Breno Leitao +Signed-off-by: Zijun Hu +Link: https://lore.kernel.org/r/20250507-fix_configfs-v3-2-fe2d96de8dc4@quicinc.com +Signed-off-by: Andreas Hindborg +Signed-off-by: Greg Kroah-Hartman +--- + fs/configfs/dir.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/configfs/dir.c ++++ b/fs/configfs/dir.c +@@ -600,7 +600,7 @@ static int populate_attrs(struct config_ + break; + } + } +- if (t->ct_bin_attrs) { ++ if (!error && t->ct_bin_attrs) { + for (i = 0; (bin_attr = t->ct_bin_attrs[i]) != NULL; i++) { + if (ops && ops->is_bin_visible && !ops->is_bin_visible(item, bin_attr, i)) + continue; diff --git a/queue-6.12/crypto-marvell-cesa-do-not-chain-submitted-requests.patch b/queue-6.12/crypto-marvell-cesa-do-not-chain-submitted-requests.patch new file mode 100644 index 0000000000..7c14bf42d0 --- /dev/null +++ b/queue-6.12/crypto-marvell-cesa-do-not-chain-submitted-requests.patch @@ -0,0 +1,156 @@ +From 0413bcf0fc460a68a2a7a8354aee833293d7d693 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Thu, 8 May 2025 13:22:16 +0800 +Subject: crypto: marvell/cesa - Do not chain submitted requests + +From: Herbert Xu + +commit 0413bcf0fc460a68a2a7a8354aee833293d7d693 upstream. + +This driver tries to chain requests together before submitting them +to hardware in order to reduce completion interrupts. + +However, it even extends chains that have already been submitted +to hardware. This is dangerous because there is no way of knowing +whether the hardware has already read the DMA memory in question +or not. + +Fix this by splitting the chain list into two. One for submitted +requests and one for requests that have not yet been submitted. +Only extend the latter. + +Reported-by: Klaus Kudielka +Fixes: 85030c5168f1 ("crypto: marvell - Add support for chaining crypto requests in TDMA mode") +Cc: +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/marvell/cesa/cesa.c | 2 - + drivers/crypto/marvell/cesa/cesa.h | 9 ++++-- + drivers/crypto/marvell/cesa/tdma.c | 53 ++++++++++++++++++++++--------------- + 3 files changed, 39 insertions(+), 25 deletions(-) + +--- a/drivers/crypto/marvell/cesa/cesa.c ++++ b/drivers/crypto/marvell/cesa/cesa.c +@@ -94,7 +94,7 @@ static int mv_cesa_std_process(struct mv + + static int mv_cesa_int_process(struct mv_cesa_engine *engine, u32 status) + { +- if (engine->chain.first && engine->chain.last) ++ if (engine->chain_hw.first && engine->chain_hw.last) + return mv_cesa_tdma_process(engine, status); + + return mv_cesa_std_process(engine, status); +--- a/drivers/crypto/marvell/cesa/cesa.h ++++ b/drivers/crypto/marvell/cesa/cesa.h +@@ -440,8 +440,10 @@ struct mv_cesa_dev { + * SRAM + * @queue: fifo of the pending crypto requests + * @load: engine load counter, useful for load balancing +- * @chain: list of the current tdma descriptors being processed +- * by this engine. ++ * @chain_hw: list of the current tdma descriptors being processed ++ * by the hardware. ++ * @chain_sw: list of the current tdma descriptors that will be ++ * submitted to the hardware. + * @complete_queue: fifo of the processed requests by the engine + * + * Structure storing CESA engine information. +@@ -463,7 +465,8 @@ struct mv_cesa_engine { + struct gen_pool *pool; + struct crypto_queue queue; + atomic_t load; +- struct mv_cesa_tdma_chain chain; ++ struct mv_cesa_tdma_chain chain_hw; ++ struct mv_cesa_tdma_chain chain_sw; + struct list_head complete_queue; + int irq; + }; +--- a/drivers/crypto/marvell/cesa/tdma.c ++++ b/drivers/crypto/marvell/cesa/tdma.c +@@ -38,6 +38,15 @@ void mv_cesa_dma_step(struct mv_cesa_req + { + struct mv_cesa_engine *engine = dreq->engine; + ++ spin_lock_bh(&engine->lock); ++ if (engine->chain_sw.first == dreq->chain.first) { ++ engine->chain_sw.first = NULL; ++ engine->chain_sw.last = NULL; ++ } ++ engine->chain_hw.first = dreq->chain.first; ++ engine->chain_hw.last = dreq->chain.last; ++ spin_unlock_bh(&engine->lock); ++ + writel_relaxed(0, engine->regs + CESA_SA_CFG); + + mv_cesa_set_int_mask(engine, CESA_SA_INT_ACC0_IDMA_DONE); +@@ -96,25 +105,27 @@ void mv_cesa_dma_prepare(struct mv_cesa_ + void mv_cesa_tdma_chain(struct mv_cesa_engine *engine, + struct mv_cesa_req *dreq) + { +- if (engine->chain.first == NULL && engine->chain.last == NULL) { +- engine->chain.first = dreq->chain.first; +- engine->chain.last = dreq->chain.last; +- } else { +- struct mv_cesa_tdma_desc *last; ++ struct mv_cesa_tdma_desc *last = engine->chain_sw.last; + +- last = engine->chain.last; ++ /* ++ * Break the DMA chain if the request being queued needs the IV ++ * regs to be set before lauching the request. ++ */ ++ if (!last || dreq->chain.first->flags & CESA_TDMA_SET_STATE) ++ engine->chain_sw.first = dreq->chain.first; ++ else { + last->next = dreq->chain.first; +- engine->chain.last = dreq->chain.last; +- +- /* +- * Break the DMA chain if the CESA_TDMA_BREAK_CHAIN is set on +- * the last element of the current chain, or if the request +- * being queued needs the IV regs to be set before lauching +- * the request. +- */ +- if (!(last->flags & CESA_TDMA_BREAK_CHAIN) && +- !(dreq->chain.first->flags & CESA_TDMA_SET_STATE)) +- last->next_dma = cpu_to_le32(dreq->chain.first->cur_dma); ++ last->next_dma = cpu_to_le32(dreq->chain.first->cur_dma); ++ } ++ last = dreq->chain.last; ++ engine->chain_sw.last = last; ++ /* ++ * Break the DMA chain if the CESA_TDMA_BREAK_CHAIN is set on ++ * the last element of the current chain. ++ */ ++ if (last->flags & CESA_TDMA_BREAK_CHAIN) { ++ engine->chain_sw.first = NULL; ++ engine->chain_sw.last = NULL; + } + } + +@@ -127,7 +138,7 @@ int mv_cesa_tdma_process(struct mv_cesa_ + + tdma_cur = readl(engine->regs + CESA_TDMA_CUR); + +- for (tdma = engine->chain.first; tdma; tdma = next) { ++ for (tdma = engine->chain_hw.first; tdma; tdma = next) { + spin_lock_bh(&engine->lock); + next = tdma->next; + spin_unlock_bh(&engine->lock); +@@ -149,12 +160,12 @@ int mv_cesa_tdma_process(struct mv_cesa_ + &backlog); + + /* Re-chaining to the next request */ +- engine->chain.first = tdma->next; ++ engine->chain_hw.first = tdma->next; + tdma->next = NULL; + + /* If this is the last request, clear the chain */ +- if (engine->chain.first == NULL) +- engine->chain.last = NULL; ++ if (engine->chain_hw.first == NULL) ++ engine->chain_hw.last = NULL; + spin_unlock_bh(&engine->lock); + + ctx = crypto_tfm_ctx(req->tfm); diff --git a/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_420xx.patch b/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_420xx.patch new file mode 100644 index 0000000000..16f9d469ef --- /dev/null +++ b/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_420xx.patch @@ -0,0 +1,58 @@ +From 097143f23a1164bfd1b6f70279d229be44da2e30 Mon Sep 17 00:00:00 2001 +From: Giovanni Cabiddu +Date: Wed, 26 Mar 2025 15:59:47 +0000 +Subject: crypto: qat - add shutdown handler to qat_420xx + +From: Giovanni Cabiddu + +commit 097143f23a1164bfd1b6f70279d229be44da2e30 upstream. + +During a warm reset via kexec, the system bypasses the driver removal +sequence, meaning that the remove() callback is not invoked. +If a QAT device is not shutdown properly, the device driver will fail to +load in a newly rebooted kernel. + +This might result in output like the following after the kexec reboot: + + 420xx 0000:01:00.0: Failed to power up the device + 420xx 0000:01:00.0: Failed to initialize device + 420xx 0000:01:00.0: Resetting device qat_dev0 + 420xx 0000:01:00.0: probe with driver 420xx failed with error -14 + +Implement the shutdown() handler that hooks into the reboot notifier +list. This brings down the QAT device and ensures it is shut down +properly. + +Cc: +Fixes: fcf60f4bcf54 ("crypto: qat - add support for 420xx devices") +Reviewed-by: Ahsan Atta +Reviewed-by: Andy Shevchenko +Signed-off-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/intel/qat/qat_420xx/adf_drv.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/crypto/intel/qat/qat_420xx/adf_drv.c ++++ b/drivers/crypto/intel/qat/qat_420xx/adf_drv.c +@@ -181,11 +181,19 @@ static void adf_remove(struct pci_dev *p + adf_cleanup_accel(accel_dev); + } + ++static void adf_shutdown(struct pci_dev *pdev) ++{ ++ struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev); ++ ++ adf_dev_down(accel_dev); ++} ++ + static struct pci_driver adf_driver = { + .id_table = adf_pci_tbl, + .name = ADF_420XX_DEVICE_NAME, + .probe = adf_probe, + .remove = adf_remove, ++ .shutdown = adf_shutdown, + .sriov_configure = adf_sriov_configure, + .err_handler = &adf_err_handler, + }; diff --git a/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_4xxx.patch b/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_4xxx.patch new file mode 100644 index 0000000000..a47dcfee8d --- /dev/null +++ b/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_4xxx.patch @@ -0,0 +1,61 @@ +From 845bc952024dbf482c7434daeac66f764642d52d Mon Sep 17 00:00:00 2001 +From: Giovanni Cabiddu +Date: Wed, 26 Mar 2025 15:59:46 +0000 +Subject: crypto: qat - add shutdown handler to qat_4xxx + +From: Giovanni Cabiddu + +commit 845bc952024dbf482c7434daeac66f764642d52d upstream. + +During a warm reset via kexec, the system bypasses the driver removal +sequence, meaning that the remove() callback is not invoked. +If a QAT device is not shutdown properly, the device driver will fail to +load in a newly rebooted kernel. + +This might result in output like the following after the kexec reboot: + + 4xxx 0000:01:00.0: Failed to power up the device + 4xxx 0000:01:00.0: Failed to initialize device + 4xxx 0000:01:00.0: Resetting device qat_dev0 + 4xxx 0000:01:00.0: probe with driver 4xxx failed with error -14 + +Implement the shutdown() handler that hooks into the reboot notifier +list. This brings down the QAT device and ensures it is shut down +properly. + +Cc: +Fixes: 8c8268166e83 ("crypto: qat - add qat_4xxx driver") +Link: https://lore.kernel.org/all/Z-DGQrhRj9niR9iZ@gondor.apana.org.au/ +Reported-by: Randy Wright +Closes: https://issues.redhat.com/browse/RHEL-84366 +Reviewed-by: Ahsan Atta +Reviewed-by: Andy Shevchenko +Signed-off-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/intel/qat/qat_4xxx/adf_drv.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/crypto/intel/qat/qat_4xxx/adf_drv.c ++++ b/drivers/crypto/intel/qat/qat_4xxx/adf_drv.c +@@ -183,11 +183,19 @@ static void adf_remove(struct pci_dev *p + adf_cleanup_accel(accel_dev); + } + ++static void adf_shutdown(struct pci_dev *pdev) ++{ ++ struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev); ++ ++ adf_dev_down(accel_dev); ++} ++ + static struct pci_driver adf_driver = { + .id_table = adf_pci_tbl, + .name = ADF_4XXX_DEVICE_NAME, + .probe = adf_probe, + .remove = adf_remove, ++ .shutdown = adf_shutdown, + .sriov_configure = adf_sriov_configure, + .err_handler = &adf_err_handler, + }; diff --git a/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_c3xxx.patch b/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_c3xxx.patch new file mode 100644 index 0000000000..45120a7091 --- /dev/null +++ b/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_c3xxx.patch @@ -0,0 +1,63 @@ +From 71e0cc1eab584d6f95526a5e8c69ec666ca33e1b Mon Sep 17 00:00:00 2001 +From: Giovanni Cabiddu +Date: Wed, 26 Mar 2025 15:59:53 +0000 +Subject: crypto: qat - add shutdown handler to qat_c3xxx + +From: Giovanni Cabiddu + +commit 71e0cc1eab584d6f95526a5e8c69ec666ca33e1b upstream. + +During a warm reset via kexec, the system bypasses the driver removal +sequence, meaning that the remove() callback is not invoked. +If a QAT device is not shutdown properly, the device driver will fail to +load in a newly rebooted kernel. + +This might result in output like the following after the kexec reboot: + + QAT: AE0 is inactive!! + QAT: failed to get device out of reset + c3xxx 0000:3f:00.0: qat_hal_clr_reset error + c3xxx 0000:3f:00.0: Failed to init the AEs + c3xxx 0000:3f:00.0: Failed to initialise Acceleration Engine + c3xxx 0000:3f:00.0: Resetting device qat_dev0 + c3xxx 0000:3f:00.0: probe with driver c3xxx failed with error -14 + +Implement the shutdown() handler that hooks into the reboot notifier +list. This brings down the QAT device and ensures it is shut down +properly. + +Cc: +Fixes: 890c55f4dc0e ("crypto: qat - add support for c3xxx accel type") +Reviewed-by: Ahsan Atta +Reviewed-by: Andy Shevchenko +Signed-off-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/intel/qat/qat_c3xxx/adf_drv.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/crypto/intel/qat/qat_c3xxx/adf_drv.c ++++ b/drivers/crypto/intel/qat/qat_c3xxx/adf_drv.c +@@ -19,6 +19,13 @@ + #include + #include "adf_c3xxx_hw_data.h" + ++static void adf_shutdown(struct pci_dev *pdev) ++{ ++ struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev); ++ ++ adf_dev_down(accel_dev); ++} ++ + static const struct pci_device_id adf_pci_tbl[] = { + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_QAT_C3XXX), }, + { } +@@ -33,6 +40,7 @@ static struct pci_driver adf_driver = { + .name = ADF_C3XXX_DEVICE_NAME, + .probe = adf_probe, + .remove = adf_remove, ++ .shutdown = adf_shutdown, + .sriov_configure = adf_sriov_configure, + .err_handler = &adf_err_handler, + }; diff --git a/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_c62x.patch b/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_c62x.patch new file mode 100644 index 0000000000..9a9607cc29 --- /dev/null +++ b/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_c62x.patch @@ -0,0 +1,63 @@ +From a9a6e9279b2998e2610c70b0dfc80a234f97c76c Mon Sep 17 00:00:00 2001 +From: Giovanni Cabiddu +Date: Wed, 26 Mar 2025 15:59:51 +0000 +Subject: crypto: qat - add shutdown handler to qat_c62x + +From: Giovanni Cabiddu + +commit a9a6e9279b2998e2610c70b0dfc80a234f97c76c upstream. + +During a warm reset via kexec, the system bypasses the driver removal +sequence, meaning that the remove() callback is not invoked. +If a QAT device is not shutdown properly, the device driver will fail to +load in a newly rebooted kernel. + +This might result in output like the following after the kexec reboot: + + QAT: AE0 is inactive!! + QAT: failed to get device out of reset + c6xx 0000:3f:00.0: qat_hal_clr_reset error + c6xx 0000:3f:00.0: Failed to init the AEs + c6xx 0000:3f:00.0: Failed to initialise Acceleration Engine + c6xx 0000:3f:00.0: Resetting device qat_dev0 + c6xx 0000:3f:00.0: probe with driver c6xx failed with error -14 + +Implement the shutdown() handler that hooks into the reboot notifier +list. This brings down the QAT device and ensures it is shut down +properly. + +Cc: +Fixes: a6dabee6c8ba ("crypto: qat - add support for c62x accel type") +Reviewed-by: Ahsan Atta +Reviewed-by: Andy Shevchenko +Signed-off-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/intel/qat/qat_c62x/adf_drv.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/crypto/intel/qat/qat_c62x/adf_drv.c ++++ b/drivers/crypto/intel/qat/qat_c62x/adf_drv.c +@@ -19,6 +19,13 @@ + #include + #include "adf_c62x_hw_data.h" + ++static void adf_shutdown(struct pci_dev *pdev) ++{ ++ struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev); ++ ++ adf_dev_down(accel_dev); ++} ++ + static const struct pci_device_id adf_pci_tbl[] = { + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_QAT_C62X), }, + { } +@@ -33,6 +40,7 @@ static struct pci_driver adf_driver = { + .name = ADF_C62X_DEVICE_NAME, + .probe = adf_probe, + .remove = adf_remove, ++ .shutdown = adf_shutdown, + .sriov_configure = adf_sriov_configure, + .err_handler = &adf_err_handler, + }; diff --git a/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_dh895xcc.patch b/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_dh895xcc.patch new file mode 100644 index 0000000000..6333e6f01f --- /dev/null +++ b/queue-6.12/crypto-qat-add-shutdown-handler-to-qat_dh895xcc.patch @@ -0,0 +1,63 @@ +From 2c4e8b228733bfbcaf49408fdf94d220f6eb78fc Mon Sep 17 00:00:00 2001 +From: Giovanni Cabiddu +Date: Wed, 26 Mar 2025 15:59:49 +0000 +Subject: crypto: qat - add shutdown handler to qat_dh895xcc + +From: Giovanni Cabiddu + +commit 2c4e8b228733bfbcaf49408fdf94d220f6eb78fc upstream. + +During a warm reset via kexec, the system bypasses the driver removal +sequence, meaning that the remove() callback is not invoked. +If a QAT device is not shutdown properly, the device driver will fail to +load in a newly rebooted kernel. + +This might result in output like the following after the kexec reboot: + + QAT: AE0 is inactive!! + QAT: failed to get device out of reset + dh895xcc 0000:3f:00.0: qat_hal_clr_reset error + dh895xcc 0000:3f:00.0: Failed to init the AEs + dh895xcc 0000:3f:00.0: Failed to initialise Acceleration Engine + dh895xcc 0000:3f:00.0: Resetting device qat_dev0 + dh895xcc 0000:3f:00.0: probe with driver dh895xcc failed with error -14 + +Implement the shutdown() handler that hooks into the reboot notifier +list. This brings down the QAT device and ensures it is shut down +properly. + +Cc: +Fixes: 7afa232e76ce ("crypto: qat - Intel(R) QAT DH895xcc accelerator") +Reviewed-by: Ahsan Atta +Reviewed-by: Andy Shevchenko +Signed-off-by: Giovanni Cabiddu +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/intel/qat/qat_dh895xcc/adf_drv.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/crypto/intel/qat/qat_dh895xcc/adf_drv.c ++++ b/drivers/crypto/intel/qat/qat_dh895xcc/adf_drv.c +@@ -19,6 +19,13 @@ + #include + #include "adf_dh895xcc_hw_data.h" + ++static void adf_shutdown(struct pci_dev *pdev) ++{ ++ struct adf_accel_dev *accel_dev = adf_devmgr_pci_to_accel_dev(pdev); ++ ++ adf_dev_down(accel_dev); ++} ++ + static const struct pci_device_id adf_pci_tbl[] = { + { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_QAT_DH895XCC), }, + { } +@@ -33,6 +40,7 @@ static struct pci_driver adf_driver = { + .name = ADF_DH895XCC_DEVICE_NAME, + .probe = adf_probe, + .remove = adf_remove, ++ .shutdown = adf_shutdown, + .sriov_configure = adf_sriov_configure, + .err_handler = &adf_err_handler, + }; diff --git a/queue-6.12/gfs2-move-msleep-to-sleepable-context.patch b/queue-6.12/gfs2-move-msleep-to-sleepable-context.patch new file mode 100644 index 0000000000..cdac2c73f8 --- /dev/null +++ b/queue-6.12/gfs2-move-msleep-to-sleepable-context.patch @@ -0,0 +1,42 @@ +From ac5ee087d31ed93b6e45d2968a66828c6f621d8c Mon Sep 17 00:00:00 2001 +From: Alexander Aring +Date: Mon, 31 Mar 2025 19:03:24 -0400 +Subject: gfs2: move msleep to sleepable context + +From: Alexander Aring + +commit ac5ee087d31ed93b6e45d2968a66828c6f621d8c upstream. + +This patch moves the msleep_interruptible() out of the non-sleepable +context by moving the ls->ls_recover_spin spinlock around so +msleep_interruptible() will be called in a sleepable context. + +Cc: stable@vger.kernel.org +Fixes: 4a7727725dc7 ("GFS2: Fix recovery issues for spectators") +Suggested-by: Andreas Gruenbacher +Signed-off-by: Alexander Aring +Signed-off-by: Andreas Gruenbacher +Signed-off-by: Greg Kroah-Hartman +--- + fs/gfs2/lock_dlm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/fs/gfs2/lock_dlm.c ++++ b/fs/gfs2/lock_dlm.c +@@ -975,14 +975,15 @@ locks_done: + if (sdp->sd_args.ar_spectator) { + fs_info(sdp, "Recovery is required. Waiting for a " + "non-spectator to mount.\n"); ++ spin_unlock(&ls->ls_recover_spin); + msleep_interruptible(1000); + } else { + fs_info(sdp, "control_mount wait1 block %u start %u " + "mount %u lvb %u flags %lx\n", block_gen, + start_gen, mount_gen, lvb_gen, + ls->ls_recover_flags); ++ spin_unlock(&ls->ls_recover_spin); + } +- spin_unlock(&ls->ls_recover_spin); + goto restart; + } + diff --git a/queue-6.12/io_uring-account-drain-memory-to-cgroup.patch b/queue-6.12/io_uring-account-drain-memory-to-cgroup.patch new file mode 100644 index 0000000000..ed15874ada --- /dev/null +++ b/queue-6.12/io_uring-account-drain-memory-to-cgroup.patch @@ -0,0 +1,33 @@ +From f979c20547e72568e3c793bc92c7522bc3166246 Mon Sep 17 00:00:00 2001 +From: Pavel Begunkov +Date: Fri, 9 May 2025 12:12:47 +0100 +Subject: io_uring: account drain memory to cgroup + +From: Pavel Begunkov + +commit f979c20547e72568e3c793bc92c7522bc3166246 upstream. + +Account drain allocations against memcg. It's not a big problem as each +such allocation is paired with a request, which is accounted, but it's +nicer to follow the limits more closely. + +Cc: stable@vger.kernel.org # 6.1 +Signed-off-by: Pavel Begunkov +Link: https://lore.kernel.org/r/f8dfdbd755c41fd9c75d12b858af07dfba5bbb68.1746788718.git.asml.silence@gmail.com +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + io_uring/io_uring.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/io_uring/io_uring.c ++++ b/io_uring/io_uring.c +@@ -1681,7 +1681,7 @@ queue: + spin_unlock(&ctx->completion_lock); + + io_prep_async_link(req); +- de = kmalloc(sizeof(*de), GFP_KERNEL); ++ de = kmalloc(sizeof(*de), GFP_KERNEL_ACCOUNT); + if (!de) { + ret = -ENOMEM; + io_req_defer_failed(req, ret); diff --git a/queue-6.12/io_uring-kbuf-account-ring-io_buffer_list-memory.patch b/queue-6.12/io_uring-kbuf-account-ring-io_buffer_list-memory.patch new file mode 100644 index 0000000000..10890691e6 --- /dev/null +++ b/queue-6.12/io_uring-kbuf-account-ring-io_buffer_list-memory.patch @@ -0,0 +1,34 @@ +From 475a8d30371604a6363da8e304a608a5959afc40 Mon Sep 17 00:00:00 2001 +From: Pavel Begunkov +Date: Tue, 13 May 2025 18:26:46 +0100 +Subject: io_uring/kbuf: account ring io_buffer_list memory + +From: Pavel Begunkov + +commit 475a8d30371604a6363da8e304a608a5959afc40 upstream. + +Follow the non-ringed pbuf struct io_buffer_list allocations and account +it against the memcg. There is low chance of that being an actual +problem as ring provided buffer should either pin user memory or +allocate it, which is already accounted. + +Cc: stable@vger.kernel.org # 6.1 +Signed-off-by: Pavel Begunkov +Link: https://lore.kernel.org/r/3985218b50d341273cafff7234e1a7e6d0db9808.1747150490.git.asml.silence@gmail.com +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman +--- + io_uring/kbuf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/io_uring/kbuf.c ++++ b/io_uring/kbuf.c +@@ -728,7 +728,7 @@ int io_register_pbuf_ring(struct io_ring + io_destroy_bl(ctx, bl); + } + +- free_bl = bl = kzalloc(sizeof(*bl), GFP_KERNEL); ++ free_bl = bl = kzalloc(sizeof(*bl), GFP_KERNEL_ACCOUNT); + if (!bl) + return -ENOMEM; + diff --git a/queue-6.12/net-mlx5-add-error-handling-in-mlx5_query_nic_vport_node_guid.patch b/queue-6.12/net-mlx5-add-error-handling-in-mlx5_query_nic_vport_node_guid.patch new file mode 100644 index 0000000000..977451ebed --- /dev/null +++ b/queue-6.12/net-mlx5-add-error-handling-in-mlx5_query_nic_vport_node_guid.patch @@ -0,0 +1,55 @@ +From c6bb8a21cdad8c975a3a646b9e5c8df01ad29783 Mon Sep 17 00:00:00 2001 +From: Wentao Liang +Date: Sun, 25 May 2025 00:34:25 +0800 +Subject: net/mlx5: Add error handling in mlx5_query_nic_vport_node_guid() + +From: Wentao Liang + +commit c6bb8a21cdad8c975a3a646b9e5c8df01ad29783 upstream. + +The function mlx5_query_nic_vport_node_guid() calls the function +mlx5_query_nic_vport_context() but does not check its return value. +A proper implementation can be found in mlx5_nic_vport_query_local_lb(). + +Add error handling for mlx5_query_nic_vport_context(). If it fails, free +the out buffer via kvfree() and return error code. + +Fixes: 9efa75254593 ("net/mlx5_core: Introduce access functions to query vport RoCE fields") +Cc: stable@vger.kernel.org # v4.5 +Signed-off-by: Wentao Liang +Reviewed-by: Tariq Toukan +Link: https://patch.msgid.link/20250524163425.1695-1-vulab@iscas.ac.cn +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mellanox/mlx5/core/vport.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/vport.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/vport.c +@@ -465,19 +465,22 @@ int mlx5_query_nic_vport_node_guid(struc + { + u32 *out; + int outlen = MLX5_ST_SZ_BYTES(query_nic_vport_context_out); ++ int err; + + out = kvzalloc(outlen, GFP_KERNEL); + if (!out) + return -ENOMEM; + +- mlx5_query_nic_vport_context(mdev, 0, out); ++ err = mlx5_query_nic_vport_context(mdev, 0, out); ++ if (err) ++ goto out; + + *node_guid = MLX5_GET64(query_nic_vport_context_out, out, + nic_vport_context.node_guid); +- ++out: + kvfree(out); + +- return 0; ++ return err; + } + EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_node_guid); + diff --git a/queue-6.12/net-mlx5_core-add-error-handling-inmlx5_query_nic_vport_qkey_viol_cntr.patch b/queue-6.12/net-mlx5_core-add-error-handling-inmlx5_query_nic_vport_qkey_viol_cntr.patch new file mode 100644 index 0000000000..52e528b950 --- /dev/null +++ b/queue-6.12/net-mlx5_core-add-error-handling-inmlx5_query_nic_vport_qkey_viol_cntr.patch @@ -0,0 +1,56 @@ +From f0b50730bdd8f2734e548de541e845c0d40dceb6 Mon Sep 17 00:00:00 2001 +From: Wentao Liang +Date: Wed, 21 May 2025 21:36:20 +0800 +Subject: net/mlx5_core: Add error handling inmlx5_query_nic_vport_qkey_viol_cntr() + +From: Wentao Liang + +commit f0b50730bdd8f2734e548de541e845c0d40dceb6 upstream. + +The function mlx5_query_nic_vport_qkey_viol_cntr() calls the function +mlx5_query_nic_vport_context() but does not check its return value. This +could lead to undefined behavior if the query fails. A proper +implementation can be found in mlx5_nic_vport_query_local_lb(). + +Add error handling for mlx5_query_nic_vport_context(). If it fails, free +the out buffer via kvfree() and return error code. + +Fixes: 9efa75254593 ("net/mlx5_core: Introduce access functions to query vport RoCE fields") +Cc: stable@vger.kernel.org # v4.5 +Signed-off-by: Wentao Liang +Reviewed-by: Tariq Toukan +Link: https://patch.msgid.link/20250521133620.912-1-vulab@iscas.ac.cn +Signed-off-by: Paolo Abeni +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/mellanox/mlx5/core/vport.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +--- a/drivers/net/ethernet/mellanox/mlx5/core/vport.c ++++ b/drivers/net/ethernet/mellanox/mlx5/core/vport.c +@@ -519,19 +519,22 @@ int mlx5_query_nic_vport_qkey_viol_cntr( + { + u32 *out; + int outlen = MLX5_ST_SZ_BYTES(query_nic_vport_context_out); ++ int err; + + out = kvzalloc(outlen, GFP_KERNEL); + if (!out) + return -ENOMEM; + +- mlx5_query_nic_vport_context(mdev, 0, out); ++ err = mlx5_query_nic_vport_context(mdev, 0, out); ++ if (err) ++ goto out; + + *qkey_viol_cntr = MLX5_GET(query_nic_vport_context_out, out, + nic_vport_context.qkey_violation_counter); +- ++out: + kvfree(out); + +- return 0; ++ return err; + } + EXPORT_SYMBOL_GPL(mlx5_query_nic_vport_qkey_viol_cntr); + diff --git a/queue-6.12/powerpc-pseries-msi-avoid-reading-pci-device-registers-in-reduced-power-states.patch b/queue-6.12/powerpc-pseries-msi-avoid-reading-pci-device-registers-in-reduced-power-states.patch new file mode 100644 index 0000000000..45cf4e3d80 --- /dev/null +++ b/queue-6.12/powerpc-pseries-msi-avoid-reading-pci-device-registers-in-reduced-power-states.patch @@ -0,0 +1,57 @@ +From 9cc0eafd28c7faef300822992bb08d79cab2a36c Mon Sep 17 00:00:00 2001 +From: Gautam Menghani +Date: Wed, 5 Mar 2025 14:32:36 +0530 +Subject: powerpc/pseries/msi: Avoid reading PCI device registers in reduced power states + +From: Gautam Menghani + +commit 9cc0eafd28c7faef300822992bb08d79cab2a36c upstream. + +When a system is being suspended to RAM, the PCI devices are also +suspended and the PPC code ends up calling pseries_msi_compose_msg() and +this triggers the BUG_ON() in __pci_read_msi_msg() because the device at +this point is in reduced power state. In reduced power state, the memory +mapped registers of the PCI device are not accessible. + +To replicate the bug: +1. Make sure deep sleep is selected + # cat /sys/power/mem_sleep + s2idle [deep] + +2. Make sure console is not suspended (so that dmesg logs are visible) + echo N > /sys/module/printk/parameters/console_suspend + +3. Suspend the system + echo mem > /sys/power/state + +To fix this behaviour, read the cached msi message of the device when the +device is not in PCI_D0 power state instead of touching the hardware. + +Fixes: a5f3d2c17b07 ("powerpc/pseries/pci: Add MSI domains") +Cc: stable@vger.kernel.org # v5.15+ +Signed-off-by: Gautam Menghani +Tested-by: Venkat Rao Bagalkote +Reviewed-by: Vaibhav Jain +Signed-off-by: Madhavan Srinivasan +Link: https://patch.msgid.link/20250305090237.294633-1-gautam@linux.ibm.com +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/platforms/pseries/msi.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +--- a/arch/powerpc/platforms/pseries/msi.c ++++ b/arch/powerpc/platforms/pseries/msi.c +@@ -524,7 +524,12 @@ static struct msi_domain_info pseries_ms + + static void pseries_msi_compose_msg(struct irq_data *data, struct msi_msg *msg) + { +- __pci_read_msi_msg(irq_data_get_msi_desc(data), msg); ++ struct pci_dev *dev = msi_desc_to_pci_dev(irq_data_get_msi_desc(data)); ++ ++ if (dev->current_state == PCI_D0) ++ __pci_read_msi_msg(irq_data_get_msi_desc(data), msg); ++ else ++ get_cached_msi_msg(data->irq, msg); + } + + static struct irq_chip pseries_msi_irq_chip = { diff --git a/queue-6.12/regulator-max20086-change-enable-gpio-to-optional.patch b/queue-6.12/regulator-max20086-change-enable-gpio-to-optional.patch new file mode 100644 index 0000000000..416f82e280 --- /dev/null +++ b/queue-6.12/regulator-max20086-change-enable-gpio-to-optional.patch @@ -0,0 +1,38 @@ +From e8ac7336dd62f0443a675ed80b17f0f0e6846e20 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Gon=C3=A7alves?= + +Date: Sun, 20 Apr 2025 15:28:02 -0300 +Subject: regulator: max20086: Change enable gpio to optional +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: João Paulo Gonçalves + +commit e8ac7336dd62f0443a675ed80b17f0f0e6846e20 upstream. + +The enable pin can be configured as always enabled by the hardware. Make +the enable gpio request optional so the driver doesn't fail to probe +when `enable-gpios` property is not present in the device tree. + +Cc: stable@vger.kernel.org +Fixes: bfff546aae50 ("regulator: Add MAX20086-MAX20089 driver") +Signed-off-by: João Paulo Gonçalves +Link: https://patch.msgid.link/20250420-fix-max20086-v1-2-8cc9ee0d5a08@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/regulator/max20086-regulator.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/regulator/max20086-regulator.c ++++ b/drivers/regulator/max20086-regulator.c +@@ -264,7 +264,7 @@ static int max20086_i2c_probe(struct i2c + * shutdown. + */ + flags = boot_on ? GPIOD_OUT_HIGH : GPIOD_OUT_LOW; +- chip->ena_gpiod = devm_gpiod_get(chip->dev, "enable", flags); ++ chip->ena_gpiod = devm_gpiod_get_optional(chip->dev, "enable", flags); + if (IS_ERR(chip->ena_gpiod)) { + ret = PTR_ERR(chip->ena_gpiod); + dev_err(chip->dev, "Failed to get enable GPIO: %d\n", ret); diff --git a/queue-6.12/regulator-max20086-fix-max200086-chip-id.patch b/queue-6.12/regulator-max20086-fix-max200086-chip-id.patch new file mode 100644 index 0000000000..de3cf1a15f --- /dev/null +++ b/queue-6.12/regulator-max20086-fix-max200086-chip-id.patch @@ -0,0 +1,38 @@ +From 71406b6d1155d883c80c1b4405939a52f723aa05 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jo=C3=A3o=20Paulo=20Gon=C3=A7alves?= + +Date: Sun, 20 Apr 2025 15:28:01 -0300 +Subject: regulator: max20086: Fix MAX200086 chip id +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: João Paulo Gonçalves + +commit 71406b6d1155d883c80c1b4405939a52f723aa05 upstream. + +>From MAX20086-MAX20089 datasheet, the id for a MAX20086 is 0x30 and not +0x40. With the current code, the driver will fail on probe when the +driver tries to identify the chip id from a MAX20086 device over I2C. + +Cc: stable@vger.kernel.org +Fixes: bfff546aae50 ("regulator: Add MAX20086-MAX20089 driver") +Signed-off-by: João Paulo Gonçalves +Link: https://patch.msgid.link/20250420-fix-max20086-v1-1-8cc9ee0d5a08@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman +--- + drivers/regulator/max20086-regulator.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/regulator/max20086-regulator.c ++++ b/drivers/regulator/max20086-regulator.c +@@ -29,7 +29,7 @@ + #define MAX20086_REG_ADC4 0x09 + + /* DEVICE IDs */ +-#define MAX20086_DEVICE_ID_MAX20086 0x40 ++#define MAX20086_DEVICE_ID_MAX20086 0x30 + #define MAX20086_DEVICE_ID_MAX20087 0x20 + #define MAX20086_DEVICE_ID_MAX20088 0x10 + #define MAX20086_DEVICE_ID_MAX20089 0x00 diff --git a/queue-6.12/s390-pci-allow-re-add-of-a-reserved-but-not-yet-removed-device.patch b/queue-6.12/s390-pci-allow-re-add-of-a-reserved-but-not-yet-removed-device.patch new file mode 100644 index 0000000000..0451cd51b9 --- /dev/null +++ b/queue-6.12/s390-pci-allow-re-add-of-a-reserved-but-not-yet-removed-device.patch @@ -0,0 +1,178 @@ +From 4b1815a52d7eb03b3e0e6742c6728bc16a4b2d1d Mon Sep 17 00:00:00 2001 +From: Niklas Schnelle +Date: Thu, 22 May 2025 14:13:14 +0200 +Subject: s390/pci: Allow re-add of a reserved but not yet removed device + +From: Niklas Schnelle + +commit 4b1815a52d7eb03b3e0e6742c6728bc16a4b2d1d upstream. + +The architecture assumes that PCI functions can be removed synchronously +as PCI events are processed. This however clashes with the reference +counting of struct pci_dev which allows device drivers to hold on to a +struct pci_dev reference even as the underlying device is removed. To +bridge this gap commit 2a671f77ee49 ("s390/pci: fix use after free of +zpci_dev") keeps the struct zpci_dev in ZPCI_FN_STATE_RESERVED state +until common code releases the struct pci_dev. Only when all references +are dropped, the struct zpci_dev can be removed and freed. + +Later commit a46044a92add ("s390/pci: fix zpci_zdev_put() on reserve") +moved the deletion of the struct zpci_dev from the zpci_list in +zpci_release_device() to the point where the device is reserved. This +was done to prevent handling events for a device that is already being +removed, e.g. when the platform generates both PCI event codes 0x304 +and 0x308. In retrospect, deletion from the zpci_list in the release +function without holding the zpci_list_lock was also racy. + +A side effect of this handling is that if the underlying device +re-appears while the struct zpci_dev is in the ZPCI_FN_STATE_RESERVED +state, the new and old instances of the struct zpci_dev and/or struct +pci_dev may clash. For example when trying to create the IOMMU sysfs +files for the new instance. In this case, re-adding the new instance is +aborted. The old instance is removed, and the device will remain absent +until the platform issues another event. + +Fix this by allowing the struct zpci_dev to be brought back up right +until it is finally removed. To this end also keep the struct zpci_dev +in the zpci_list until it is finally released when all references have +been dropped. + +Deletion from the zpci_list from within the release function is made +safe by using kref_put_lock() with the zpci_list_lock. This ensures that +the releasing code holds the last reference. + +Cc: stable@vger.kernel.org +Fixes: a46044a92add ("s390/pci: fix zpci_zdev_put() on reserve") +Reviewed-by: Gerd Bayer +Tested-by: Gerd Bayer +Signed-off-by: Niklas Schnelle +Signed-off-by: Heiko Carstens +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/pci/pci.c | 32 ++++++++++++++++++++++---------- + arch/s390/pci/pci_bus.h | 7 ++----- + arch/s390/pci/pci_event.c | 22 +++++++++++++++++++++- + 3 files changed, 45 insertions(+), 16 deletions(-) + +--- a/arch/s390/pci/pci.c ++++ b/arch/s390/pci/pci.c +@@ -69,6 +69,13 @@ EXPORT_SYMBOL_GPL(zpci_aipb); + struct airq_iv *zpci_aif_sbv; + EXPORT_SYMBOL_GPL(zpci_aif_sbv); + ++void zpci_zdev_put(struct zpci_dev *zdev) ++{ ++ if (!zdev) ++ return; ++ kref_put_lock(&zdev->kref, zpci_release_device, &zpci_list_lock); ++} ++ + struct zpci_dev *get_zdev_by_fid(u32 fid) + { + struct zpci_dev *tmp, *zdev = NULL; +@@ -919,21 +926,20 @@ int zpci_deconfigure_device(struct zpci_ + * @zdev: the zpci_dev that was reserved + * + * Handle the case that a given zPCI function was reserved by another system. +- * After a call to this function the zpci_dev can not be found via +- * get_zdev_by_fid() anymore but may still be accessible via existing +- * references though it will not be functional anymore. + */ + void zpci_device_reserved(struct zpci_dev *zdev) + { +- /* +- * Remove device from zpci_list as it is going away. This also +- * makes sure we ignore subsequent zPCI events for this device. +- */ +- spin_lock(&zpci_list_lock); +- list_del(&zdev->entry); +- spin_unlock(&zpci_list_lock); ++ lockdep_assert_held(&zdev->state_lock); ++ /* We may declare the device reserved multiple times */ ++ if (zdev->state == ZPCI_FN_STATE_RESERVED) ++ return; + zdev->state = ZPCI_FN_STATE_RESERVED; + zpci_dbg(3, "rsv fid:%x\n", zdev->fid); ++ /* ++ * The underlying device is gone. Allow the zdev to be freed ++ * as soon as all other references are gone by accounting for ++ * the removal as a dropped reference. ++ */ + zpci_zdev_put(zdev); + } + +@@ -942,6 +948,12 @@ void zpci_release_device(struct kref *kr + struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref); + + WARN_ON(zdev->state != ZPCI_FN_STATE_RESERVED); ++ /* ++ * We already hold zpci_list_lock thanks to kref_put_lock(). ++ * This makes sure no new reference can be taken from the list. ++ */ ++ list_del(&zdev->entry); ++ spin_unlock(&zpci_list_lock); + + if (zdev->has_hp_slot) + zpci_exit_slot(zdev); +--- a/arch/s390/pci/pci_bus.h ++++ b/arch/s390/pci/pci_bus.h +@@ -17,11 +17,8 @@ int zpci_bus_scan_device(struct zpci_dev + void zpci_bus_remove_device(struct zpci_dev *zdev, bool set_error); + + void zpci_release_device(struct kref *kref); +-static inline void zpci_zdev_put(struct zpci_dev *zdev) +-{ +- if (zdev) +- kref_put(&zdev->kref, zpci_release_device); +-} ++ ++void zpci_zdev_put(struct zpci_dev *zdev); + + static inline void zpci_zdev_get(struct zpci_dev *zdev) + { +--- a/arch/s390/pci/pci_event.c ++++ b/arch/s390/pci/pci_event.c +@@ -322,6 +322,22 @@ static void zpci_event_hard_deconfigured + zdev->state = ZPCI_FN_STATE_STANDBY; + } + ++static void zpci_event_reappear(struct zpci_dev *zdev) ++{ ++ lockdep_assert_held(&zdev->state_lock); ++ /* ++ * The zdev is in the reserved state. This means that it was presumed to ++ * go away but there are still undropped references. Now, the platform ++ * announced its availability again. Bring back the lingering zdev ++ * to standby. This is safe because we hold a temporary reference ++ * now so that it won't go away. Account for the re-appearance of the ++ * underlying device by incrementing the reference count. ++ */ ++ zdev->state = ZPCI_FN_STATE_STANDBY; ++ zpci_zdev_get(zdev); ++ zpci_dbg(1, "rea fid:%x, fh:%x\n", zdev->fid, zdev->fh); ++} ++ + static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) + { + struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); +@@ -345,8 +361,10 @@ static void __zpci_event_availability(st + break; + } + } else { ++ if (zdev->state == ZPCI_FN_STATE_RESERVED) ++ zpci_event_reappear(zdev); + /* the configuration request may be stale */ +- if (zdev->state != ZPCI_FN_STATE_STANDBY) ++ else if (zdev->state != ZPCI_FN_STATE_STANDBY) + break; + zdev->state = ZPCI_FN_STATE_CONFIGURED; + } +@@ -362,6 +380,8 @@ static void __zpci_event_availability(st + break; + } + } else { ++ if (zdev->state == ZPCI_FN_STATE_RESERVED) ++ zpci_event_reappear(zdev); + zpci_update_fh(zdev, ccdf->fh); + } + break; diff --git a/queue-6.12/s390-pci-prevent-self-deletion-in-disable_slot.patch b/queue-6.12/s390-pci-prevent-self-deletion-in-disable_slot.patch new file mode 100644 index 0000000000..be4d490d99 --- /dev/null +++ b/queue-6.12/s390-pci-prevent-self-deletion-in-disable_slot.patch @@ -0,0 +1,53 @@ +From 47c397844869ad0e6738afb5879c7492f4691122 Mon Sep 17 00:00:00 2001 +From: Niklas Schnelle +Date: Thu, 22 May 2025 14:13:13 +0200 +Subject: s390/pci: Prevent self deletion in disable_slot() + +From: Niklas Schnelle + +commit 47c397844869ad0e6738afb5879c7492f4691122 upstream. + +As disable_slot() takes a struct zpci_dev from the Configured to the +Standby state. In Standby there is still a hotplug slot so this is not +usually a case of sysfs self deletion. This is important because self +deletion gets very hairy in terms of locking (see for example +recover_store() in arch/s390/pci/pci_sysfs.c). + +Because the pci_dev_put() is not within the critical section of the +zdev->state_lock however, disable_slot() can turn into a case of self +deletion if zPCI device event handling slips between the mutex_unlock() +and the pci_dev_put(). If the latter is the last put and +zpci_release_device() is called this then tries to remove the hotplug +slot via zpci_exit_slot() which will try to remove the hotplug slot +directory the disable_slot() is part of i.e. self deletion. + +Prevent this by widening the zdev->state_lock critical section to +include the pci_dev_put() which is then guaranteed to happen with the +struct zpci_dev still in Standby state ensuring it will not lead to +a zpci_release_device() call as at least the zPCI event handling code +still holds a reference. + +Cc: stable@vger.kernel.org +Fixes: a46044a92add ("s390/pci: fix zpci_zdev_put() on reserve") +Reviewed-by: Gerd Bayer +Tested-by: Gerd Bayer +Signed-off-by: Niklas Schnelle +Signed-off-by: Heiko Carstens +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pci/hotplug/s390_pci_hpc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/pci/hotplug/s390_pci_hpc.c ++++ b/drivers/pci/hotplug/s390_pci_hpc.c +@@ -65,9 +65,9 @@ static int disable_slot(struct hotplug_s + + rc = zpci_deconfigure_device(zdev); + out: +- mutex_unlock(&zdev->state_lock); + if (pdev) + pci_dev_put(pdev); ++ mutex_unlock(&zdev->state_lock); + return rc; + } + diff --git a/queue-6.12/s390-pci-remove-redundant-bus-removal-and-disable-from-zpci_release_device.patch b/queue-6.12/s390-pci-remove-redundant-bus-removal-and-disable-from-zpci_release_device.patch new file mode 100644 index 0000000000..f4b0ba274e --- /dev/null +++ b/queue-6.12/s390-pci-remove-redundant-bus-removal-and-disable-from-zpci_release_device.patch @@ -0,0 +1,43 @@ +From d76f9633296785343d45f85199f4138cb724b6d2 Mon Sep 17 00:00:00 2001 +From: Niklas Schnelle +Date: Thu, 22 May 2025 14:13:12 +0200 +Subject: s390/pci: Remove redundant bus removal and disable from zpci_release_device() + +From: Niklas Schnelle + +commit d76f9633296785343d45f85199f4138cb724b6d2 upstream. + +Remove zpci_bus_remove_device() and zpci_disable_device() calls from +zpci_release_device(). These calls were done when the device +transitioned into the ZPCI_FN_STATE_STANDBY state which is guaranteed to +happen before it enters the ZPCI_FN_STATE_RESERVED state. When +zpci_release_device() is called the device is known to be in the +ZPCI_FN_STATE_RESERVED state which is also checked by a WARN_ON(). + +Cc: stable@vger.kernel.org +Fixes: a46044a92add ("s390/pci: fix zpci_zdev_put() on reserve") +Reviewed-by: Gerd Bayer +Reviewed-by: Julian Ruess +Tested-by: Gerd Bayer +Signed-off-by: Niklas Schnelle +Signed-off-by: Heiko Carstens +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/pci/pci.c | 6 ------ + 1 file changed, 6 deletions(-) + +--- a/arch/s390/pci/pci.c ++++ b/arch/s390/pci/pci.c +@@ -943,12 +943,6 @@ void zpci_release_device(struct kref *kr + + WARN_ON(zdev->state != ZPCI_FN_STATE_RESERVED); + +- if (zdev->zbus->bus) +- zpci_bus_remove_device(zdev, false); +- +- if (zdev_enabled(zdev)) +- zpci_disable_device(zdev); +- + if (zdev->has_hp_slot) + zpci_exit_slot(zdev); + diff --git a/queue-6.12/s390-pci-serialize-device-addition-and-removal.patch b/queue-6.12/s390-pci-serialize-device-addition-and-removal.patch new file mode 100644 index 0000000000..5bac54905b --- /dev/null +++ b/queue-6.12/s390-pci-serialize-device-addition-and-removal.patch @@ -0,0 +1,86 @@ +From 774a1fa880bc949d88b5ddec9494a13be733dfa8 Mon Sep 17 00:00:00 2001 +From: Niklas Schnelle +Date: Thu, 22 May 2025 14:13:15 +0200 +Subject: s390/pci: Serialize device addition and removal + +From: Niklas Schnelle + +commit 774a1fa880bc949d88b5ddec9494a13be733dfa8 upstream. + +Prior changes ensured that when zpci_release_device() is called and it +removed the zdev from the zpci_list this instance can not be found via +the zpci_list anymore even while allowing re-add of reserved devices. +This only accounts for the overall lifetime and zpci_list addition and +removal, it does not yet prevent concurrent add of a new instance for +the same underlying device. Such concurrent add would subsequently cause +issues such as attempted re-use of the same IOMMU sysfs directory and is +generally undesired. + +Introduce a new zpci_add_remove_lock mutex to serialize adding a new +device with removal. Together this ensures that if a struct zpci_dev is +not found in the zpci_list it was either already removed and torn down, +or its removal and tear down is in progress with the +zpci_add_remove_lock held. + +Cc: stable@vger.kernel.org +Fixes: a46044a92add ("s390/pci: fix zpci_zdev_put() on reserve") +Reviewed-by: Gerd Bayer +Tested-by: Gerd Bayer +Signed-off-by: Niklas Schnelle +Signed-off-by: Heiko Carstens +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/pci/pci.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/arch/s390/pci/pci.c ++++ b/arch/s390/pci/pci.c +@@ -44,6 +44,7 @@ + /* list of all detected zpci devices */ + static LIST_HEAD(zpci_list); + static DEFINE_SPINLOCK(zpci_list_lock); ++static DEFINE_MUTEX(zpci_add_remove_lock); + + static DECLARE_BITMAP(zpci_domain, ZPCI_DOMAIN_BITMAP_SIZE); + static DEFINE_SPINLOCK(zpci_domain_lock); +@@ -73,7 +74,9 @@ void zpci_zdev_put(struct zpci_dev *zdev + { + if (!zdev) + return; ++ mutex_lock(&zpci_add_remove_lock); + kref_put_lock(&zdev->kref, zpci_release_device, &zpci_list_lock); ++ mutex_unlock(&zpci_add_remove_lock); + } + + struct zpci_dev *get_zdev_by_fid(u32 fid) +@@ -838,6 +841,7 @@ int zpci_add_device(struct zpci_dev *zde + { + int rc; + ++ mutex_lock(&zpci_add_remove_lock); + zpci_dbg(1, "add fid:%x, fh:%x, c:%d\n", zdev->fid, zdev->fh, zdev->state); + rc = zpci_init_iommu(zdev); + if (rc) +@@ -851,12 +855,14 @@ int zpci_add_device(struct zpci_dev *zde + spin_lock(&zpci_list_lock); + list_add_tail(&zdev->entry, &zpci_list); + spin_unlock(&zpci_list_lock); ++ mutex_unlock(&zpci_add_remove_lock); + return 0; + + error_destroy_iommu: + zpci_destroy_iommu(zdev); + error: + zpci_dbg(0, "add fid:%x, rc:%d\n", zdev->fid, rc); ++ mutex_unlock(&zpci_add_remove_lock); + return rc; + } + +@@ -947,6 +953,7 @@ void zpci_release_device(struct kref *kr + { + struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref); + ++ lockdep_assert_held(&zpci_add_remove_lock); + WARN_ON(zdev->state != ZPCI_FN_STATE_RESERVED); + /* + * We already hold zpci_list_lock thanks to kref_put_lock(). diff --git a/queue-6.12/series b/queue-6.12/series new file mode 100644 index 0000000000..9de2021d82 --- /dev/null +++ b/queue-6.12/series @@ -0,0 +1,24 @@ +configfs-do-not-override-creating-attribute-file-failure-in-populate_attrs.patch +crypto-marvell-cesa-do-not-chain-submitted-requests.patch +gfs2-move-msleep-to-sleepable-context.patch +crypto-qat-add-shutdown-handler-to-qat_c3xxx.patch +crypto-qat-add-shutdown-handler-to-qat_420xx.patch +crypto-qat-add-shutdown-handler-to-qat_4xxx.patch +crypto-qat-add-shutdown-handler-to-qat_c62x.patch +crypto-qat-add-shutdown-handler-to-qat_dh895xcc.patch +asoc-qcom-sdm845-add-error-handling-in-sdm845_slim_snd_hw_params.patch +asoc-meson-meson-card-utils-use-of_property_present-for-dt-parsing.patch +asoc-amd-sof_amd_sdw-fix-unlikely-uninitialized-variable-use-in-create_sdw_dailinks.patch +io_uring-account-drain-memory-to-cgroup.patch +io_uring-kbuf-account-ring-io_buffer_list-memory.patch +powerpc-pseries-msi-avoid-reading-pci-device-registers-in-reduced-power-states.patch +s390-pci-remove-redundant-bus-removal-and-disable-from-zpci_release_device.patch +s390-pci-prevent-self-deletion-in-disable_slot.patch +s390-pci-allow-re-add-of-a-reserved-but-not-yet-removed-device.patch +s390-pci-serialize-device-addition-and-removal.patch +regulator-max20086-fix-max200086-chip-id.patch +regulator-max20086-change-enable-gpio-to-optional.patch +net-mlx5_core-add-error-handling-inmlx5_query_nic_vport_qkey_viol_cntr.patch +net-mlx5-add-error-handling-in-mlx5_query_nic_vport_node_guid.patch +wifi-p54-prevent-buffer-overflow-in-p54_rx_eeprom_readback.patch +wifi-mt76-mt7925-fix-host-interrupt-register-initialization.patch diff --git a/queue-6.12/wifi-mt76-mt7925-fix-host-interrupt-register-initialization.patch b/queue-6.12/wifi-mt76-mt7925-fix-host-interrupt-register-initialization.patch new file mode 100644 index 0000000000..527ed81573 --- /dev/null +++ b/queue-6.12/wifi-mt76-mt7925-fix-host-interrupt-register-initialization.patch @@ -0,0 +1,47 @@ +From ca872e0ad97159375da8f3d05cac1f48239e01d7 Mon Sep 17 00:00:00 2001 +From: Michael Lo +Date: Fri, 9 May 2025 16:35:12 +0800 +Subject: wifi: mt76: mt7925: fix host interrupt register initialization + +From: Michael Lo + +commit ca872e0ad97159375da8f3d05cac1f48239e01d7 upstream. + +ensure proper interrupt handling and aligns with the hardware spec by +updating the register offset for MT_WFDMA0_HOST_INT_ENA. + +Cc: stable@vger.kernel.org +Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") +Signed-off-by: Michael Lo +Signed-off-by: Ming Yen Hsieh +Link: https://patch.msgid.link/20250509083512.455095-1-mingyen.hsieh@mediatek.com +Signed-off-by: Felix Fietkau +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/mediatek/mt76/mt7925/pci.c | 3 --- + drivers/net/wireless/mediatek/mt76/mt7925/regs.h | 2 +- + 2 files changed, 1 insertion(+), 4 deletions(-) + +--- a/drivers/net/wireless/mediatek/mt76/mt7925/pci.c ++++ b/drivers/net/wireless/mediatek/mt76/mt7925/pci.c +@@ -482,9 +482,6 @@ static int mt7925_pci_suspend(struct dev + + /* disable interrupt */ + mt76_wr(dev, dev->irq_map->host_irq_enable, 0); +- mt76_wr(dev, MT_WFDMA0_HOST_INT_DIS, +- dev->irq_map->tx.all_complete_mask | +- MT_INT_RX_DONE_ALL | MT_INT_MCU_CMD); + + mt76_wr(dev, MT_PCIE_MAC_INT_ENABLE, 0x0); + +--- a/drivers/net/wireless/mediatek/mt76/mt7925/regs.h ++++ b/drivers/net/wireless/mediatek/mt76/mt7925/regs.h +@@ -28,7 +28,7 @@ + #define MT_MDP_TO_HIF 0 + #define MT_MDP_TO_WM 1 + +-#define MT_WFDMA0_HOST_INT_ENA MT_WFDMA0(0x228) ++#define MT_WFDMA0_HOST_INT_ENA MT_WFDMA0(0x204) + #define MT_WFDMA0_HOST_INT_DIS MT_WFDMA0(0x22c) + #define HOST_RX_DONE_INT_ENA4 BIT(12) + #define HOST_RX_DONE_INT_ENA5 BIT(13) diff --git a/queue-6.12/wifi-p54-prevent-buffer-overflow-in-p54_rx_eeprom_readback.patch b/queue-6.12/wifi-p54-prevent-buffer-overflow-in-p54_rx_eeprom_readback.patch new file mode 100644 index 0000000000..19f5100ecc --- /dev/null +++ b/queue-6.12/wifi-p54-prevent-buffer-overflow-in-p54_rx_eeprom_readback.patch @@ -0,0 +1,114 @@ +From da1b9a55ff116cb040528ef664c70a4eec03ae99 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 16 May 2025 20:41:06 +0200 +Subject: wifi: p54: prevent buffer-overflow in p54_rx_eeprom_readback() + +From: Christian Lamparter + +commit da1b9a55ff116cb040528ef664c70a4eec03ae99 upstream. + +Robert Morris reported: + +|If a malicious USB device pretends to be an Intersil p54 wifi +|interface and generates an eeprom_readback message with a large +|eeprom->v1.len, p54_rx_eeprom_readback() will copy data from the +|message beyond the end of priv->eeprom. +| +|static void p54_rx_eeprom_readback(struct p54_common *priv, +| struct sk_buff *skb) +|{ +| struct p54_hdr *hdr = (struct p54_hdr *) skb->data; +| struct p54_eeprom_lm86 *eeprom = (struct p54_eeprom_lm86 *) hdr->data; +| +| if (priv->fw_var >= 0x509) { +| memcpy(priv->eeprom, eeprom->v2.data, +| le16_to_cpu(eeprom->v2.len)); +| } else { +| memcpy(priv->eeprom, eeprom->v1.data, +| le16_to_cpu(eeprom->v1.len)); +| } +| [...] + +The eeprom->v{1,2}.len is set by the driver in p54_download_eeprom(). +The device is supposed to provide the same length back to the driver. +But yes, it's possible (like shown in the report) to alter the value +to something that causes a crash/panic due to overrun. + +This patch addresses the issue by adding the size to the common device +context, so p54_rx_eeprom_readback no longer relies on possibly tampered +values... That said, it also checks if the "firmware" altered the value +and no longer copies them. + +The one, small saving grace is: Before the driver tries to read the eeprom, +it needs to upload >a< firmware. the vendor firmware has a proprietary +license and as a reason, it is not present on most distributions by +default. + +Cc: +Reported-by: Robert Morris +Closes: https://lore.kernel.org/linux-wireless/28782.1747258414@localhost/ +Fixes: 7cb770729ba8 ("p54: move eeprom code into common library") +Signed-off-by: Christian Lamparter +Link: https://patch.msgid.link/20250516184107.47794-1-chunkeey@gmail.com +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/intersil/p54/fwio.c | 2 ++ + drivers/net/wireless/intersil/p54/p54.h | 1 + + drivers/net/wireless/intersil/p54/txrx.c | 13 +++++++++---- + 3 files changed, 12 insertions(+), 4 deletions(-) + +--- a/drivers/net/wireless/intersil/p54/fwio.c ++++ b/drivers/net/wireless/intersil/p54/fwio.c +@@ -231,6 +231,7 @@ int p54_download_eeprom(struct p54_commo + + mutex_lock(&priv->eeprom_mutex); + priv->eeprom = buf; ++ priv->eeprom_slice_size = len; + eeprom_hdr = skb_put(skb, eeprom_hdr_size + len); + + if (priv->fw_var < 0x509) { +@@ -253,6 +254,7 @@ int p54_download_eeprom(struct p54_commo + ret = -EBUSY; + } + priv->eeprom = NULL; ++ priv->eeprom_slice_size = 0; + mutex_unlock(&priv->eeprom_mutex); + return ret; + } +--- a/drivers/net/wireless/intersil/p54/p54.h ++++ b/drivers/net/wireless/intersil/p54/p54.h +@@ -258,6 +258,7 @@ struct p54_common { + + /* eeprom handling */ + void *eeprom; ++ size_t eeprom_slice_size; + struct completion eeprom_comp; + struct mutex eeprom_mutex; + }; +--- a/drivers/net/wireless/intersil/p54/txrx.c ++++ b/drivers/net/wireless/intersil/p54/txrx.c +@@ -496,14 +496,19 @@ static void p54_rx_eeprom_readback(struc + return ; + + if (priv->fw_var >= 0x509) { +- memcpy(priv->eeprom, eeprom->v2.data, +- le16_to_cpu(eeprom->v2.len)); ++ if (le16_to_cpu(eeprom->v2.len) != priv->eeprom_slice_size) ++ return; ++ ++ memcpy(priv->eeprom, eeprom->v2.data, priv->eeprom_slice_size); + } else { +- memcpy(priv->eeprom, eeprom->v1.data, +- le16_to_cpu(eeprom->v1.len)); ++ if (le16_to_cpu(eeprom->v1.len) != priv->eeprom_slice_size) ++ return; ++ ++ memcpy(priv->eeprom, eeprom->v1.data, priv->eeprom_slice_size); + } + + priv->eeprom = NULL; ++ priv->eeprom_slice_size = 0; + tmp = p54_find_and_unlink_skb(priv, hdr->req_id); + dev_kfree_skb_any(tmp); + complete(&priv->eeprom_comp); -- 2.47.2