All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: kryo: allow building as a loadable module
@ 2018-06-05 11:44 Arnd Bergmann
  2018-06-06  4:09 ` Viresh Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Arnd Bergmann @ 2018-06-05 11:44 UTC (permalink / raw)
  To: Rafael J. Wysocki, Viresh Kumar
  Cc: Arnd Bergmann, Ilia Lin, linux-pm, linux-kernel

Building the kryo cpufreq driver while QCOM_SMEM is a loadable module
results in a link error:

drivers/cpufreq/qcom-cpufreq-kryo.o: In function `qcom_cpufreq_kryo_probe':
qcom-cpufreq-kryo.c:(.text+0xbc): undefined reference to `qcom_smem_get'

The problem is that Kconfig ignores interprets the dependency as met
when the dependent symbol is a 'bool' one. By making it 'tristate',
it will be forced to be a module here, which builds successfully.

Fixes: 46e2856b8e18 ("cpufreq: Add Kryo CPU scaling driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/cpufreq/Kconfig.arm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
index c7ce928fbf1f..52f5f1a2040c 100644
--- a/drivers/cpufreq/Kconfig.arm
+++ b/drivers/cpufreq/Kconfig.arm
@@ -125,7 +125,7 @@ config ARM_OMAP2PLUS_CPUFREQ
 	default ARCH_OMAP2PLUS
 
 config ARM_QCOM_CPUFREQ_KRYO
-	bool "Qualcomm Kryo based CPUFreq"
+	tristate "Qualcomm Kryo based CPUFreq"
 	depends on ARM64
 	depends on QCOM_QFPROM
 	depends on QCOM_SMEM
-- 
2.9.0

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

* Re: [PATCH] cpufreq: kryo: allow building as a loadable module
  2018-06-05 11:44 [PATCH] cpufreq: kryo: allow building as a loadable module Arnd Bergmann
@ 2018-06-06  4:09 ` Viresh Kumar
  2018-06-06  4:44   ` Ilia Lin
  2018-06-12 15:02   ` Rafael J. Wysocki
  0 siblings, 2 replies; 4+ messages in thread
From: Viresh Kumar @ 2018-06-06  4:09 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Rafael J. Wysocki, Ilia Lin, linux-pm, linux-kernel

On 05-06-18, 13:44, Arnd Bergmann wrote:
> Building the kryo cpufreq driver while QCOM_SMEM is a loadable module
> results in a link error:
> 
> drivers/cpufreq/qcom-cpufreq-kryo.o: In function `qcom_cpufreq_kryo_probe':
> qcom-cpufreq-kryo.c:(.text+0xbc): undefined reference to `qcom_smem_get'
> 
> The problem is that Kconfig ignores interprets the dependency as met
> when the dependent symbol is a 'bool' one. By making it 'tristate',
> it will be forced to be a module here, which builds successfully.
> 
> Fixes: 46e2856b8e18 ("cpufreq: Add Kryo CPU scaling driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/cpufreq/Kconfig.arm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> index c7ce928fbf1f..52f5f1a2040c 100644
> --- a/drivers/cpufreq/Kconfig.arm
> +++ b/drivers/cpufreq/Kconfig.arm
> @@ -125,7 +125,7 @@ config ARM_OMAP2PLUS_CPUFREQ
>  	default ARCH_OMAP2PLUS
>  
>  config ARM_QCOM_CPUFREQ_KRYO
> -	bool "Qualcomm Kryo based CPUFreq"
> +	tristate "Qualcomm Kryo based CPUFreq"
>  	depends on ARM64
>  	depends on QCOM_QFPROM
>  	depends on QCOM_SMEM

Okay, so we really need this to be a module. But the driver can't really work as
a module right now if we do this: insmod, rmmod, insmod. Because it doesn't free
resources at rmmmod and will fail on second insmod.

Because what you are fixing is a critical build error, we better get it merged
right now.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

But Ilia needs to cook another patch to add the module removal code for the
driver and mark your patch's commit id in the fixes tag.

-- 
viresh

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

* Re: [PATCH] cpufreq: kryo: allow building as a loadable module
  2018-06-06  4:09 ` Viresh Kumar
@ 2018-06-06  4:44   ` Ilia Lin
  2018-06-12 15:02   ` Rafael J. Wysocki
  1 sibling, 0 replies; 4+ messages in thread
From: Ilia Lin @ 2018-06-06  4:44 UTC (permalink / raw)
  To: Viresh Kumar, Arnd Bergmann; +Cc: Rafael J. Wysocki, linux-pm, linux-kernel

Viresh got ahead of my answer a bit. :)
Sure I'll post the module exit later.

On June 6, 2018 7:09:29 AM GMT+03:00, Viresh Kumar <viresh.kumar@linaro.org> wrote:
>On 05-06-18, 13:44, Arnd Bergmann wrote:
>> Building the kryo cpufreq driver while QCOM_SMEM is a loadable module
>> results in a link error:
>> 
>> drivers/cpufreq/qcom-cpufreq-kryo.o: In function
>`qcom_cpufreq_kryo_probe':
>> qcom-cpufreq-kryo.c:(.text+0xbc): undefined reference to
>`qcom_smem_get'
>> 
>> The problem is that Kconfig ignores interprets the dependency as met
>> when the dependent symbol is a 'bool' one. By making it 'tristate',
>> it will be forced to be a module here, which builds successfully.
>> 
>> Fixes: 46e2856b8e18 ("cpufreq: Add Kryo CPU scaling driver")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>>  drivers/cpufreq/Kconfig.arm | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/drivers/cpufreq/Kconfig.arm
>b/drivers/cpufreq/Kconfig.arm
>> index c7ce928fbf1f..52f5f1a2040c 100644
>> --- a/drivers/cpufreq/Kconfig.arm
>> +++ b/drivers/cpufreq/Kconfig.arm
>> @@ -125,7 +125,7 @@ config ARM_OMAP2PLUS_CPUFREQ
>>  	default ARCH_OMAP2PLUS
>>  
>>  config ARM_QCOM_CPUFREQ_KRYO
>> -	bool "Qualcomm Kryo based CPUFreq"
>> +	tristate "Qualcomm Kryo based CPUFreq"
>>  	depends on ARM64
>>  	depends on QCOM_QFPROM
>>  	depends on QCOM_SMEM
>
>Okay, so we really need this to be a module. But the driver can't
>really work as
>a module right now if we do this: insmod, rmmod, insmod. Because it
>doesn't free
>resources at rmmmod and will fail on second insmod.
>
>Because what you are fixing is a critical build error, we better get it
>merged
>right now.
>
>Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
>
>But Ilia needs to cook another patch to add the module removal code for
>the
>driver and mark your patch's commit id in the fixes tag.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

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

* Re: [PATCH] cpufreq: kryo: allow building as a loadable module
  2018-06-06  4:09 ` Viresh Kumar
  2018-06-06  4:44   ` Ilia Lin
@ 2018-06-12 15:02   ` Rafael J. Wysocki
  1 sibling, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2018-06-12 15:02 UTC (permalink / raw)
  To: Viresh Kumar, Arnd Bergmann; +Cc: Ilia Lin, linux-pm, linux-kernel

On Wednesday, June 6, 2018 6:09:29 AM CEST Viresh Kumar wrote:
> On 05-06-18, 13:44, Arnd Bergmann wrote:
> > Building the kryo cpufreq driver while QCOM_SMEM is a loadable module
> > results in a link error:
> > 
> > drivers/cpufreq/qcom-cpufreq-kryo.o: In function `qcom_cpufreq_kryo_probe':
> > qcom-cpufreq-kryo.c:(.text+0xbc): undefined reference to `qcom_smem_get'
> > 
> > The problem is that Kconfig ignores interprets the dependency as met
> > when the dependent symbol is a 'bool' one. By making it 'tristate',
> > it will be forced to be a module here, which builds successfully.
> > 
> > Fixes: 46e2856b8e18 ("cpufreq: Add Kryo CPU scaling driver")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> >  drivers/cpufreq/Kconfig.arm | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/cpufreq/Kconfig.arm b/drivers/cpufreq/Kconfig.arm
> > index c7ce928fbf1f..52f5f1a2040c 100644
> > --- a/drivers/cpufreq/Kconfig.arm
> > +++ b/drivers/cpufreq/Kconfig.arm
> > @@ -125,7 +125,7 @@ config ARM_OMAP2PLUS_CPUFREQ
> >  	default ARCH_OMAP2PLUS
> >  
> >  config ARM_QCOM_CPUFREQ_KRYO
> > -	bool "Qualcomm Kryo based CPUFreq"
> > +	tristate "Qualcomm Kryo based CPUFreq"
> >  	depends on ARM64
> >  	depends on QCOM_QFPROM
> >  	depends on QCOM_SMEM
> 
> Okay, so we really need this to be a module. But the driver can't really work as
> a module right now if we do this: insmod, rmmod, insmod. Because it doesn't free
> resources at rmmmod and will fail on second insmod.
> 
> Because what you are fixing is a critical build error, we better get it merged
> right now.
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Patch applied, thanks!


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

end of thread, other threads:[~2018-06-12 15:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-05 11:44 [PATCH] cpufreq: kryo: allow building as a loadable module Arnd Bergmann
2018-06-06  4:09 ` Viresh Kumar
2018-06-06  4:44   ` Ilia Lin
2018-06-12 15:02   ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.