Allow for rpmpd/rpmh/rpmhpd drivers to be loaded as permenent modules
Subsystems (2)
v3 cover Allow for rpmpd/rpmh/rpmhpd drivers to be loaded as permenent modules
This series simply allows the qcom rpmpd, rpmh and rpmhpd drivers to be configured and loaded as permement modules.
This means the modules can be loaded, but not unloaded.
While maybe not ideal, this is an improvement over requiring the drivers to be built in.
Feedback on this series would be welcome!
thanks
-john
New in v3:
* Added similar change to rpmh and rpmhpd drivers.
John Stultz (3):
soc: qcom: rpmpd: Allow RPMPD driver to be loaded as a module
soc: qcom: rpmh: Allow RPMH driver to be loaded as a module
soc: qcom: rpmhpd: Allow RPMHPD driver to be loaded as a module
drivers/soc/qcom/Kconfig | 8 ++++---- drivers/soc/qcom/rpmh-rsc.c | 6 ++++++ drivers/soc/qcom/rpmhpd.c | 5 +++++ drivers/soc/qcom/rpmpd.c | 6 ++++++ 4 files changed, 21 insertions(+), 4 deletions(-)
Signature · 1 line
2.17.1
PATCH v3 1/3 soc: qcom: rpmpd: Allow RPMPD driver to be loaded as a module
This patch allow the rpmpd driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded.
Ideally, it would include a remove hook and related logic, but apparently the genpd code isn't able to track usage and cleaning things up? (See: https://lkml.org/lkml/2019/1/24/38)
So making it a permenent module at least improves things slightly over requiring it to be a built in driver.
Feedback would be appreciated!
---
v2:
* Fix MODULE_LICENSE to be GPL v2 as suggested by Bjorn
* Leave initcall as core_initcall, since that switches to module_initcall only when built as a module, also suggested by Bjorn
* Add module tags taken from Rajendra's earlier patch
--- drivers/soc/qcom/Kconfig | 4 ++-- drivers/soc/qcom/rpmpd.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-)
drivers/soc/qcom/Kconfig +2 -2
@@ -123,8 +123,8 @@ config QCOM_RPMHPD for the voltage rail. config QCOM_RPMPD - bool "Qualcomm RPM Power domain driver" - depends on QCOM_SMD_RPM=y + tristate "Qualcomm RPM Power domain driver" + depends on QCOM_SMD_RPM help QCOM RPM Power domain driver to support power-domains with performance states. The driver communicates a performance state
drivers/soc/qcom/rpmpd.c +6 -0
@@ -5,6 +5,7 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/mutex.h> +#include <linux/module.h> #include <linux/pm_domain.h> #include <linux/of.h> #include <linux/of_device.h>
@@ -226,6 +227,7 @@ static const struct of_device_id rpmpd_match_table[] = { { .compatible = "qcom,qcs404-rpmpd", .data = &qcs404_desc }, { } }; +MODULE_DEVICE_TABLE (of, rpmpd_match_table);static int rpmpd_send_enable (struct rpmpd *pd,bool enable) {
@@ -422,3 +424,7 @@ static int __init rpmpd_init(void)return platform_driver_register (&rpmpd_driver); }core_initcall (rpmpd_init); + +MODULE_DESCRIPTION ("Qualcomm Technologies, Inc. RPM Power Domain Driver" ); +MODULE_LICENSE ("GPL v2" ); +MODULE_ALIAS ("platform:qcom-rpmpd" );
Signature · 1 line
2.17.1
Re: [PATCH v3 1/3] soc: qcom: rpmpd: Allow RPMPD driver to be loaded as a module
Quoted 52 lines · John Stultz
This patch allow the rpmpd driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded.
Ideally, it would include a remove hook and related logic, but apparently the genpd code isn't able to track usage and cleaning things up? (See: https://lkml.org/lkml/2019/1/24/38)
So making it a permenent module at least improves things slightly over requiring it to be a built in driver.
Feedback would be appreciated!
Cc Todd Kjos <[email protected]>Cc Saravana Kannan <[email protected]>Cc Andy Gross <[email protected]>Cc Bjorn Andersson <[email protected]>Cc Rajendra Nayak <[email protected]>Acked-by Saravana Kannan <[email protected]>Signed-off-by John Stultz <[email protected]>---
v2:
* FixMODULE_LICENSEto be GPL v2 as suggested by Bjorn
* Leave initcall ascore_initcall, since that switches tomodule_initcallonly when built as a module, also suggested by Bjorn
* Add module tags taken from Rajendra's earlier patch--- drivers/soc/qcom/Kconfig | 4 ++-- drivers/soc/qcom/rpmpd.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-)drivers/soc/qcom/Kconfig +2
-2@@ -123,8 +123,8 @@ config QCOM_RPMHPD for the voltage rail. config QCOM_RPMPD - bool "Qualcomm RPM Power domain driver" - depends on QCOM_SMD_RPM=y + tristate "Qualcomm RPM Power domain driver" + depends on QCOM_SMD_RPM help QCOM RPM Power domain driver to support power-domains with performance states. The driver communicates a performance statedrivers/soc/qcom/rpmpd.c +0
-0
drivers/soc/qcom/rpmpd.c line 8
Quoted 4 lines
drivers/soc/qcom/rpmpd.c +1
-0@@ -5,6 +5,7 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/mutex.h> +#include <linux/module.h>
module comes before mutex in the alphabet.
Quoted 12 lines
drivers/soc/qcom/rpmpd.c +1
-0#include <linux/pm_domain.h> #include <linux/of.h> #include <linux/of_device.h> @@ -226,6 +227,7 @@ static const struct of_device_id rpmpd_match_table[] = { { .compatible = "qcom,qcs404-rpmpd", .data = &qcs404_desc }, { } }; +MODULE_DEVICE_TABLE (of, rpmpd_match_table);static int rpmpd_send_enable (struct rpmpd *pd,bool enable) {
drivers/soc/qcom/rpmpd.c static int __init rpmpd_init(void) · line 430
Quoted 7 lines
drivers/soc/qcom/rpmpd.c +4
-0@@ -422,3 +424,7 @@ static int __init rpmpd_init(void)return platform_driver_register (&rpmpd_driver); }core_initcall (rpmpd_init); + +MODULE_DESCRIPTION ("Qualcomm Technologies, Inc. RPM Power Domain Driver" ); +MODULE_LICENSE ("GPL v2" ); +MODULE_ALIAS ("platform:qcom-rpmpd" );
Is there any reason for this alias?
The module will be automatically loaded based on compatible and the MODULE_DEVICE_TABLE() information above, and for ACPI would need a similar acpi_device_id table.
Regards,
Bjorn
Quoted 3 lines
Signature · 1 line
2.17.1
Re: [PATCH v3 1/3] soc: qcom: rpmpd: Allow RPMPD driver to be loaded as a module
Quoted 53 lines · Bjorn Andersson
Quoted 50 lines · John Stultz
This patch allow the rpmpd driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded.
Ideally, it would include a remove hook and related logic, but apparently the genpd code isn't able to track usage and cleaning things up? (See: https://lkml.org/lkml/2019/1/24/38)
So making it a permenent module at least improves things slightly over requiring it to be a built in driver.
Feedback would be appreciated!
Cc Todd Kjos <[email protected]>Cc Saravana Kannan <[email protected]>Cc Andy Gross <[email protected]>Cc Bjorn Andersson <[email protected]>Cc Rajendra Nayak <[email protected]>Acked-by Saravana Kannan <[email protected]>Signed-off-by John Stultz <[email protected]>---
v2:
* FixMODULE_LICENSEto be GPL v2 as suggested by Bjorn
* Leave initcall ascore_initcall, since that switches tomodule_initcallonly when built as a module, also suggested by Bjorn
* Add module tags taken from Rajendra's earlier patch--- drivers/soc/qcom/Kconfig | 4 ++-- drivers/soc/qcom/rpmpd.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-)drivers/soc/qcom/Kconfig +2
-2@@ -123,8 +123,8 @@ config QCOM_RPMHPD for the voltage rail. config QCOM_RPMPD - bool "Qualcomm RPM Power domain driver" - depends on QCOM_SMD_RPM=y + tristate "Qualcomm RPM Power domain driver" + depends on QCOM_SMD_RPM help QCOM RPM Power domain driver to support power-domains with performance states. The driver communicates a performance statedrivers/soc/qcom/rpmpd.c +0
-1--- a/drivers/soc/qcom/rpmpd.c
Quoted 8 lines
drivers/soc/qcom/rpmpd.c line 8
Quoted 6 lines
+++
b/drivers/soc/qcom/rpmpd.cdrivers/soc/qcom/rpmpd.c +1
-0@@ -5,6 +5,7 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/mutex.h> +#include <linux/module.h> module comes before mutex in the alphabet.
:) Thanks for catching that.
Quoted 22 lines
Quoted 12 lines
drivers/soc/qcom/rpmpd.c +1
-0#include <linux/pm_domain.h> #include <linux/of.h> #include <linux/of_device.h> @@ -226,6 +227,7 @@ static const struct of_device_id rpmpd_match_table[] = { { .compatible = "qcom,qcs404-rpmpd", .data = &qcs404_desc }, { } }; +MODULE_DEVICE_TABLE (of, rpmpd_match_table);static int rpmpd_send_enable (struct rpmpd *pd,bool enable) {drivers/soc/qcom/rpmpd.c static int __init rpmpd_init(void) · line 430
Quoted 7 lines
drivers/soc/qcom/rpmpd.c +4
-0@@ -422,3 +424,7 @@ static int __init rpmpd_init(void)return platform_driver_register (&rpmpd_driver); }core_initcall (rpmpd_init); + +MODULE_DESCRIPTION ("Qualcomm Technologies, Inc. RPM Power Domain Driver" ); +MODULE_LICENSE ("GPL v2" ); +MODULE_ALIAS ("platform:qcom-rpmpd" );Is there any reason for this alias?
Quoted 3 lines
The module will be automatically loaded based on compatible and the
MODULE_DEVICE_TABLE()information above, and for ACPI would need a similaracpi_device_idtable.
I pulled it in from Rajendra's earlier patch. I'm ok to drop it though.
I'll fix these up and respin. Thanks for the review!
thanks
-john
Re: [PATCH v3 1/3] soc: qcom: rpmpd: Allow RPMPD driver to be loaded as a module
Quoted 88 lines · John Stultz
Quoted 53 lines · Bjorn Andersson
Quoted 50 lines · John Stultz
This patch allow the rpmpd driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded.
Ideally, it would include a remove hook and related logic, but apparently the genpd code isn't able to track usage and cleaning things up? (See: https://lkml.org/lkml/2019/1/24/38)
So making it a permenent module at least improves things slightly over requiring it to be a built in driver.
Feedback would be appreciated!
Cc Todd Kjos <[email protected]>Cc Saravana Kannan <[email protected]>Cc Andy Gross <[email protected]>Cc Bjorn Andersson <[email protected]>Cc Rajendra Nayak <[email protected]>Acked-by Saravana Kannan <[email protected]>Signed-off-by John Stultz <[email protected]>---
v2:
* FixMODULE_LICENSEto be GPL v2 as suggested by Bjorn
* Leave initcall ascore_initcall, since that switches tomodule_initcallonly when built as a module, also suggested by Bjorn
* Add module tags taken from Rajendra's earlier patch--- drivers/soc/qcom/Kconfig | 4 ++-- drivers/soc/qcom/rpmpd.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-)drivers/soc/qcom/Kconfig +2
-2@@ -123,8 +123,8 @@ config QCOM_RPMHPD for the voltage rail. config QCOM_RPMPD - bool "Qualcomm RPM Power domain driver" - depends on QCOM_SMD_RPM=y + tristate "Qualcomm RPM Power domain driver" + depends on QCOM_SMD_RPM help QCOM RPM Power domain driver to support power-domains with performance states. The driver communicates a performance statedrivers/soc/qcom/rpmpd.c +0
-1--- a/drivers/soc/qcom/rpmpd.cQuoted 8 lines
drivers/soc/qcom/rpmpd.c line 8
Quoted 6 lines
+++
b/drivers/soc/qcom/rpmpd.cdrivers/soc/qcom/rpmpd.c +1
-0@@ -5,6 +5,7 @@#include <linux/init.h> #include <linux/kernel.h> #include <linux/mutex.h> +#include <linux/module.h> module comes before mutex in the alphabet.
:) Thanks for catching that.
Quoted 22 lines
Quoted 12 lines
drivers/soc/qcom/rpmpd.c +1
-0#include <linux/pm_domain.h> #include <linux/of.h> #include <linux/of_device.h> @@ -226,6 +227,7 @@ static const struct of_device_id rpmpd_match_table[] = { { .compatible = "qcom,qcs404-rpmpd", .data = &qcs404_desc }, { } }; +MODULE_DEVICE_TABLE (of, rpmpd_match_table);static int rpmpd_send_enable (struct rpmpd *pd,bool enable) {drivers/soc/qcom/rpmpd.c static int __init rpmpd_init(void) · line 430
Quoted 7 lines
drivers/soc/qcom/rpmpd.c +4
-0@@ -422,3 +424,7 @@ static int __init rpmpd_init(void)return platform_driver_register (&rpmpd_driver); }core_initcall (rpmpd_init); + +MODULE_DESCRIPTION ("Qualcomm Technologies, Inc. RPM Power Domain Driver" ); +MODULE_LICENSE ("GPL v2" ); +MODULE_ALIAS ("platform:qcom-rpmpd" );Is there any reason for this alias?
Quoted 8 lines
Quoted 3 lines
The module will be automatically loaded based on compatible and the
MODULE_DEVICE_TABLE()information above, and for ACPI would need a similaracpi_device_idtable.I pulled it in from Rajendra's earlier patch. I'm ok to drop it though.
I'll fix these up and respin. Thanks for the review!
No worries, I'll fix these two things and apply the patch. Just wanted to check if I was missing something.
Regards,
Bjorn
PATCH v3 2/3 soc: qcom: rpmh: Allow RPMH driver to be loaded as a module
In reply to John StultzThis patch allow the rpmh driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded.
Ideally, it would include a remove hook and related logic, but the rpmh driver is fairly core to the system, so once its loaded with almost anythign else to get the system to go, the dependencies are not likely to ever also be removed.
So making it a permenent module at least improves things slightly over requiring it to be a built in driver.
Feedback would be appreciated!
--- drivers/soc/qcom/Kconfig | 2 +- drivers/soc/qcom/rpmh-rsc.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/soc/qcom/Kconfig +1 -1
@@ -104,7 +104,7 @@ config QCOM_RMTFS_MEM Say y here if you intend to boot the modem remoteproc. config QCOM_RPMH - bool "Qualcomm RPM-Hardened (RPMH) Communication" + tristate "Qualcomm RPM-Hardened (RPMH) Communication" depends on ARCH_QCOM && ARM64 || COMPILE_TEST help Support for communication with the hardened-RPM blocks in
drivers/soc/qcom/rpmh-rsc.c +6 -0
@@ -11,6 +11,7 @@#include <linux/io.h> #include <linux/kernel.h> #include <linux/list.h> +#include <linux/module.h> #include <linux/of.h> #include <linux/of_irq.h> #include <linux/of_platform.h>
@@ -679,6 +680,8 @@ static const struct of_device_id rpmh_drv_match[] = { { .compatible = "qcom,rpmh-rsc", }, { } }; +MODULE_DEVICE_TABLE (of, rpmh_drv_match); +static struct platform_driver rpmh_driver = { .probe = rpmh_rsc_probe,
@@ -693,3 +696,6 @@ static int __init rpmh_driver_init(void)return platform_driver_register (&rpmh_driver); }arch_initcall (rpmh_driver_init); + +MODULE_DESCRIPTION ("Qualcomm Technologies, Inc. RPMh Driver" ); +MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.17.1
Re: [PATCH v3 2/3] soc: qcom: rpmh: Allow RPMH driver to be loaded as a module
Quoted 14 lines · John Stultz
This patch allow the rpmh driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded.
Ideally, it would include a remove hook and related logic, but the rpmh driver is fairly core to the system, so once its loaded with almost anythign else to get the system to go, the dependencies are not likely to ever also be removed.
So making it a permenent module at least improves things slightly over requiring it to be a built in driver.
Feedback would be appreciated!
Quoted 7 lines
Cc Todd Kjos <[email protected]>Cc Saravana Kannan <[email protected]>Cc Andy Gross <[email protected]>Cc Bjorn Andersson <[email protected]>Cc Rajendra Nayak <[email protected]>Signed-off-by John Stultz <[email protected]>
and applied.
Regards,
Bjorn
Quoted 49 lines
--- drivers/soc/qcom/Kconfig | 2 +- drivers/soc/qcom/rpmh-rsc.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)drivers/soc/qcom/Kconfig +1
-1@@ -104,7 +104,7 @@ config QCOM_RMTFS_MEM Say y here if you intend to boot the modem remoteproc. config QCOM_RPMH - bool "Qualcomm RPM-Hardened (RPMH) Communication" + tristate "Qualcomm RPM-Hardened (RPMH) Communication" depends on ARCH_QCOM && ARM64 || COMPILE_TEST help Support for communication with the hardened-RPM blocks indrivers/soc/qcom/rpmh-rsc.c +6
-0@@ -11,6 +11,7 @@#include <linux/io.h> #include <linux/kernel.h> #include <linux/list.h> +#include <linux/module.h> #include <linux/of.h> #include <linux/of_irq.h> #include <linux/of_platform.h> @@ -679,6 +680,8 @@ static const struct of_device_id rpmh_drv_match[] = { { .compatible = "qcom,rpmh-rsc", }, { } }; +MODULE_DEVICE_TABLE (of, rpmh_drv_match); +static struct platform_driver rpmh_driver = { .probe = rpmh_rsc_probe,@@ -693,3 +696,6 @@ static int __init rpmh_driver_init(void)return platform_driver_register (&rpmh_driver); }arch_initcall (rpmh_driver_init); + +MODULE_DESCRIPTION ("Qualcomm Technologies, Inc. RPMh Driver" ); +MODULE_LICENSE ("GPL v2" );Signature · 1 line
2.17.1
Re: [PATCH v3 2/3] soc: qcom: rpmh: Allow RPMH driver to be loaded as a module
In reply to John StultzHi John,
with commit efde2659b0fe ("drivers: qcom: rpmh-rsc: Use rcuidle tracepoints for rpmh") the rpmh-rsc driver fails to build as a module:
drivers/soc/qcom/rpmh-rsc.c:281:3: error: implicit declaration of function 'trace_rpmh_send_msg_rcuidle' [-Werror,-Wimplicit-function-decr]
trace_rpmh_send_msg_rcuidle(drv, tcs_id, j, msgid, cmd);
The problem is that the _rcuidle() functions are not generated for modules:
#ifndef MODULE
#define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) \
static inline void trace_##name##_rcuidle(proto) \
{ \
if (static_key_false(&__tracepoint_##name.key)) \
__DO_TRACE(&__tracepoint_##name, \
TP_PROTO(data_proto), \
TP_ARGS(data_args), \
TP_CONDITION(cond), 1); \
}#else
#define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) #endif
Not sure what the best solution would be in this case. Having the macro define a dummy function for modules would fix the build error, however it would be confusing that the event is traced when the driver is built-in, but not when it is built as a module.
I imagine the goal behind making this driver a module is to have a single kernel image for multiple SoC platforms, without too much platform specific code in the kernel image itself.
I guess the question is whether there any options for keeping the driver modular and having consistent tracing behavior, short of removing the tracepoint.
Quoted 70 lines · John Stultz
This patch allow the rpmh driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded.
Ideally, it would include a remove hook and related logic, but the rpmh driver is fairly core to the system, so once its loaded with almost anythign else to get the system to go, the dependencies are not likely to ever also be removed.
So making it a permenent module at least improves things slightly over requiring it to be a built in driver.
Feedback would be appreciated!
Cc Todd Kjos <[email protected]>Cc Saravana Kannan <[email protected]>Cc Andy Gross <[email protected]>Cc Bjorn Andersson <[email protected]>Cc Rajendra Nayak <[email protected]>Signed-off-by John Stultz <[email protected]>--- drivers/soc/qcom/Kconfig | 2 +- drivers/soc/qcom/rpmh-rsc.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)drivers/soc/qcom/Kconfig +1
-1@@ -104,7 +104,7 @@ config QCOM_RMTFS_MEM Say y here if you intend to boot the modem remoteproc. config QCOM_RPMH - bool "Qualcomm RPM-Hardened (RPMH) Communication" + tristate "Qualcomm RPM-Hardened (RPMH) Communication" depends on ARCH_QCOM && ARM64 || COMPILE_TEST help Support for communication with the hardened-RPM blocks indrivers/soc/qcom/rpmh-rsc.c +6
-0@@ -11,6 +11,7 @@#include <linux/io.h> #include <linux/kernel.h> #include <linux/list.h> +#include <linux/module.h> #include <linux/of.h> #include <linux/of_irq.h> #include <linux/of_platform.h> @@ -679,6 +680,8 @@ static const struct of_device_id rpmh_drv_match[] = { { .compatible = "qcom,rpmh-rsc", }, { } }; +MODULE_DEVICE_TABLE (of, rpmh_drv_match); +static struct platform_driver rpmh_driver = { .probe = rpmh_rsc_probe,@@ -693,3 +696,6 @@ static int __init rpmh_driver_init(void)return platform_driver_register (&rpmh_driver); }arch_initcall (rpmh_driver_init); + +MODULE_DESCRIPTION ("Qualcomm Technologies, Inc. RPMh Driver" ); +MODULE_LICENSE ("GPL v2" );Signature · 1 line
2.17.1
Re: [PATCH v3 2/3] soc: qcom: rpmh: Allow RPMH driver to be loaded as a module
Quoted 32 lines · Matthias Kaehlcke
Hi John,
with commit
efde2659b0fe("drivers: qcom: rpmh-rsc: Use rcuidle tracepoints for rpmh") the rpmh-rsc driver fails to build as a module:
drivers/soc/qcom/rpmh-rsc.c:281:3: error: implicit declaration of function 'trace_rpmh_send_msg_rcuidle' [-Werror,-Wimplicit-function-decr]trace_rpmh_send_msg_rcuidle(drv, tcs_id, j, msgid, cmd);The problem is that the
_rcuidle()functions are not generated for modules:#ifndef MODULE
#define __DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args) \ static inline void trace_##name##_rcuidle(proto) \ { \ if (static_key_false(&__tracepoint_##name.key)) \ __DO_TRACE(&__tracepoint_##name, \ TP_PROTO(data_proto), \ TP_ARGS(data_args), \ TP_CONDITION(cond), 1); \ }#else
#define__DECLARE_TRACE_RCU(name, proto, args, cond, data_proto, data_args)#endifNot sure what the best solution would be in this case. Having the macro define a dummy function for modules would fix the build error, however it would be confusing that the event is traced when the driver is built-in, but not when it is built as a module.
Quoted 7 lines
I imagine the goal behind making this driver a module is to have a single kernel image for multiple SoC platforms, without too much platform specific code in the kernel image itself.
I guess the question is whether there any options for keeping the driver modular and having consistent tracing behavior, short of removing the tracepoint.
Yea. Stephen found that issue in -next last night once Bjorn added the patches to his tree yesterday.
I've reached out to see if the restrictions on the trace_*_rcuidle calls on modules is still necessary in this thread:
https://lore.kernel.org/lkml/CALAqxLV4rM74wuzuZ+BkUi+keccxkAxv30N4vrFO7CVQ5vnT1A@mail.gmail.com/
For now, I suggested Bjorn revert the patch in his tree, and I'll try to figure out an alternative solution to the trace call.
thanks
-john
PATCH v3 3/3 soc: qcom: rpmhpd: Allow RPMHPD driver to be loaded as a module
In reply to John StultzThis patch allow the rpmhpd driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded.
Ideally, it would include a remove hook and related logic, but apparently the genpd code isn't able to track usage and cleaning things up?
So making it a permenent module at least improves things slightly over requiring it to be a built in driver.
Feedback would be appreciated!
--- drivers/soc/qcom/Kconfig | 2 +- drivers/soc/qcom/rpmhpd.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/soc/qcom/Kconfig +1 -1
@@ -114,7 +114,7 @@ config QCOM_RPMH help apply the aggregated state on the resource. config QCOM_RPMHPD - bool "Qualcomm RPMh Power domain driver" + tristate "Qualcomm RPMh Power domain driver" depends on QCOM_RPMH && QCOM_COMMAND_DB help QCOM RPMh Power domain driver to support power-domains with
drivers/soc/qcom/rpmhpd.c +5 -0
@@ -4,6 +4,7 @@#include <linux/err.h> #include <linux/init.h> #include <linux/kernel.h> +#include <linux/module.h> #include <linux/mutex.h> #include <linux/pm_domain.h> #include <linux/slab.h>
@@ -189,6 +190,7 @@ static const struct of_device_id rpmhpd_match_table[] = { { .compatible = "qcom,sm8150-rpmhpd", .data = &sm8150_desc }, { } }; +MODULE_DEVICE_TABLE (of, rpmhpd_match_table);static int rpmhpd_send_corner (struct rpmhpd *pd,int state,unsigned int corner,bool sync)
@@ -460,3 +462,6 @@ static int __init rpmhpd_init(void)return platform_driver_register (&rpmhpd_driver); }core_initcall (rpmhpd_init); + +MODULE_DESCRIPTION ("Qualcomm Technologies, Inc. RPMh Power Domain Driver" ); +MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.17.1
Re: [PATCH v3 3/3] soc: qcom: rpmhpd: Allow RPMHPD driver to be loaded as a module
Quoted 13 lines · John Stultz
This patch allow the rpmhpd driver to be loaded as a permenent module. Meaning it can be loaded from a module, but then cannot be unloaded.
Ideally, it would include a remove hook and related logic, but apparently the genpd code isn't able to track usage and cleaning things up?
So making it a permenent module at least improves things slightly over requiring it to be a built in driver.
Feedback would be appreciated!
Quoted 7 lines
Cc Todd Kjos <[email protected]>Cc Saravana Kannan <[email protected]>Cc Andy Gross <[email protected]>Cc Bjorn Andersson <[email protected]>Cc Rajendra Nayak <[email protected]>Signed-off-by John Stultz <[email protected]>
and applied.
Regards,
Bjorn
Quoted 48 lines
--- drivers/soc/qcom/Kconfig | 2 +- drivers/soc/qcom/rpmhpd.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-)drivers/soc/qcom/Kconfig +1
-1@@ -114,7 +114,7 @@ config QCOM_RPMH help apply the aggregated state on the resource. config QCOM_RPMHPD - bool "Qualcomm RPMh Power domain driver" + tristate "Qualcomm RPMh Power domain driver" depends on QCOM_RPMH && QCOM_COMMAND_DB help QCOM RPMh Power domain driver to support power-domains withdrivers/soc/qcom/rpmhpd.c +5
-0@@ -4,6 +4,7 @@#include <linux/err.h> #include <linux/init.h> #include <linux/kernel.h> +#include <linux/module.h> #include <linux/mutex.h> #include <linux/pm_domain.h> #include <linux/slab.h> @@ -189,6 +190,7 @@ static const struct of_device_id rpmhpd_match_table[] = { { .compatible = "qcom,sm8150-rpmhpd", .data = &sm8150_desc }, { } }; +MODULE_DEVICE_TABLE (of, rpmhpd_match_table);static int rpmhpd_send_corner (struct rpmhpd *pd,int state,unsigned int corner,bool sync)@@ -460,3 +462,6 @@ static int __init rpmhpd_init(void)return platform_driver_register (&rpmhpd_driver); }core_initcall (rpmhpd_init); + +MODULE_DESCRIPTION ("Qualcomm Technologies, Inc. RPMh Power Domain Driver" ); +MODULE_LICENSE ("GPL v2" );Signature · 1 line
2.17.1
Quoted 29 lines · John Stultz
This series simply allows the qcom rpmpd, rpmh and rpmhpd drivers to be configured and loaded as permement modules.
This means the modules can be loaded, but not unloaded.
While maybe not ideal, this is an improvement over requiring the drivers to be built in.
Feedback on this series would be welcome!
thanks
-johnNew in v3:
* Added similar change to rpmh and rpmhpd drivers.Cc Todd Kjos <[email protected]>Cc Saravana Kannan <[email protected]>Cc Andy Gross <[email protected]>Cc Bjorn Andersson <[email protected]>Cc Rajendra Nayak <[email protected]>John Stultz (3):
soc: qcom: rpmpd: Allow RPMPD driver to be loaded as a module
soc: qcom: rpmh: Allow RPMH driver to be loaded as a module
soc: qcom: rpmhpd: Allow RPMHPD driver to be loaded as a module
Quoted 5 lines
drivers/soc/qcom/Kconfig | 8 ++++---- drivers/soc/qcom/rpmh-rsc.c | 6 ++++++ drivers/soc/qcom/rpmhpd.c | 5 +++++ drivers/soc/qcom/rpmpd.c | 6 ++++++ 4 files changed, 21 insertions(+), 4 deletions(-)
The whole series looks ok to me.
for the whole series.
-Saravana