linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/2] interconnect: Move qcom interconnect drivers to core_initcall
@ 2019-10-31 18:28 Jordan Crouse
  2019-10-31 18:28 ` [PATCH v1 1/2] interconnect: Move " Jordan Crouse
  2019-10-31 18:28 ` [PATCH v1 2/2] interconnect: Remove unused module exit code from core Jordan Crouse
  0 siblings, 2 replies; 5+ messages in thread
From: Jordan Crouse @ 2019-10-31 18:28 UTC (permalink / raw)
  To: Georgi Djakov
  Cc: Bjorn Andersson, linux-pm, linux-kernel, Andy Gross, linux-arm-msm

Currently all the qcom interconnect drivers initialize at the device_initcall
level when they are built-in which is a problem since nearly all the frameworks
and leaf drivers in the SoC depend on interconnect in some fashion. While those
frameworks and drivers should be properly PROBE_DEFER aware it is in our best
interest to try not to defer just because we can. Move all the drivers to
core_initcall when built to increase the chance that they will be available when
their dependent drivers need them.

I also tossed on a quick cleanup patch to remove unneeded module exit code from
the core file since it is always built in.

Regards,
Jordan

Jordan Crouse (2):
  interconnect: Move interconnect drivers to core_initcall
  interconnect: Remove unused module exit code from core

 drivers/interconnect/core.c         |  7 +------
 drivers/interconnect/qcom/msm8974.c | 14 +++++++++++++-
 drivers/interconnect/qcom/qcs404.c  | 14 +++++++++++++-
 drivers/interconnect/qcom/sdm845.c  | 13 ++++++++++++-
 4 files changed, 39 insertions(+), 9 deletions(-)

-- 
2.7.4


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v1 1/2] interconnect: Move interconnect drivers to core_initcall
  2019-10-31 18:28 [PATCH v1 0/2] interconnect: Move qcom interconnect drivers to core_initcall Jordan Crouse
@ 2019-10-31 18:28 ` Jordan Crouse
  2019-10-31 18:30   ` Bjorn Andersson
  2019-10-31 18:28 ` [PATCH v1 2/2] interconnect: Remove unused module exit code from core Jordan Crouse
  1 sibling, 1 reply; 5+ messages in thread
From: Jordan Crouse @ 2019-10-31 18:28 UTC (permalink / raw)
  To: Georgi Djakov
  Cc: Bjorn Andersson, linux-pm, linux-kernel, Andy Gross, linux-arm-msm

The interconnect drivers are essential to nearly every leaf driver and
subcomponent in the SoC. Initialize them at the core_initcall level
so that they are available to their dependent drivers when built in.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
---

 drivers/interconnect/qcom/msm8974.c | 14 +++++++++++++-
 drivers/interconnect/qcom/qcs404.c  | 14 +++++++++++++-
 drivers/interconnect/qcom/sdm845.c  | 13 ++++++++++++-
 3 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/drivers/interconnect/qcom/msm8974.c b/drivers/interconnect/qcom/msm8974.c
index c70ac58..9386d5c 100644
--- a/drivers/interconnect/qcom/msm8974.c
+++ b/drivers/interconnect/qcom/msm8974.c
@@ -778,7 +778,19 @@ static struct platform_driver msm8974_noc_driver = {
 		.of_match_table = msm8974_noc_of_match,
 	},
 };
-module_platform_driver(msm8974_noc_driver);
+
+static int __init msm8974_noc_driver_init(void)
+{
+	return platform_driver_register(&msm8974_noc_driver);
+}
+core_initcall(msm8974_noc_driver_init);
+
+static void __exit msm8974_noc_driver_exit(void)
+{
+	platform_driver_unregister(&msm8974_noc_driver);
+}
+module_exit(msm8974_noc_driver_exit);
+
 MODULE_DESCRIPTION("Qualcomm MSM8974 NoC driver");
 MODULE_AUTHOR("Brian Masney <masneyb@onstation.org>");
 MODULE_LICENSE("GPL v2");
diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c
index b4966d8..7dd3e76 100644
--- a/drivers/interconnect/qcom/qcs404.c
+++ b/drivers/interconnect/qcom/qcs404.c
@@ -535,6 +535,18 @@ static struct platform_driver qcs404_noc_driver = {
 		.of_match_table = qcs404_noc_of_match,
 	},
 };
-module_platform_driver(qcs404_noc_driver);
+
+static int __init qcs404_noc_driver_init(void)
+{
+	return platform_driver_register(&qcs404_noc_driver);
+}
+core_initcall(qcs404_noc_driver_init);
+
+static void __exit qcs404_noc_driver_exit(void)
+{
+	platform_driver_unregister(&qcs404_noc_driver);
+}
+module_exit(qcs404_noc_driver_exit);
+
 MODULE_DESCRIPTION("Qualcomm QCS404 NoC driver");
 MODULE_LICENSE("GPL v2");
diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c
index 502a6c2..4dab92a 100644
--- a/drivers/interconnect/qcom/sdm845.c
+++ b/drivers/interconnect/qcom/sdm845.c
@@ -892,7 +892,18 @@ static struct platform_driver qnoc_driver = {
 		.of_match_table = qnoc_of_match,
 	},
 };
-module_platform_driver(qnoc_driver);
+
+static int __init qnoc_driver_init(void)
+{
+	return platform_driver_register(&qnoc_driver);
+}
+core_initcall(qnoc_driver_init);
+
+static void __exit qnoc_driver_exit(void)
+{
+	platform_driver_unregister(&qnoc_driver);
+}
+module_exit(qnoc_driver_exit);
 
 MODULE_AUTHOR("David Dai <daidavid1@codeaurora.org>");
 MODULE_DESCRIPTION("Qualcomm sdm845 NoC driver");
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v1 2/2] interconnect: Remove unused module exit code from core
  2019-10-31 18:28 [PATCH v1 0/2] interconnect: Move qcom interconnect drivers to core_initcall Jordan Crouse
  2019-10-31 18:28 ` [PATCH v1 1/2] interconnect: Move " Jordan Crouse
@ 2019-10-31 18:28 ` Jordan Crouse
  2019-10-31 18:32   ` Bjorn Andersson
  1 sibling, 1 reply; 5+ messages in thread
From: Jordan Crouse @ 2019-10-31 18:28 UTC (permalink / raw)
  To: Georgi Djakov; +Cc: Bjorn Andersson, linux-kernel, linux-pm

The interconnect core is currently always built in:

 menuconfig INTERCONNECT
	bool "On-Chip Interconnect management support"

So remove the module_exit function and symbolically rename module_init
to device_initcall to drive home the point.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
---

 drivers/interconnect/core.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
index c498796..61aba50 100644
--- a/drivers/interconnect/core.c
+++ b/drivers/interconnect/core.c
@@ -805,12 +805,7 @@ static int __init icc_init(void)
 	return 0;
 }
 
-static void __exit icc_exit(void)
-{
-	debugfs_remove_recursive(icc_debugfs_dir);
-}
-module_init(icc_init);
-module_exit(icc_exit);
+device_initcall(icc_init);
 
 MODULE_AUTHOR("Georgi Djakov <georgi.djakov@linaro.org>");
 MODULE_DESCRIPTION("Interconnect Driver Core");
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 1/2] interconnect: Move interconnect drivers to core_initcall
  2019-10-31 18:28 ` [PATCH v1 1/2] interconnect: Move " Jordan Crouse
@ 2019-10-31 18:30   ` Bjorn Andersson
  0 siblings, 0 replies; 5+ messages in thread
From: Bjorn Andersson @ 2019-10-31 18:30 UTC (permalink / raw)
  To: Jordan Crouse
  Cc: Georgi Djakov, linux-pm, linux-kernel, Andy Gross, linux-arm-msm

On Thu 31 Oct 11:28 PDT 2019, Jordan Crouse wrote:

> The interconnect drivers are essential to nearly every leaf driver and
> subcomponent in the SoC. Initialize them at the core_initcall level
> so that they are available to their dependent drivers when built in.
> 
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> ---
> 
>  drivers/interconnect/qcom/msm8974.c | 14 +++++++++++++-
>  drivers/interconnect/qcom/qcs404.c  | 14 +++++++++++++-
>  drivers/interconnect/qcom/sdm845.c  | 13 ++++++++++++-
>  3 files changed, 38 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/interconnect/qcom/msm8974.c b/drivers/interconnect/qcom/msm8974.c
> index c70ac58..9386d5c 100644
> --- a/drivers/interconnect/qcom/msm8974.c
> +++ b/drivers/interconnect/qcom/msm8974.c
> @@ -778,7 +778,19 @@ static struct platform_driver msm8974_noc_driver = {
>  		.of_match_table = msm8974_noc_of_match,
>  	},
>  };
> -module_platform_driver(msm8974_noc_driver);
> +
> +static int __init msm8974_noc_driver_init(void)
> +{
> +	return platform_driver_register(&msm8974_noc_driver);
> +}
> +core_initcall(msm8974_noc_driver_init);
> +
> +static void __exit msm8974_noc_driver_exit(void)
> +{
> +	platform_driver_unregister(&msm8974_noc_driver);
> +}
> +module_exit(msm8974_noc_driver_exit);
> +
>  MODULE_DESCRIPTION("Qualcomm MSM8974 NoC driver");
>  MODULE_AUTHOR("Brian Masney <masneyb@onstation.org>");
>  MODULE_LICENSE("GPL v2");
> diff --git a/drivers/interconnect/qcom/qcs404.c b/drivers/interconnect/qcom/qcs404.c
> index b4966d8..7dd3e76 100644
> --- a/drivers/interconnect/qcom/qcs404.c
> +++ b/drivers/interconnect/qcom/qcs404.c
> @@ -535,6 +535,18 @@ static struct platform_driver qcs404_noc_driver = {
>  		.of_match_table = qcs404_noc_of_match,
>  	},
>  };
> -module_platform_driver(qcs404_noc_driver);
> +
> +static int __init qcs404_noc_driver_init(void)
> +{
> +	return platform_driver_register(&qcs404_noc_driver);
> +}
> +core_initcall(qcs404_noc_driver_init);
> +
> +static void __exit qcs404_noc_driver_exit(void)
> +{
> +	platform_driver_unregister(&qcs404_noc_driver);
> +}
> +module_exit(qcs404_noc_driver_exit);
> +
>  MODULE_DESCRIPTION("Qualcomm QCS404 NoC driver");
>  MODULE_LICENSE("GPL v2");
> diff --git a/drivers/interconnect/qcom/sdm845.c b/drivers/interconnect/qcom/sdm845.c
> index 502a6c2..4dab92a 100644
> --- a/drivers/interconnect/qcom/sdm845.c
> +++ b/drivers/interconnect/qcom/sdm845.c
> @@ -892,7 +892,18 @@ static struct platform_driver qnoc_driver = {
>  		.of_match_table = qnoc_of_match,
>  	},
>  };
> -module_platform_driver(qnoc_driver);
> +
> +static int __init qnoc_driver_init(void)
> +{
> +	return platform_driver_register(&qnoc_driver);
> +}
> +core_initcall(qnoc_driver_init);
> +
> +static void __exit qnoc_driver_exit(void)
> +{
> +	platform_driver_unregister(&qnoc_driver);
> +}
> +module_exit(qnoc_driver_exit);
>  
>  MODULE_AUTHOR("David Dai <daidavid1@codeaurora.org>");
>  MODULE_DESCRIPTION("Qualcomm sdm845 NoC driver");
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1 2/2] interconnect: Remove unused module exit code from core
  2019-10-31 18:28 ` [PATCH v1 2/2] interconnect: Remove unused module exit code from core Jordan Crouse
@ 2019-10-31 18:32   ` Bjorn Andersson
  0 siblings, 0 replies; 5+ messages in thread
From: Bjorn Andersson @ 2019-10-31 18:32 UTC (permalink / raw)
  To: Jordan Crouse; +Cc: Georgi Djakov, linux-kernel, linux-pm

On Thu 31 Oct 11:28 PDT 2019, Jordan Crouse wrote:

> The interconnect core is currently always built in:
> 
>  menuconfig INTERCONNECT
> 	bool "On-Chip Interconnect management support"
> 
> So remove the module_exit function and symbolically rename module_init
> to device_initcall to drive home the point.
> 
> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> ---
> 
>  drivers/interconnect/core.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c
> index c498796..61aba50 100644
> --- a/drivers/interconnect/core.c
> +++ b/drivers/interconnect/core.c
> @@ -805,12 +805,7 @@ static int __init icc_init(void)
>  	return 0;
>  }
>  
> -static void __exit icc_exit(void)
> -{
> -	debugfs_remove_recursive(icc_debugfs_dir);
> -}
> -module_init(icc_init);
> -module_exit(icc_exit);
> +device_initcall(icc_init);
>  
>  MODULE_AUTHOR("Georgi Djakov <georgi.djakov@linaro.org>");
>  MODULE_DESCRIPTION("Interconnect Driver Core");
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-10-31 18:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-31 18:28 [PATCH v1 0/2] interconnect: Move qcom interconnect drivers to core_initcall Jordan Crouse
2019-10-31 18:28 ` [PATCH v1 1/2] interconnect: Move " Jordan Crouse
2019-10-31 18:30   ` Bjorn Andersson
2019-10-31 18:28 ` [PATCH v1 2/2] interconnect: Remove unused module exit code from core Jordan Crouse
2019-10-31 18:32   ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).