From: Greg Kroah-Hartman Date: Tue, 19 Aug 2025 12:13:40 +0000 (+0200) Subject: drop firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch X-Git-Tag: v6.12.43~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=24ebca5a4154a92a9c37c2ed2e8cf69015456013;p=thirdparty%2Fkernel%2Fstable-queue.git drop firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch --- diff --git a/queue-6.12/firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch b/queue-6.12/firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch deleted file mode 100644 index ee51090f2c..0000000000 --- a/queue-6.12/firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch +++ /dev/null @@ -1,100 +0,0 @@ -From ce4f7568dafb70487161ee1d80862d5ebbac8b07 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 30 Jun 2025 14:12:04 +0200 -Subject: firmware: qcom: scm: initialize tzmem before marking SCM as available - -From: Bartosz Golaszewski - -[ Upstream commit 87be3e7a2d0030cda6314d2ec96b37991f636ccd ] - -Now that qcom_scm_shm_bridge_enable() uses the struct device passed to -it as argument to make the QCOM_SCM_MP_SHM_BRIDGE_ENABLE SCM call, we -can move the TZMem initialization before the assignment of the __scm -pointer in the SCM driver (which marks SCM as ready to users) thus -fixing the potential race between consumer calls and the memory pool -initialization. - -Reported-by: Johan Hovold -Closes: https://lore.kernel.org/all/20250120151000.13870-1-johan+linaro@kernel.org/ -Signed-off-by: Bartosz Golaszewski -Link: https://lore.kernel.org/r/20250630-qcom-scm-race-v2-3-fa3851c98611@linaro.org -Signed-off-by: Bjorn Andersson -Signed-off-by: Sasha Levin ---- - drivers/firmware/qcom/qcom_scm.c | 53 ++++++++++++++++---------------- - 1 file changed, 26 insertions(+), 27 deletions(-) - -diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c -index 23aefbf6fca5..88f3ae652a87 100644 ---- a/drivers/firmware/qcom/qcom_scm.c -+++ b/drivers/firmware/qcom/qcom_scm.c -@@ -2000,7 +2000,32 @@ static int qcom_scm_probe(struct platform_device *pdev) - if (ret) - return ret; - -- /* Paired with smp_load_acquire() in qcom_scm_is_available(). */ -+ ret = of_reserved_mem_device_init(scm->dev); -+ if (ret && ret != -ENODEV) -+ return dev_err_probe(scm->dev, ret, -+ "Failed to setup the reserved memory region for TZ mem\n"); -+ -+ ret = qcom_tzmem_enable(scm->dev); -+ if (ret) -+ return dev_err_probe(scm->dev, ret, -+ "Failed to enable the TrustZone memory allocator\n"); -+ -+ memset(&pool_config, 0, sizeof(pool_config)); -+ pool_config.initial_size = 0; -+ pool_config.policy = QCOM_TZMEM_POLICY_ON_DEMAND; -+ pool_config.max_size = SZ_256K; -+ -+ scm->mempool = devm_qcom_tzmem_pool_new(scm->dev, &pool_config); -+ if (IS_ERR(scm->mempool)) -+ return dev_err_probe(scm->dev, PTR_ERR(scm->mempool), -+ "Failed to create the SCM memory pool\n"); -+ -+ /* -+ * Paired with smp_load_acquire() in qcom_scm_is_available(). -+ * -+ * This marks the SCM API as ready to accept user calls and can only -+ * be called after the TrustZone memory pool is initialized. -+ */ - smp_store_release(&__scm, scm); - - irq = platform_get_irq_optional(pdev, 0); -@@ -2033,32 +2058,6 @@ static int qcom_scm_probe(struct platform_device *pdev) - if (of_property_read_bool(pdev->dev.of_node, "qcom,sdi-enabled") || !download_mode) - qcom_scm_disable_sdi(); - -- ret = of_reserved_mem_device_init(__scm->dev); -- if (ret && ret != -ENODEV) { -- dev_err_probe(__scm->dev, ret, -- "Failed to setup the reserved memory region for TZ mem\n"); -- goto err; -- } -- -- ret = qcom_tzmem_enable(__scm->dev); -- if (ret) { -- dev_err_probe(__scm->dev, ret, -- "Failed to enable the TrustZone memory allocator\n"); -- goto err; -- } -- -- memset(&pool_config, 0, sizeof(pool_config)); -- pool_config.initial_size = 0; -- pool_config.policy = QCOM_TZMEM_POLICY_ON_DEMAND; -- pool_config.max_size = SZ_256K; -- -- __scm->mempool = devm_qcom_tzmem_pool_new(__scm->dev, &pool_config); -- if (IS_ERR(__scm->mempool)) { -- ret = dev_err_probe(__scm->dev, PTR_ERR(__scm->mempool), -- "Failed to create the SCM memory pool\n"); -- goto err; -- } -- - /* - * Initialize the QSEECOM interface. - * --- -2.39.5 - diff --git a/queue-6.12/series b/queue-6.12/series index 646d12e35a..978eef3333 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -98,7 +98,6 @@ usb-typec-ucsi-psy-set-current-max-to-100ma-for-bc-1.patch usb-xhci-avoid-showing-warnings-for-dying-controller.patch usb-xhci-set-avg_trb_len-8-for-ep0-during-address-de.patch usb-xhci-avoid-showing-errors-during-surprise-remova.patch -firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch soc-qcom-rpmh-rsc-add-rsc-version-4-support.patch acpi-apei-send-sigbus-to-current-task-if-synchronous.patch remoteproc-imx_rproc-skip-clock-enable-when-m-core-i.patch diff --git a/queue-6.15/firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch b/queue-6.15/firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch deleted file mode 100644 index 66fcfd84b3..0000000000 --- a/queue-6.15/firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 16d75044821e10f74fa42821bf74d25cdd2df282 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 30 Jun 2025 14:12:04 +0200 -Subject: firmware: qcom: scm: initialize tzmem before marking SCM as available - -From: Bartosz Golaszewski - -[ Upstream commit 87be3e7a2d0030cda6314d2ec96b37991f636ccd ] - -Now that qcom_scm_shm_bridge_enable() uses the struct device passed to -it as argument to make the QCOM_SCM_MP_SHM_BRIDGE_ENABLE SCM call, we -can move the TZMem initialization before the assignment of the __scm -pointer in the SCM driver (which marks SCM as ready to users) thus -fixing the potential race between consumer calls and the memory pool -initialization. - -Reported-by: Johan Hovold -Closes: https://lore.kernel.org/all/20250120151000.13870-1-johan+linaro@kernel.org/ -Signed-off-by: Bartosz Golaszewski -Link: https://lore.kernel.org/r/20250630-qcom-scm-race-v2-3-fa3851c98611@linaro.org -Signed-off-by: Bjorn Andersson -Signed-off-by: Sasha Levin ---- - drivers/firmware/qcom/qcom_scm.c | 53 ++++++++++++++++---------------- - 1 file changed, 26 insertions(+), 27 deletions(-) - -diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c -index fc4d67e4c4a6..9032c8a317f9 100644 ---- a/drivers/firmware/qcom/qcom_scm.c -+++ b/drivers/firmware/qcom/qcom_scm.c -@@ -2247,7 +2247,32 @@ static int qcom_scm_probe(struct platform_device *pdev) - if (ret) - return ret; - -- /* Paired with smp_load_acquire() in qcom_scm_is_available(). */ -+ ret = of_reserved_mem_device_init(scm->dev); -+ if (ret && ret != -ENODEV) -+ return dev_err_probe(scm->dev, ret, -+ "Failed to setup the reserved memory region for TZ mem\n"); -+ -+ ret = qcom_tzmem_enable(scm->dev); -+ if (ret) -+ return dev_err_probe(scm->dev, ret, -+ "Failed to enable the TrustZone memory allocator\n"); -+ -+ memset(&pool_config, 0, sizeof(pool_config)); -+ pool_config.initial_size = 0; -+ pool_config.policy = QCOM_TZMEM_POLICY_ON_DEMAND; -+ pool_config.max_size = SZ_256K; -+ -+ scm->mempool = devm_qcom_tzmem_pool_new(scm->dev, &pool_config); -+ if (IS_ERR(scm->mempool)) -+ return dev_err_probe(scm->dev, PTR_ERR(scm->mempool), -+ "Failed to create the SCM memory pool\n"); -+ -+ /* -+ * Paired with smp_load_acquire() in qcom_scm_is_available(). -+ * -+ * This marks the SCM API as ready to accept user calls and can only -+ * be called after the TrustZone memory pool is initialized. -+ */ - smp_store_release(&__scm, scm); - - irq = platform_get_irq_optional(pdev, 0); -@@ -2280,32 +2305,6 @@ static int qcom_scm_probe(struct platform_device *pdev) - if (of_property_read_bool(pdev->dev.of_node, "qcom,sdi-enabled") || !download_mode) - qcom_scm_disable_sdi(); - -- ret = of_reserved_mem_device_init(__scm->dev); -- if (ret && ret != -ENODEV) { -- dev_err_probe(__scm->dev, ret, -- "Failed to setup the reserved memory region for TZ mem\n"); -- goto err; -- } -- -- ret = qcom_tzmem_enable(__scm->dev); -- if (ret) { -- dev_err_probe(__scm->dev, ret, -- "Failed to enable the TrustZone memory allocator\n"); -- goto err; -- } -- -- memset(&pool_config, 0, sizeof(pool_config)); -- pool_config.initial_size = 0; -- pool_config.policy = QCOM_TZMEM_POLICY_ON_DEMAND; -- pool_config.max_size = SZ_256K; -- -- __scm->mempool = devm_qcom_tzmem_pool_new(__scm->dev, &pool_config); -- if (IS_ERR(__scm->mempool)) { -- ret = dev_err_probe(__scm->dev, PTR_ERR(__scm->mempool), -- "Failed to create the SCM memory pool\n"); -- goto err; -- } -- - /* - * Initialize the QSEECOM interface. - * --- -2.39.5 - diff --git a/queue-6.15/series b/queue-6.15/series index 916adbf597..4ad06163c9 100644 --- a/queue-6.15/series +++ b/queue-6.15/series @@ -118,7 +118,6 @@ bus-mhi-host-pci_generic-disable-runtime-pm-for-qdu1.patch usb-xhci-avoid-showing-warnings-for-dying-controller.patch usb-xhci-set-avg_trb_len-8-for-ep0-during-address-de.patch usb-xhci-avoid-showing-errors-during-surprise-remova.patch -firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch soc-qcom-rpmh-rsc-add-rsc-version-4-support.patch acpi-apei-send-sigbus-to-current-task-if-synchronous.patch remoteproc-imx_rproc-skip-clock-enable-when-m-core-i.patch diff --git a/queue-6.16/firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch b/queue-6.16/firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch deleted file mode 100644 index 7757fc04e9..0000000000 --- a/queue-6.16/firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch +++ /dev/null @@ -1,100 +0,0 @@ -From 6e9584a284bc86b2a8a7fd8cdaa4cab05a3b24f2 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Mon, 30 Jun 2025 14:12:04 +0200 -Subject: firmware: qcom: scm: initialize tzmem before marking SCM as available - -From: Bartosz Golaszewski - -[ Upstream commit 87be3e7a2d0030cda6314d2ec96b37991f636ccd ] - -Now that qcom_scm_shm_bridge_enable() uses the struct device passed to -it as argument to make the QCOM_SCM_MP_SHM_BRIDGE_ENABLE SCM call, we -can move the TZMem initialization before the assignment of the __scm -pointer in the SCM driver (which marks SCM as ready to users) thus -fixing the potential race between consumer calls and the memory pool -initialization. - -Reported-by: Johan Hovold -Closes: https://lore.kernel.org/all/20250120151000.13870-1-johan+linaro@kernel.org/ -Signed-off-by: Bartosz Golaszewski -Link: https://lore.kernel.org/r/20250630-qcom-scm-race-v2-3-fa3851c98611@linaro.org -Signed-off-by: Bjorn Andersson -Signed-off-by: Sasha Levin ---- - drivers/firmware/qcom/qcom_scm.c | 53 ++++++++++++++++---------------- - 1 file changed, 26 insertions(+), 27 deletions(-) - -diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c -index f63b716be5b0..4e510eb70c79 100644 ---- a/drivers/firmware/qcom/qcom_scm.c -+++ b/drivers/firmware/qcom/qcom_scm.c -@@ -2250,7 +2250,32 @@ static int qcom_scm_probe(struct platform_device *pdev) - if (ret) - return ret; - -- /* Paired with smp_load_acquire() in qcom_scm_is_available(). */ -+ ret = of_reserved_mem_device_init(scm->dev); -+ if (ret && ret != -ENODEV) -+ return dev_err_probe(scm->dev, ret, -+ "Failed to setup the reserved memory region for TZ mem\n"); -+ -+ ret = qcom_tzmem_enable(scm->dev); -+ if (ret) -+ return dev_err_probe(scm->dev, ret, -+ "Failed to enable the TrustZone memory allocator\n"); -+ -+ memset(&pool_config, 0, sizeof(pool_config)); -+ pool_config.initial_size = 0; -+ pool_config.policy = QCOM_TZMEM_POLICY_ON_DEMAND; -+ pool_config.max_size = SZ_256K; -+ -+ scm->mempool = devm_qcom_tzmem_pool_new(scm->dev, &pool_config); -+ if (IS_ERR(scm->mempool)) -+ return dev_err_probe(scm->dev, PTR_ERR(scm->mempool), -+ "Failed to create the SCM memory pool\n"); -+ -+ /* -+ * Paired with smp_load_acquire() in qcom_scm_is_available(). -+ * -+ * This marks the SCM API as ready to accept user calls and can only -+ * be called after the TrustZone memory pool is initialized. -+ */ - smp_store_release(&__scm, scm); - - irq = platform_get_irq_optional(pdev, 0); -@@ -2283,32 +2308,6 @@ static int qcom_scm_probe(struct platform_device *pdev) - if (of_property_read_bool(pdev->dev.of_node, "qcom,sdi-enabled") || !download_mode) - qcom_scm_disable_sdi(); - -- ret = of_reserved_mem_device_init(__scm->dev); -- if (ret && ret != -ENODEV) { -- dev_err_probe(__scm->dev, ret, -- "Failed to setup the reserved memory region for TZ mem\n"); -- goto err; -- } -- -- ret = qcom_tzmem_enable(__scm->dev); -- if (ret) { -- dev_err_probe(__scm->dev, ret, -- "Failed to enable the TrustZone memory allocator\n"); -- goto err; -- } -- -- memset(&pool_config, 0, sizeof(pool_config)); -- pool_config.initial_size = 0; -- pool_config.policy = QCOM_TZMEM_POLICY_ON_DEMAND; -- pool_config.max_size = SZ_256K; -- -- __scm->mempool = devm_qcom_tzmem_pool_new(__scm->dev, &pool_config); -- if (IS_ERR(__scm->mempool)) { -- ret = dev_err_probe(__scm->dev, PTR_ERR(__scm->mempool), -- "Failed to create the SCM memory pool\n"); -- goto err; -- } -- - /* - * Initialize the QSEECOM interface. - * --- -2.39.5 - diff --git a/queue-6.16/series b/queue-6.16/series index b0ee6fe052..58e0327dc9 100644 --- a/queue-6.16/series +++ b/queue-6.16/series @@ -131,7 +131,6 @@ bus-mhi-host-pci_generic-disable-runtime-pm-for-qdu1.patch usb-xhci-avoid-showing-warnings-for-dying-controller.patch usb-xhci-set-avg_trb_len-8-for-ep0-during-address-de.patch usb-xhci-avoid-showing-errors-during-surprise-remova.patch -firmware-qcom-scm-initialize-tzmem-before-marking-sc.patch soc-qcom-rpmh-rsc-add-rsc-version-4-support.patch acpi-apei-send-sigbus-to-current-task-if-synchronous.patch remoteproc-imx_rproc-skip-clock-enable-when-m-core-i.patch