FAILED: patch "[PATCH] interconnect: imx: fix registration race" failed to apply to 5.15-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 5.15-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y
git checkout FETCH_HEAD
git cherry-pick -x 9fbd35520f1f7f3cbe1873939a27ad9b009f21f9
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 5.15.y' HEAD^..
Possible dependencies:
9fbd35520f1f ("interconnect: imx: fix registration race")f62e3f595c5f ("interconnect: imx: Make imx_icc_unregister() return void") 7ec26b8dcc5c ("interconnect: imx: Ignore return value of icc_provider_del() in .remove()") c14ec5c93dc8 ("interconnect: imx: Add platform driver for imx8mp") 7980d85a9443 ("interconnect: imx: configure NoC mode/prioriry/ext_control") 12db59e8e0a2 ("interconnect: imx: introduce imx_icc_provider")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 9fbd35520f1f7f3cbe1873939a27ad9b009f21f9 Mon Sep 17 00:00:00 2001
From: Johan Hovold <[email protected]>
Date: Mon, 6 Mar 2023 08:56:32 +0100
Subject: [PATCH] interconnect: imx: fix registration race
The current interconnect provider registration interface is inherently racy as nodes are not added until the after adding the provider. This can specifically cause racing DT lookups to fail.
Switch to using the new API where the provider is not registered until after it has been fully initialised.
drivers/interconnect/imx/imx.c +10 -10
@@ -295,6 +295,9 @@ int imx_icc_register(struct platform_device *pdev, provider->xlate = of_icc_xlate_onecell; provider->data = data; provider->dev = dev->parent; + +icc_provider_init (provider); +platform_set_drvdata (pdev, imx_provider);if (settings) {
@@ -306,20 +309,18 @@ int imx_icc_register(struct platform_device *pdev, } } - ret =icc_provider_add (provider); -if (ret) { -dev_err (dev,"error adding interconnect provider: %d\n" , ret); + ret =imx_icc_register_nodes (imx_provider, nodes, nodes_count, settings); +if (ret)return ret; - } - ret =imx_icc_register_nodes (imx_provider, nodes, nodes_count, settings); + ret =icc_provider_register (provider);if (ret) - goto provider_del; + goto err_unregister_nodes;return 0 ; -provider_del: -icc_provider_del (provider); +err_unregister_nodes: +imx_icc_unregister_nodes (&imx_provider->provider);return ret; }EXPORT_SYMBOL_GPL (imx_icc_register);
@@ -328,9 +329,8 @@ void imx_icc_unregister(struct platform_device *pdev) {struct imx_icc_provider *imx_provider =platform_get_drvdata (pdev); +icc_provider_deregister (&imx_provider->provider);imx_icc_unregister_nodes (&imx_provider->provider); - -icc_provider_del (&imx_provider->provider); }EXPORT_SYMBOL_GPL (imx_icc_unregister);