diff mbox

cpufreq: do not mark s3c2410_plls_add as __init

Message ID 564A899C.4040402@samsung.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Krzysztof Kozlowski Nov. 17, 2015, 1:57 a.m. UTC
On 17.11.2015 07:17, Arnd Bergmann wrote:
> On Monday 16 November 2015 23:36:42 Rafael J. Wysocki wrote:
>>
>> This should go in through the Samsung tree, so I'll leave it for them to pick
>> it up (at least for the time being).
> 
> Ok, fair enough. Kukjin or Krzysztof, can you pick this up?

Sure.

As for the patch I think everything can be converted to init/initdata
(as in attachment).

Best regards,
Krzysztof

Comments

Arnd Bergmann Nov. 17, 2015, 9:01 a.m. UTC | #1
On Tuesday 17 November 2015 10:57:48 Krzysztof Kozlowski wrote:
> On 17.11.2015 07:17, Arnd Bergmann wrote:
> > On Monday 16 November 2015 23:36:42 Rafael J. Wysocki wrote:
> >>
> >> This should go in through the Samsung tree, so I'll leave it for them to pick
> >> it up (at least for the time being).
> > 
> > Ok, fair enough. Kukjin or Krzysztof, can you pick this up?
> 
> Sure.
> 
> As for the patch I think everything can be converted to init/initdata
> (as in attachment).
> 

I don't think so:

static struct subsys_interface s3c2442_plls169344_interface __initdata = {
        .name           = "s3c2442_plls169344",
        .subsys         = &s3c2442_subsys,
        .add_dev        = s3c2440_plls169344_add,
};

This gets passed into subsys_interface_register(), which is not __init
in turn. subsys_interface_register() then goes on to add
s3c2442_plls169344_interface into a linked list that is traversed
at runtime, but the __initdata section gets discarded so you now
have a broken list.

	Arnd

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Krzysztof Kozlowski Nov. 18, 2015, 12:44 a.m. UTC | #2
On 17.11.2015 18:01, Arnd Bergmann wrote:
> On Tuesday 17 November 2015 10:57:48 Krzysztof Kozlowski wrote:
>> On 17.11.2015 07:17, Arnd Bergmann wrote:
>>> On Monday 16 November 2015 23:36:42 Rafael J. Wysocki wrote:
>>>>
>>>> This should go in through the Samsung tree, so I'll leave it for them to pick
>>>> it up (at least for the time being).
>>>
>>> Ok, fair enough. Kukjin or Krzysztof, can you pick this up?
>>
>> Sure.
>>
>> As for the patch I think everything can be converted to init/initdata
>> (as in attachment).
>>
> 
> I don't think so:
> 
> static struct subsys_interface s3c2442_plls169344_interface __initdata = {
>         .name           = "s3c2442_plls169344",
>         .subsys         = &s3c2442_subsys,
>         .add_dev        = s3c2440_plls169344_add,
> };
> 
> This gets passed into subsys_interface_register(), which is not __init
> in turn. subsys_interface_register() then goes on to add
> s3c2442_plls169344_interface into a linked list that is traversed
> at runtime, but the __initdata section gets discarded so you now
> have a broken list.

Ah, yes, so the patch is fine:

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/arm/mach-s3c24xx/pll-s3c2410.c b/arch/arm/mach-s3c24xx/pll-s3c2410.c
index 5e37d368594b..d9fd5319379b 100644
--- a/arch/arm/mach-s3c24xx/pll-s3c2410.c
+++ b/arch/arm/mach-s3c24xx/pll-s3c2410.c
@@ -65,12 +65,12 @@  static struct cpufreq_frequency_table pll_vals_12MHz[] = {
     { .frequency = 270000000, .driver_data = PLLVAL(127, 1, 1),  },
 };
 
-static int s3c2410_plls_add(struct device *dev, struct subsys_interface *sif)
+static int __init s3c2410_plls_add(struct device *dev, struct subsys_interface *sif)
 {
 	return s3c_plltab_register(pll_vals_12MHz, ARRAY_SIZE(pll_vals_12MHz));
 }
 
-static struct subsys_interface s3c2410_plls_interface = {
+static struct subsys_interface s3c2410_plls_interface __initdata = {
 	.name		= "s3c2410_plls",
 	.subsys		= &s3c2410_subsys,
 	.add_dev	= s3c2410_plls_add,
@@ -83,7 +83,7 @@  static int __init s3c2410_pll_init(void)
 }
 arch_initcall(s3c2410_pll_init);
 
-static struct subsys_interface s3c2410a_plls_interface = {
+static struct subsys_interface s3c2410a_plls_interface __initdata = {
 	.name		= "s3c2410a_plls",
 	.subsys		= &s3c2410a_subsys,
 	.add_dev	= s3c2410_plls_add,
diff --git a/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c b/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c
index a19460e6e7b0..01958230cf2f 100644
--- a/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c
+++ b/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c
@@ -50,7 +50,7 @@  static struct cpufreq_frequency_table s3c2440_plls_12[] __initdata = {
 	{ .frequency = 400000000,	.driver_data = PLLVAL(0x5c, 1, 1),  }, 	/* FVco 800.000000 */
 };
 
-static int s3c2440_plls12_add(struct device *dev, struct subsys_interface *sif)
+static int __init s3c2440_plls12_add(struct device *dev, struct subsys_interface *sif)
 {
 	struct clk *xtal_clk;
 	unsigned long xtal;
@@ -71,7 +71,7 @@  static int s3c2440_plls12_add(struct device *dev, struct subsys_interface *sif)
 	return 0;
 }
 
-static struct subsys_interface s3c2440_plls12_interface = {
+static struct subsys_interface s3c2440_plls12_interface __initdata = {
 	.name		= "s3c2440_plls12",
 	.subsys		= &s3c2440_subsys,
 	.add_dev	= s3c2440_plls12_add,
@@ -84,7 +84,7 @@  static int __init s3c2440_pll_12mhz(void)
 }
 arch_initcall(s3c2440_pll_12mhz);
 
-static struct subsys_interface s3c2442_plls12_interface = {
+static struct subsys_interface s3c2442_plls12_interface __initdata = {
 	.name		= "s3c2442_plls12",
 	.subsys		= &s3c2442_subsys,
 	.add_dev	= s3c2440_plls12_add,
diff --git a/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c b/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c
index 1191b2905625..db9f476ab581 100644
--- a/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c
+++ b/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c
@@ -78,7 +78,7 @@  static struct cpufreq_frequency_table s3c2440_plls_169344[] __initdata = {
 	{ .frequency = 402192000,	.driver_data = PLLVAL(87, 2, 1), 	}, 	/* FVco 804.384000 */
 };
 
-static int s3c2440_plls169344_add(struct device *dev,
+static int __init s3c2440_plls169344_add(struct device *dev,
 				  struct subsys_interface *sif)
 {
 	struct clk *xtal_clk;
@@ -100,7 +100,7 @@  static int s3c2440_plls169344_add(struct device *dev,
 	return 0;
 }
 
-static struct subsys_interface s3c2440_plls169344_interface = {
+static struct subsys_interface s3c2440_plls169344_interface __initdata  = {
 	.name		= "s3c2440_plls169344",
 	.subsys		= &s3c2440_subsys,
 	.add_dev	= s3c2440_plls169344_add,
@@ -112,7 +112,7 @@  static int __init s3c2440_pll_16934400(void)
 }
 arch_initcall(s3c2440_pll_16934400);
 
-static struct subsys_interface s3c2442_plls169344_interface = {
+static struct subsys_interface s3c2442_plls169344_interface __initdata = {
 	.name		= "s3c2442_plls169344",
 	.subsys		= &s3c2442_subsys,
 	.add_dev	= s3c2440_plls169344_add,