Skip to contentSkip to conversation

PM: OMAP: Fix build with CONFIG_OMAP_PM_NONE set

PATCH In review Roger Quadros 2 participants 4 messages Apr 7, 2009 – Apr 8, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM: OMAP: Fix build with CONFIG_OMAP_PM_NONE set

From: Roger Quadros <[email protected]>
Date: Tue, 7 Apr 2009 11:10:29 +0300
Subject: [PATCH] PM: OMAP: Fix build with CONFIG_OMAP_PM_NONE set

Removes undefined symbol link errors. Required symbols are defined in common.c and omap-pm.h

---
 arch/arm/plat-omap/common.c               |    6 ++++++
 arch/arm/plat-omap/include/mach/omap-pm.h |   15 +++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
arch/arm/plat-omap/common.c +6 -0
index 2866612..634ca39 100644
@@ -46,6 +46,12 @@ int omap_bootloader_tag_len;
 struct omap_board_config_kernel *omap_board_config;
 int omap_board_config_size;
 
+#ifdef CONFIG_OMAP_PM_NONE
+struct omap_opp *mpu_opps;
+struct omap_opp *dsp_opps;
+struct omap_opp *l3_opps;
+#endif
+
 #ifdef CONFIG_OMAP_BOOT_TAG
 
 static int __init parse_tag_omap(const struct tag *tag)
arch/arm/plat-omap/include/mach/omap-pm.h +15 -0
index f0bbd36..6a8499a 100644
@@ -58,9 +58,20 @@ extern struct omap_opp *l3_opps;
  * framework starts.  The "_if_" is to avoid name collisions with the
  * PM idle-loop code.
  */
+#ifdef CONFIG_OMAP_PM_NONE
+static inline int __init omap_pm_if_early_init(struct omap_opp *mpu_opp_table,
+				 struct omap_opp *dsp_opp_table,
+				 struct omap_opp *l3_opp_table) {
+	mpu_opps = 0;
+	dsp_opps = 0;
+	l3_opps = 0;
+	return 0;
+}
+#else
 int __init omap_pm_if_early_init(struct omap_opp *mpu_opp_table,
 				 struct omap_opp *dsp_opp_table,
 				 struct omap_opp *l3_opp_table);
+#endif
 
 /**
  * omap_pm_if_init - OMAP PM init code called after clock fw init
@@ -68,7 +79,11 @@ int __init omap_pm_if_early_init(struct omap_opp *mpu_opp_table,
  * The main initialization code.  OPP tables are passed in here.  The
  * "_if_" is to avoid name collisions with the PM idle-loop code.
  */
+#ifdef CONFIG_OMAP_PM_NONE
+static inline int __init omap_pm_if_init(void) { return 0; }
+#else
 int __init omap_pm_if_init(void);
+#endif
 
 /**
  * omap_pm_if_exit - OMAP PM exit code
Signature · 1 line
1.5.6.3
#1 lore raw

The patch fixes the following link errors

arch/arm/mach-omap2/built-in.o: In function `omap3_round_to_table_rate':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock34xx.c:956: undefined reference to mpu_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock34xx.c:956: undefined reference to dsp_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock34xx.c:956: undefined reference to l3_opps' arch/arm/mach-omap2/built-in.o: In function omap2_clk_init_cpufreq_table':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock34xx.c:719: undefined reference to mpu_opps' arch/arm/mach-omap2/built-in.o: In function omap3_select_table_rate':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock34xx.c:1020: undefined reference to mpu_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock34xx.c:1020: undefined reference to dsp_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock34xx.c:1020: undefined reference to l3_opps' arch/arm/mach-omap2/built-in.o: In function omap2_init_common_hw':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/io.c:241: undefined reference to omap_pm_if_early_init' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/io.c:246: undefined reference to omap_pm_if_init' arch/arm/mach-omap2/built-in.o: In function `omap2_clk_init':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock34xx.c:887: undefined reference to mpu_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock34xx.c:887: undefined reference to l3_opps'
make: *** [.tmp_vmlinux1] Error 1

Quoted 69 lines · ext Roger Quadros

From: Roger Quadros <[email protected]>
Date: Tue, 7 Apr 2009 11:10:29 +0300
Subject: [PATCH] PM: OMAP: Fix build with CONFIG_OMAP_PM_NONE set

Removes undefined symbol link errors. Required symbols are defined in common.c and omap-pm.h

---
 arch/arm/plat-omap/common.c               |    6 ++++++
 arch/arm/plat-omap/include/mach/omap-pm.h |   15 +++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
arch/arm/plat-omap/common.c +6 -0
index 2866612..634ca39 100644
@@ -46,6 +46,12 @@ int omap_bootloader_tag_len;
 struct omap_board_config_kernel *omap_board_config;
 int omap_board_config_size;
 
+#ifdef CONFIG_OMAP_PM_NONE
+struct omap_opp *mpu_opps;
+struct omap_opp *dsp_opps;
+struct omap_opp *l3_opps;
+#endif
+
 #ifdef CONFIG_OMAP_BOOT_TAG
 
 static int __init parse_tag_omap(const struct tag *tag)
arch/arm/plat-omap/include/mach/omap-pm.h +11 -0
index f0bbd36..6a8499a 100644
@@ -58,9 +58,20 @@ extern struct omap_opp *l3_opps;
  * framework starts.  The "_if_" is to avoid name collisions with the
  * PM idle-loop code.
  */
+#ifdef CONFIG_OMAP_PM_NONE
+static inline int __init omap_pm_if_early_init(struct omap_opp 
 *mpu_opp_table,
+                 struct omap_opp *dsp_opp_table,
+                 struct omap_opp *l3_opp_table) {
+    mpu_opps = 0;
+    dsp_opps = 0;
+    l3_opps = 0;
+    return 0;
+}
+#else
 int __init omap_pm_if_early_init(struct omap_opp *mpu_opp_table,
                  struct omap_opp *dsp_opp_table,
                  struct omap_opp *l3_opp_table);
+#endif
 
 /**

* omap_pm_if_init - OMAP PM init code called after clock fw init

arch/arm/plat-omap/include/mach/omap-pm.h +4 -0
@@ -68,7 +79,11 @@ int __init omap_pm_if_early_init(struct omap_opp 
 *mpu_opp_table,
  * The main initialization code.  OPP tables are passed in here.  The
  * "_if_" is to avoid name collisions with the PM idle-loop code.
  */
+#ifdef CONFIG_OMAP_PM_NONE
+static inline int __init omap_pm_if_init(void) { return 0; }
+#else
 int __init omap_pm_if_init(void);
+#endif
 
 /**

* omap_pm_if_exit - OMAP PM exit code

#2 lore raw
Quoted 104 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Roger Quadros
Sent: Tuesday, April 07, 2009 4:49 PM
To: ext Roger Quadros
Cc: Kevin Hilman; [email protected]
Subject: Re: [PATCH] PM: OMAP: Fix build with CONFIG_OMAP_PM_NONE set

The patch fixes the following link errors

arch/arm/mach-omap2/built-in.o: In function `omap3_round_to_table_rate':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:956:
undefined reference to `mpu_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:956:
undefined reference to `dsp_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:956:
undefined reference to l3_opps' arch/arm/mach-omap2/built-in.o: In function omap2_clk_init_cpufreq_table':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:719:
undefined reference to mpu_opps' arch/arm/mach-omap2/built-in.o: In function omap3_select_table_rate':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:1020:
undefined reference to `mpu_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:1020:
undefined reference to `dsp_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:1020:
undefined reference to l3_opps' arch/arm/mach-omap2/built-in.o: In function omap2_init_common_hw':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/io.c:
241: undefined
reference to `omap_pm_if_early_init' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/io.c:
246: undefined
reference to omap_pm_if_init' arch/arm/mach-omap2/built-in.o: In function omap2_clk_init':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:887:
undefined reference to `mpu_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:887:
undefined reference to `l3_opps'
make: *** [.tmp_vmlinux1] Error 1

Quoted 5 lines · ext Roger Quadros

From: Roger Quadros <[email protected]>
Date: Tue, 7 Apr 2009 11:10:29 +0300
Subject: [PATCH] PM: OMAP: Fix build with CONFIG_OMAP_PM_NONE set

Removes undefined symbol link errors. Required symbols are

defined in

Review

Quoted 9 lines

common.c and omap-pm.h

---
 arch/arm/plat-omap/common.c               |    6 ++++++
 arch/arm/plat-omap/include/mach/omap-pm.h |   15 +++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/plat-omap/common.c

Quoted 22 lines

index 2866612..634ca39 100644

arch/arm/plat-omap/common.c +6 -0
@@ -46,6 +46,12 @@ int omap_bootloader_tag_len;
 struct omap_board_config_kernel *omap_board_config;
 int omap_board_config_size;
 
+#ifdef CONFIG_OMAP_PM_NONE
+struct omap_opp *mpu_opps;
+struct omap_opp *dsp_opps;
+struct omap_opp *l3_opps;
+#endif
+
 #ifdef CONFIG_OMAP_BOOT_TAG
 
 static int __init parse_tag_omap(const struct tag *tag)
arch/arm/plat-omap/include/mach/omap-pm.h +0 -0
index f0bbd36..6a8499a 100644

arch/arm/plat-omap/include/mach/omap-pm.h extern struct omap_opp *l3_opps; · line 58

Quoted 1 line
arch/arm/plat-omap/include/mach/omap-pm.h +0 -0
@@ -58,9 +58,20 @@ extern struct omap_opp *l3_opps;
  * framework starts.  The "_if_" is to avoid name 

collisions with the

Quoted 10 lines
arch/arm/plat-omap/include/mach/omap-pm.h +7 -0
  * PM idle-loop code.
  */
+#ifdef CONFIG_OMAP_PM_NONE
+static inline int __init omap_pm_if_early_init(struct omap_opp 
 *mpu_opp_table,
+                 struct omap_opp *dsp_opp_table,
+                 struct omap_opp *l3_opp_table) {
+    mpu_opps = 0;
+    dsp_opps = 0;
+    l3_opps = 0;
Quoted 8 lines

arch/arm/plat-omap/include/mach/omap-pm.h extern struct omap_opp *l3_opps; · line 75

Quoted 8 lines
arch/arm/plat-omap/include/mach/omap-pm.h +4 -0
+    return 0;
+}
+#else
 int __init omap_pm_if_early_init(struct omap_opp *mpu_opp_table,
                  struct omap_opp *dsp_opp_table,
                  struct omap_opp *l3_opp_table);
+#endif
 

[sp] Instead of creating 'dummy' variables ans initializing them to
0; wouldn't it be better to redefine omap_pm_if_early_init() with no arguments under CONFIG_OMAP_PM_NONE.

I have not checked in detail; but not sure impact of "return -EINVAL" in resulting from the initializations above.

We may just need a clean-up to get all functions where *_opp variables are used.

Also, I have not checked if the updated clock infra has any impact to the functions causing compile errors.

Best regards,
Sanjeev

Quoted 24 lines

arch/arm/plat-omap/include/mach/omap-pm.h int __init omap_pm_if_early_init(struct omap_opp · line 80

Quoted 5 lines
arch/arm/plat-omap/include/mach/omap-pm.h +0 -0
 /**

* omap_pm_if_init - OMAP PM init code called after clock fw init

arch/arm/plat-omap/include/mach/omap-pm.h +0 -0
@@ -68,7 +79,11 @@ int __init omap_pm_if_early_init(struct omap_opp 
 *mpu_opp_table,
  * The main initialization code.  OPP tables are passed in 

here. The

Quoted 10 lines
arch/arm/plat-omap/include/mach/omap-pm.h +4 -0
  * "_if_" is to avoid name collisions with the PM idle-loop code.
  */
+#ifdef CONFIG_OMAP_PM_NONE
+static inline int __init omap_pm_if_init(void) { return 0; }
+#else
 int __init omap_pm_if_init(void);
+#endif
 
 /**

* omap_pm_if_exit - OMAP PM exit code

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 105 lines · Sanjeev
Quoted 89 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Roger Quadros
Sent: Tuesday, April 07, 2009 4:49 PM
To: ext Roger Quadros
Cc: Kevin Hilman; [email protected]
Subject: Re: [PATCH] PM: OMAP: Fix build with CONFIG_OMAP_PM_NONE set

The patch fixes the following link errors

arch/arm/mach-omap2/built-in.o: In function `omap3_round_to_table_rate':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:956: undefined reference to mpu_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:956: undefined reference to dsp_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:956: undefined reference to l3_opps' arch/arm/mach-omap2/built-in.o: In function omap2_clk_init_cpufreq_table':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:719: undefined reference to mpu_opps' arch/arm/mach-omap2/built-in.o: In function omap3_select_table_rate':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:1020: undefined reference to mpu_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:1020: undefined reference to dsp_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:1020: undefined reference to l3_opps' arch/arm/mach-omap2/built-in.o: In function omap2_init_common_hw':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/io.c:
241: undefined reference to `omap_pm_if_early_init' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/io.c:
246: undefined reference to omap_pm_if_init' arch/arm/mach-omap2/built-in.o: In function omap2_clk_init':
/home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:887: undefined reference to mpu_opps' /home/roger/maemo/linux/linux-roverx/arch/arm/mach-omap2/clock 34xx.c:887: undefined reference to l3_opps'
make: *** [.tmp_vmlinux1] Error 1

Quoted 5 lines · ext Roger Quadros

From: Roger Quadros <[email protected]>
Date: Tue, 7 Apr 2009 11:10:29 +0300
Subject: [PATCH] PM: OMAP: Fix build with CONFIG_OMAP_PM_NONE set

Removes undefined symbol link errors. Required symbols are

defined in

Review

Quoted 9 lines

common.c and omap-pm.h

---
 arch/arm/plat-omap/common.c               |    6 ++++++
 arch/arm/plat-omap/include/mach/omap-pm.h |   15 +++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/plat-omap/common.c

Quoted 21 lines

index 2866612..634ca39 100644

arch/arm/plat-omap/common.c +6 -0
@@ -46,6 +46,12 @@ int omap_bootloader_tag_len;
 struct omap_board_config_kernel *omap_board_config;
 int omap_board_config_size;
 
+#ifdef CONFIG_OMAP_PM_NONE
+struct omap_opp *mpu_opps;
+struct omap_opp *dsp_opps;
+struct omap_opp *l3_opps;
+#endif
+
 #ifdef CONFIG_OMAP_BOOT_TAG
 
 static int __init parse_tag_omap(const struct tag *tag)
arch/arm/plat-omap/include/mach/omap-pm.h +0 -0
index f0bbd36..6a8499a 100644

arch/arm/plat-omap/include/mach/omap-pm.h extern struct omap_opp *l3_opps; · line 58

Quoted 1 line
arch/arm/plat-omap/include/mach/omap-pm.h +0 -0
@@ -58,9 +58,20 @@ extern struct omap_opp *l3_opps;
  * framework starts.  The "_if_" is to avoid name 

collisions with the

Quoted 10 lines
arch/arm/plat-omap/include/mach/omap-pm.h +7 -0
  * PM idle-loop code.
  */
+#ifdef CONFIG_OMAP_PM_NONE
+static inline int __init omap_pm_if_early_init(struct omap_opp 
 *mpu_opp_table,
+                 struct omap_opp *dsp_opp_table,
+                 struct omap_opp *l3_opp_table) {
+    mpu_opps = 0;
+    dsp_opps = 0;
+    l3_opps = 0;
Quoted 8 lines

arch/arm/plat-omap/include/mach/omap-pm.h extern struct omap_opp *l3_opps; · line 75

Quoted 8 lines
arch/arm/plat-omap/include/mach/omap-pm.h +4 -0
+    return 0;
+}
+#else
 int __init omap_pm_if_early_init(struct omap_opp *mpu_opp_table,
                  struct omap_opp *dsp_opp_table,
                  struct omap_opp *l3_opp_table);
+#endif
 

[sp] Instead of creating 'dummy' variables ans initializing them to
0; wouldn't it be better to redefine omap_pm_if_early_init() with no arguments under CONFIG_OMAP_PM_NONE.

I have not checked in detail; but not sure impact of "return -EINVAL" in resulting from the initializations above.

Quoted 9 lines

We may just need a clean-up to get all functions where *_opp variables are used.

Also, I have not checked if the updated clock infra has any impact to the functions causing compile errors.

Best regards,
Sanjeev

I get your point. The reason why i used dummy variables for opps was that they are used at quite some places and are always checked for != 0 before use.

If dummy opp variables are not defined then we'll have to check for CONFIG_OMAP_PM_NONE at all those places, which i too am ok with.

Which one is a better approach?

-roger.

Quoted 22 lines
Quoted 22 lines

arch/arm/plat-omap/include/mach/omap-pm.h int __init omap_pm_if_early_init(struct omap_opp · line 80

Quoted 5 lines
arch/arm/plat-omap/include/mach/omap-pm.h +0 -0
 /**

* omap_pm_if_init - OMAP PM init code called after clock fw init

arch/arm/plat-omap/include/mach/omap-pm.h +0 -0
@@ -68,7 +79,11 @@ int __init omap_pm_if_early_init(struct omap_opp 
 *mpu_opp_table,
  * The main initialization code.  OPP tables are passed in 

here. The

Quoted 10 lines
arch/arm/plat-omap/include/mach/omap-pm.h +4 -0
  * "_if_" is to avoid name collisions with the PM idle-loop code.
  */
+#ifdef CONFIG_OMAP_PM_NONE
+static inline int __init omap_pm_if_init(void) { return 0; }
+#else
 int __init omap_pm_if_init(void);
+#endif
 
 /**

* omap_pm_if_exit - OMAP PM exit code

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html