RE: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix for undefined reference to 'omap2_prm_read_mod_reg'

2011-01-07 Thread Santosh Shilimkar
 -Original Message-
 From: Paul Walmsley [mailto:p...@pwsan.com]
 Sent: Thursday, January 06, 2011 11:28 PM
 To: Santosh Shilimkar
 Cc: linux-omap@vger.kernel.org; khil...@ti.com; t...@atomide.com;
 linux-arm-ker...@lists.infradead.org
 Subject: Re: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix
 for undefined reference to 'omap2_prm_read_mod_reg'

 Hi Santosh

 On Wed, 5 Jan 2011, Santosh Shilimkar wrote:

  omap2plus_defocnfig build breaks when customised with only
 ARCH_OMAP4
  selected. This is because common files make references to the
 functions
  which are defined only for omap2xxx and omap3xxx.

 ...

 
  This patch adds stubs for these functions so that build continues
 to work.
 
  Signed-off-by: Santosh Shilimkar santosh.shilim...@ti.com
  Cc: Paul Walmsley p...@pwsan.com
  ---
   arch/arm/mach-omap2/prm2xxx_3xxx.h |   63
 +++-
   1 files changed, 62 insertions(+), 1 deletions(-)
 
  diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-
 omap2/prm2xxx_3xxx.h
  index 53d44f6..843f329 100644
  --- a/arch/arm/mach-omap2/prm2xxx_3xxx.h
  +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h
  @@ -228,7 +228,67 @@
 
 
   #ifndef __ASSEMBLER__
  -
  +/*
  + * Stub omap2xxx/omap3xxx functions so that common files
  + * continue to build when custom builds are used
  + */
  +#if defined(CONFIG_ARCH_OMAP4)  !(defined(CONFIG_ARCH_OMAP2) ||
   \
  +   defined(CONFIG_ARCH_OMAP3))
  +static inline u32 omap2_prm_read_mod_reg(s16 module, u16 idx)
  +{
  +   WARN_ONCE(1, prm: omap2xxx/omap3xxx specific function and 
  +   not suppose to be used on omap4\n);
  +   return 0;
  +}

 I think it would be best to use WARN() on these, rather than
 WARN_ONCE().
 That's because these could be called from different parts of the
 code
 base, and the stack backtrace will help someone figure out all the
 code
 that needs to be fixed.

Ok.

 Once you do that, this patch is

 Acked-by: Paul Walmsley p...@pwsan.com

Thanks
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix for undefined reference to 'omap2_prm_read_mod_reg'

2011-01-07 Thread Santosh Shilimkar
 -Original Message-
 From: Paul Walmsley [mailto:p...@pwsan.com]
 Sent: Thursday, January 06, 2011 11:28 PM
Kevin,
 To: Santosh Shilimkar
 Cc: linux-omap@vger.kernel.org; khil...@ti.com; t...@atomide.com;
 linux-arm-ker...@lists.infradead.org
 Subject: Re: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix
 for undefined reference to 'omap2_prm_read_mod_reg'

 Hi Santosh

[.]


 I think it would be best to use WARN() on these, rather than
 WARN_ONCE().
 That's because these could be called from different parts of the
 code
 base, and the stack backtrace will help someone figure out all the
 code
 that needs to be fixed.

 Once you do that, this patch is

 Acked-by: Paul Walmsley p...@pwsan.com


With WARN() instead of WARN_ONCE() and Paul's ack, here
is an updated patch.


From 3ccbab8517133c25ed2e470f9622639c98dcbd71 Mon Sep 17 00:00:00 2001
From: Santosh Shilimkar santosh.shilim...@ti.com
Date: Tue, 4 Jan 2011 20:40:27 +0530
Subject: [PATCH 2/5 v3] omap2plus: prm: Trvial build break fix for
undefined reference to 'omap2_prm_read_mod_reg'

omap2plus_defocnfig build breaks when customised with only ARCH_OMAP4
selected. This is because common files make references to the functions
which are defined only for omap2xxx and omap3xxx.

 LD  .tmp_vmlinux1
arch/arm/mach-omap2/built-in.o: In function `pm_dbg_regset_store':
arch/arm/mach-omap2/pm-debug.c:335: undefined reference to
`omap2_prm_read_mod_reg'
arch/arm/mach-omap2/built-in.o: In function `omap2_pm_dump':
arch/arm/mach-omap2/pm-debug.c:121: undefined reference to
`omap2_prm_read_mod_reg'
arch/arm/mach-omap2/pm-debug.c:123: undefined reference to
`omap2_prm_read_mod_reg'
arch/arm/mach-omap2/pm-debug.c:124: undefined reference to
`omap2_prm_read_mod_reg'
arch/arm/mach-omap2/pm-debug.c:125: undefined reference to
`omap2_prm_read_mod_reg'
arch/arm/mach-omap2/built-in.o: In function `omap_prcm_arch_reset':
arch/arm/mach-omap2/prcm.c:106: undefined reference to
`omap2_prm_set_mod_reg_bits'
arch/arm/mach-omap2/prcm.c:108: undefined reference to
`omap2_prm_read_mod_reg'
arch/arm/mach-omap2/built-in.o: In function `omap_prcm_get_reset_sources':
arch/arm/mach-omap2/prcm.c:53: undefined reference to
`omap2_prm_read_mod_reg'
arch/arm/mach-omap2/built-in.o: In function `clkdm_clear_all_wkdeps':
arch/arm/mach-omap2/clockdomain.c:545: undefined reference to
`omap2_prm_clear_mod_reg_bits'
arch/arm/mach-omap2/built-in.o: In function `clkdm_del_wkdep':
arch/arm/mach-omap2/clockdomain.c:475: undefined reference to
`omap2_prm_clear_mod_reg_bits'
arch/arm/mach-omap2/built-in.o: In function `clkdm_read_wkdep':
arch/arm/mach-omap2/clockdomain.c:511: undefined reference to
`omap2_prm_read_mod_bits_shift'
arch/arm/mach-omap2/built-in.o: In function `clkdm_add_wkdep':
arch/arm/mach-omap2/clockdomain.c:440: undefined reference to
`omap2_prm_set_mod_reg_bits'
make: *** [.tmp_vmlinux1] Error 1

This patch adds stubs for these functions so that build continues to work.

Signed-off-by: Santosh Shilimkar santosh.shilim...@ti.com
Acked-by: Paul Walmsley p...@pwsan.com
---
 arch/arm/mach-omap2/prm2xxx_3xxx.h |   63
+++-
 1 files changed, 62 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h
b/arch/arm/mach-omap2/prm2xxx_3xxx.h
index 53d44f6..49654c8 100644
--- a/arch/arm/mach-omap2/prm2xxx_3xxx.h
+++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h
@@ -228,7 +228,67 @@


 #ifndef __ASSEMBLER__
-
+/*
+ * Stub omap2xxx/omap3xxx functions so that common files
+ * continue to build when custom builds are used
+ */
+#if defined(CONFIG_ARCH_OMAP4)  !(defined(CONFIG_ARCH_OMAP2) ||  \
+   defined(CONFIG_ARCH_OMAP3))
+static inline u32 omap2_prm_read_mod_reg(s16 module, u16 idx)
+{
+   WARN(1, prm: omap2xxx/omap3xxx specific function and 
+   not suppose to be used on omap4\n);
+   return 0;
+}
+static inline void omap2_prm_write_mod_reg(u32 val, s16 module, u16 idx)
+{
+   WARN(1, prm: omap2xxx/omap3xxx specific function and 
+   not suppose to be used on omap4\n);
+}
+static inline u32 omap2_prm_rmw_mod_reg_bits(u32 mask, u32 bits,
+   s16 module, s16 idx)
+{
+   WARN(1, prm: omap2xxx/omap3xxx specific function and 
+   not suppose to be used on omap4\n);
+   return 0;
+}
+static inline u32 omap2_prm_set_mod_reg_bits(u32 bits, s16 module, s16
idx)
+{
+   WARN(1, prm: omap2xxx/omap3xxx specific function and 
+   not suppose to be used on omap4\n);
+   return 0;
+}
+static inline u32 omap2_prm_clear_mod_reg_bits(u32 bits, s16 module, s16
idx)
+{
+   WARN(1, prm: omap2xxx/omap3xxx specific function and 
+   not suppose to be used on omap4\n);
+   return 0;
+}
+static inline u32 omap2_prm_read_mod_bits_shift(s16 domain, s16 idx, u32
mask)
+{
+   WARN(1, prm: omap2xxx/omap3xxx specific function and 
+   not suppose to be used on omap4\n);
+   return 0;
+}
+static

Re: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix for undefined reference to 'omap2_prm_read_mod_reg'

2011-01-07 Thread Kevin Hilman
Santosh Shilimkar santosh.shilim...@ti.com writes:

[...] 

 I think it would be best to use WARN() on these, rather than
 WARN_ONCE().  That's because these could be called from different
 parts of the code base, and the stack backtrace will help someone
 figure out all the code that needs to be fixed.

 Once you do that, this patch is

 Acked-by: Paul Walmsley p...@pwsan.com


 With WARN() instead of WARN_ONCE() and Paul's ack, here
 is an updated patch.

Thanks, will queue for .38-rc cycle.

I'll again plead for working on your git-send-email setup.  It looks
like your using outlook.  The inline patch is wrapped (as outlook almost
always does.)  The attached version applied fine, but the strong
preference is for a single inline patch.  

Thanks,

Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix for undefined reference to 'omap2_prm_read_mod_reg'

2011-01-07 Thread Santosh Shilimkar
 -Original Message-
 From: Kevin Hilman [mailto:khil...@ti.com]
 Sent: Saturday, January 08, 2011 2:44 AM
 To: Santosh Shilimkar
 Cc: linux-omap@vger.kernel.org; t...@atomide.com; linux-arm-
 ker...@lists.infradead.org; Paul Walmsley
 Subject: Re: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix
 for undefined reference to 'omap2_prm_read_mod_reg'

 Santosh Shilimkar santosh.shilim...@ti.com writes:

 [...]

  I think it would be best to use WARN() on these, rather than
  WARN_ONCE().  That's because these could be called from different
  parts of the code base, and the stack backtrace will help someone
  figure out all the code that needs to be fixed.
 
  Once you do that, this patch is
 
  Acked-by: Paul Walmsley p...@pwsan.com
 

  With WARN() instead of WARN_ONCE() and Paul's ack, here
  is an updated patch.

 Thanks, will queue for .38-rc cycle.

 I'll again plead for working on your git-send-email setup.  It looks
 like your using outlook.  The inline patch is wrapped (as outlook
 almost
 always does.)  The attached version applied fine, but the strong
 preference is for a single inline patch.

Its google mail now a days. I thought it will wrap and
hence attached the version.

Fully agree with inline patch but as this one was minor
update I skipped it.

Regards
Santosh
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix for undefined reference to 'omap2_prm_read_mod_reg'

2011-01-06 Thread Santosh Shilimkar
 -Original Message-
 From: Premi, Sanjeev [mailto:pr...@ti.com]
 Sent: Thursday, January 06, 2011 8:03 PM
 To: Shilimkar, Santosh; linux-omap@vger.kernel.org
 Cc: Hilman, Kevin; t...@atomide.com; linux-arm-
 ker...@lists.infradead.org; Shilimkar, Santosh; Paul Walmsley
 Subject: RE: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix
 for undefined reference to 'omap2_prm_read_mod_reg'

  -Original Message-
  From: linux-omap-ow...@vger.kernel.org
  [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of
  Santosh Shilimkar
  Sent: Wednesday, January 05, 2011 4:27 PM
  To: linux-omap@vger.kernel.org
  Cc: Hilman, Kevin; t...@atomide.com;
  linux-arm-ker...@lists.infradead.org; Shilimkar, Santosh;
  Paul Walmsley
  Subject: [PATCH v2 2/5] omap2plus: prm: Trvial build break
  fix for undefined reference to 'omap2_prm_read_mod_reg'

 [snip]

 
   #ifndef __ASSEMBLER__
  -
  +/*
  + * Stub omap2xxx/omap3xxx functions so that common files
  + * continue to build when custom builds are used
  + */
  +#if defined(CONFIG_ARCH_OMAP4) 
  !(defined(CONFIG_ARCH_OMAP2) || \
  +   defined(CONFIG_ARCH_OMAP3))
  +static inline u32 omap2_prm_read_mod_reg(s16 module, u16 idx)
  +{
  +   WARN_ONCE(1, prm: omap2xxx/omap3xxx specific function and 
  +   not suppose to be used on omap4\n);
  +   return 0;
  +}
 Looking forward, the warning of incorrect SOC may be required
 for when kernel is build for one specific SOC.

 Wouldn't it be easy/better to have common global function:

 void wrong_soc(char* func, int soc_id)
 {
   WARN_ONCE(1, Function %s cannot be used for %d, func,
 soc_id);
 }

 OR we could have soc specific functions e.g.

 void omap2xxx_only (char* func)
 {
   WARN_ONCE(1, Function %s is specific to OMAP2XXX);
 }
 ..etc..

 Later these functions can be called from the stubs.

 This is prelim idea, will need to be worked upon.

Not sure. May appear like over engineering considering it's a
stub.
Paul can comment.

Regards,
Santosh
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix for undefined reference to 'omap2_prm_read_mod_reg'

2011-01-06 Thread Paul Walmsley
Hi Santosh

On Wed, 5 Jan 2011, Santosh Shilimkar wrote:

 omap2plus_defocnfig build breaks when customised with only ARCH_OMAP4
 selected. This is because common files make references to the functions
 which are defined only for omap2xxx and omap3xxx.

...

 
 This patch adds stubs for these functions so that build continues to work.
 
 Signed-off-by: Santosh Shilimkar santosh.shilim...@ti.com
 Cc: Paul Walmsley p...@pwsan.com
 ---
  arch/arm/mach-omap2/prm2xxx_3xxx.h |   63 
 +++-
  1 files changed, 62 insertions(+), 1 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h 
 b/arch/arm/mach-omap2/prm2xxx_3xxx.h
 index 53d44f6..843f329 100644
 --- a/arch/arm/mach-omap2/prm2xxx_3xxx.h
 +++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h
 @@ -228,7 +228,67 @@
  
  
  #ifndef __ASSEMBLER__
 -
 +/*
 + * Stub omap2xxx/omap3xxx functions so that common files
 + * continue to build when custom builds are used
 + */
 +#if defined(CONFIG_ARCH_OMAP4)  !(defined(CONFIG_ARCH_OMAP2) ||\
 + defined(CONFIG_ARCH_OMAP3))
 +static inline u32 omap2_prm_read_mod_reg(s16 module, u16 idx)
 +{
 + WARN_ONCE(1, prm: omap2xxx/omap3xxx specific function and 
 + not suppose to be used on omap4\n);
 + return 0;
 +}

I think it would be best to use WARN() on these, rather than WARN_ONCE().  
That's because these could be called from different parts of the code 
base, and the stack backtrace will help someone figure out all the code 
that needs to be fixed.

Once you do that, this patch is

Acked-by: Paul Walmsley p...@pwsan.com


- Paul
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix for undefined reference to 'omap2_prm_read_mod_reg'

2011-01-06 Thread Kevin Hilman
Santosh Shilimkar santosh.shilim...@ti.com writes:

 -Original Message-
 From: Premi, Sanjeev [mailto:pr...@ti.com]
 Sent: Thursday, January 06, 2011 8:03 PM
 To: Shilimkar, Santosh; linux-omap@vger.kernel.org
 Cc: Hilman, Kevin; t...@atomide.com; linux-arm-
 ker...@lists.infradead.org; Shilimkar, Santosh; Paul Walmsley
 Subject: RE: [PATCH v2 2/5] omap2plus: prm: Trvial build break fix
 for undefined reference to 'omap2_prm_read_mod_reg'

  -Original Message-
  From: linux-omap-ow...@vger.kernel.org
  [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of
  Santosh Shilimkar
  Sent: Wednesday, January 05, 2011 4:27 PM
  To: linux-omap@vger.kernel.org
  Cc: Hilman, Kevin; t...@atomide.com;
  linux-arm-ker...@lists.infradead.org; Shilimkar, Santosh;
  Paul Walmsley
  Subject: [PATCH v2 2/5] omap2plus: prm: Trvial build break
  fix for undefined reference to 'omap2_prm_read_mod_reg'

 [snip]

 
   #ifndef __ASSEMBLER__
  -
  +/*
  + * Stub omap2xxx/omap3xxx functions so that common files
  + * continue to build when custom builds are used
  + */
  +#if defined(CONFIG_ARCH_OMAP4) 
  !(defined(CONFIG_ARCH_OMAP2) ||\
  +  defined(CONFIG_ARCH_OMAP3))
  +static inline u32 omap2_prm_read_mod_reg(s16 module, u16 idx)
  +{
  +  WARN_ONCE(1, prm: omap2xxx/omap3xxx specific function and 
  +  not suppose to be used on omap4\n);
  +  return 0;
  +}
 Looking forward, the warning of incorrect SOC may be required
 for when kernel is build for one specific SOC.

 Wouldn't it be easy/better to have common global function:

 void wrong_soc(char* func, int soc_id)
 {
  WARN_ONCE(1, Function %s cannot be used for %d, func,
 soc_id);
 }

 OR we could have soc specific functions e.g.

 void omap2xxx_only (char* func)
 {
  WARN_ONCE(1, Function %s is specific to OMAP2XXX);
 }
 ..etc..

 Later these functions can be called from the stubs.

 This is prelim idea, will need to be worked upon.

 Not sure. May appear like over engineering considering it's a
 stub.
 Paul can comment.

I guess Sanjeev's approach is meant eliminate duplicate strings that
waste space.

Sanjeev, did you check whether multiple copies of the exact same string
actually exist in the binary?  I'm wondering if gcc is smart enough to
only have one copy of the string (but have doubts.)

Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html