linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mailbox: qcom: Support building QCOM IPCC driver as module
@ 2020-10-21  2:15 Huang Yiwei
  2020-10-21  5:59 ` Manivannan Sadhasivam
  0 siblings, 1 reply; 3+ messages in thread
From: Huang Yiwei @ 2020-10-21  2:15 UTC (permalink / raw)
  To: jassisinghbrar, agross, bjorn.andersson
  Cc: Huang Yiwei, linux-kernel, linux-arm-msm

Change CONFIG_QCOM_IPCC to tristate and add exit function to
support module build for QCOM IPCC driver.

Signed-off-by: Huang Yiwei <hyiwei@codeaurora.org>
---
 drivers/mailbox/Kconfig     | 2 +-
 drivers/mailbox/qcom-ipcc.c | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
index 05b1009..78f3006 100644
--- a/drivers/mailbox/Kconfig
+++ b/drivers/mailbox/Kconfig
@@ -245,7 +245,7 @@ config SPRD_MBOX
 	  you want to build the Spreatrum mailbox controller driver.
 
 config QCOM_IPCC
-	bool "Qualcomm Technologies, Inc. IPCC driver"
+	tristate "Qualcomm Technologies, Inc. IPCC driver"
 	depends on ARCH_QCOM || COMPILE_TEST
 	help
 	  Qualcomm Technologies, Inc. Inter-Processor Communication Controller
diff --git a/drivers/mailbox/qcom-ipcc.c b/drivers/mailbox/qcom-ipcc.c
index 2d13c72..1ed9a87 100644
--- a/drivers/mailbox/qcom-ipcc.c
+++ b/drivers/mailbox/qcom-ipcc.c
@@ -280,6 +280,12 @@ static int __init qcom_ipcc_init(void)
 }
 arch_initcall(qcom_ipcc_init);
 
+static __exit void qcom_ipcc_exit(void)
+{
+	platform_driver_unregister(&qcom_ipcc_driver);
+}
+module_exit(qcom_ipcc_exit);
+
 MODULE_AUTHOR("Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>");
 MODULE_AUTHOR("Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>");
 MODULE_DESCRIPTION("Qualcomm Technologies, Inc. IPCC driver");
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


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

* Re: [PATCH] mailbox: qcom: Support building QCOM IPCC driver as module
  2020-10-21  2:15 [PATCH] mailbox: qcom: Support building QCOM IPCC driver as module Huang Yiwei
@ 2020-10-21  5:59 ` Manivannan Sadhasivam
  2020-10-23  8:41   ` hyiwei
  0 siblings, 1 reply; 3+ messages in thread
From: Manivannan Sadhasivam @ 2020-10-21  5:59 UTC (permalink / raw)
  To: Huang Yiwei
  Cc: jassisinghbrar, agross, bjorn.andersson, linux-kernel, linux-arm-msm

Hi,

Please CC the driver maintainer(s) for relevant patches. For this driver,
I've been listed as the maintainer in the MAINTAINERS file.

On Wed, Oct 21, 2020 at 10:15:52AM +0800, Huang Yiwei wrote:
> Change CONFIG_QCOM_IPCC to tristate and add exit function to
> support module build for QCOM IPCC driver.
> 

This is not going to work, sorry! There was a reason to make this driver
built-in in the first place. This driver registers itself as an irqchip and
provides interrupts to be consumed by the client drivers. So if we want to
unload the driver, then we should make sure to dispose all irqs consumed by
the client drivers and that's not possible currently. If you look into other
irqchip drivers, they're all made as built-in.

Thanks,
Mani

> Signed-off-by: Huang Yiwei <hyiwei@codeaurora.org>
> ---
>  drivers/mailbox/Kconfig     | 2 +-
>  drivers/mailbox/qcom-ipcc.c | 6 ++++++
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
> index 05b1009..78f3006 100644
> --- a/drivers/mailbox/Kconfig
> +++ b/drivers/mailbox/Kconfig
> @@ -245,7 +245,7 @@ config SPRD_MBOX
>  	  you want to build the Spreatrum mailbox controller driver.
>  
>  config QCOM_IPCC
> -	bool "Qualcomm Technologies, Inc. IPCC driver"
> +	tristate "Qualcomm Technologies, Inc. IPCC driver"
>  	depends on ARCH_QCOM || COMPILE_TEST
>  	help
>  	  Qualcomm Technologies, Inc. Inter-Processor Communication Controller
> diff --git a/drivers/mailbox/qcom-ipcc.c b/drivers/mailbox/qcom-ipcc.c
> index 2d13c72..1ed9a87 100644
> --- a/drivers/mailbox/qcom-ipcc.c
> +++ b/drivers/mailbox/qcom-ipcc.c
> @@ -280,6 +280,12 @@ static int __init qcom_ipcc_init(void)
>  }
>  arch_initcall(qcom_ipcc_init);
>  
> +static __exit void qcom_ipcc_exit(void)
> +{
> +	platform_driver_unregister(&qcom_ipcc_driver);
> +}
> +module_exit(qcom_ipcc_exit);
> +
>  MODULE_AUTHOR("Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>");
>  MODULE_AUTHOR("Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>");
>  MODULE_DESCRIPTION("Qualcomm Technologies, Inc. IPCC driver");
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

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

* Re: [PATCH] mailbox: qcom: Support building QCOM IPCC driver as module
  2020-10-21  5:59 ` Manivannan Sadhasivam
@ 2020-10-23  8:41   ` hyiwei
  0 siblings, 0 replies; 3+ messages in thread
From: hyiwei @ 2020-10-23  8:41 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: jassisinghbrar, agross, bjorn.andersson, psodagud, linux-kernel,
	linux-arm-msm

On 2020-10-21 13:59, Manivannan Sadhasivam wrote:
> Hi,
> 
> Please CC the driver maintainer(s) for relevant patches. For this 
> driver,
> I've been listed as the maintainer in the MAINTAINERS file.
> 
> On Wed, Oct 21, 2020 at 10:15:52AM +0800, Huang Yiwei wrote:
>> Change CONFIG_QCOM_IPCC to tristate and add exit function to
>> support module build for QCOM IPCC driver.
>> 
> 
> This is not going to work, sorry! There was a reason to make this 
> driver
> built-in in the first place. This driver registers itself as an irqchip 
> and
> provides interrupts to be consumed by the client drivers. So if we want 
> to
> unload the driver, then we should make sure to dispose all irqs 
> consumed by
> the client drivers and that's not possible currently. If you look into 
> other
> irqchip drivers, they're all made as built-in.
> 
> Thanks,
> Mani
> 
Hi,

We need the module build of IPCC to meet the need of Android GKI, which
requires all vendor drivers to be modules.
After discussion, we think there are three ways to achieve the goal:
1. Remove the exit function, just change the Kconfig to make it a module
cannot be unloaded.
2. Add more checks to ensure the module can be unloaded safely. If user
try to unload when it is in use, return busy.
3. If unable to change the Kconfig, we will have to ask google to make
this driver built-in. This can be difficult because other vendors don't
need this driver.
We understood that mostly irqchip driver is builtin and not easy for
unload. So we prefer the first way, that's the easiest and most 
reasonable
way.

Thanks,
Yiwei

>> Signed-off-by: Huang Yiwei <hyiwei@codeaurora.org>
>> ---
>>  drivers/mailbox/Kconfig     | 2 +-
>>  drivers/mailbox/qcom-ipcc.c | 6 ++++++
>>  2 files changed, 7 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
>> index 05b1009..78f3006 100644
>> --- a/drivers/mailbox/Kconfig
>> +++ b/drivers/mailbox/Kconfig
>> @@ -245,7 +245,7 @@ config SPRD_MBOX
>>  	  you want to build the Spreatrum mailbox controller driver.
>> 
>>  config QCOM_IPCC
>> -	bool "Qualcomm Technologies, Inc. IPCC driver"
>> +	tristate "Qualcomm Technologies, Inc. IPCC driver"
>>  	depends on ARCH_QCOM || COMPILE_TEST
>>  	help
>>  	  Qualcomm Technologies, Inc. Inter-Processor Communication 
>> Controller
>> diff --git a/drivers/mailbox/qcom-ipcc.c b/drivers/mailbox/qcom-ipcc.c
>> index 2d13c72..1ed9a87 100644
>> --- a/drivers/mailbox/qcom-ipcc.c
>> +++ b/drivers/mailbox/qcom-ipcc.c
>> @@ -280,6 +280,12 @@ static int __init qcom_ipcc_init(void)
>>  }
>>  arch_initcall(qcom_ipcc_init);
>> 
>> +static __exit void qcom_ipcc_exit(void)
>> +{
>> +	platform_driver_unregister(&qcom_ipcc_driver);
>> +}
>> +module_exit(qcom_ipcc_exit);
>> +
>>  MODULE_AUTHOR("Venkata Narendra Kumar Gutta 
>> <vnkgutta@codeaurora.org>");
>>  MODULE_AUTHOR("Manivannan Sadhasivam 
>> <manivannan.sadhasivam@linaro.org>");
>>  MODULE_DESCRIPTION("Qualcomm Technologies, Inc. IPCC driver");
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
>> Forum,
>> a Linux Foundation Collaborative Project
>> 

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

end of thread, other threads:[~2020-10-23  8:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-21  2:15 [PATCH] mailbox: qcom: Support building QCOM IPCC driver as module Huang Yiwei
2020-10-21  5:59 ` Manivannan Sadhasivam
2020-10-23  8:41   ` hyiwei

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).