linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: tegra: remove the ifdef of ARCH SoC in the tegra_resume
@ 2013-06-03  8:10 Joseph Lo
  2013-06-03 15:26 ` Stephen Warren
  2013-06-05 17:44 ` Stephen Warren
  0 siblings, 2 replies; 5+ messages in thread
From: Joseph Lo @ 2013-06-03  8:10 UTC (permalink / raw)
  To: linux-arm-kernel

Removing the ifdef of ARCH_TEGRA_SoC in the tegra_resume function. Because
we always build with all Tegra SoCs support and had a runtime chip
detection code there. And we expect most of the chips would need the code
in the future.

We also fix a typo of a macro name that cause a build error.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Joseph Lo <josephl@nvidia.com>
---
 arch/arm/mach-tegra/reset-handler.S | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S
index d2042ac..39dc9e7 100644
--- a/arch/arm/mach-tegra/reset-handler.S
+++ b/arch/arm/mach-tegra/reset-handler.S
@@ -54,12 +54,11 @@ ENTRY(tegra_resume)
 	bne	cpu_resume			@ no
 no_cpu0_chk:
 
-#ifndef CONFIG_ARCH_TEGRA_2x_SOC
 	/* Are we on Tegra20? */
 	cmp	r6, #TEGRA20
 	beq	1f				@ Yes
 	/* Clear the flow controller flags for this CPU. */
-	cpu_to_csr_req r1, r0
+	cpu_to_csr_reg r1, r0
 	mov32	r2, TEGRA_FLOW_CTRL_BASE
 	ldr	r1, [r2, r1]
 	/* Clear event & intr flag */
@@ -70,7 +69,6 @@ no_cpu0_chk:
 	bic	r1, r1, r0
 	str	r1, [r2]
 1:
-#endif
 
 	check_cpu_part_num 0xc09, r8, r9
 	bne	not_ca9
-- 
1.8.3

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

* [PATCH] ARM: tegra: remove the ifdef of ARCH SoC in the tegra_resume
  2013-06-03  8:10 [PATCH] ARM: tegra: remove the ifdef of ARCH SoC in the tegra_resume Joseph Lo
@ 2013-06-03 15:26 ` Stephen Warren
  2013-06-03 22:48   ` Arnd Bergmann
  2013-06-05 17:44 ` Stephen Warren
  1 sibling, 1 reply; 5+ messages in thread
From: Stephen Warren @ 2013-06-03 15:26 UTC (permalink / raw)
  To: linux-arm-kernel

On 06/03/2013 02:10 AM, Joseph Lo wrote:
> Removing the ifdef of ARCH_TEGRA_SoC in the tegra_resume function. Because
> we always build with all Tegra SoCs support and had a runtime chip
> detection code there. And we expect most of the chips would need the code
> in the future.
> 
> We also fix a typo of a macro name that cause a build error.

OK, this fixes the build issue, but this patch raises some questions
about the code...

> diff --git a/arch/arm/mach-tegra/reset-handler.S b/arch/arm/mach-tegra/reset-handler.S

> -#ifndef CONFIG_ARCH_TEGRA_2x_SOC
>  	/* Are we on Tegra20? */
>  	cmp	r6, #TEGRA20
>  	beq	1f				@ Yes

Was that ifdef completely incorrect before? I can see why the cmp/beq
might be ifdef'd (although it's not worth it), but I assume the code
after that beq was intended to run on all chips after Tegra20. The ifdef
as it was written does something rather different; it prevents any of
that code from running unless the kernel doesn't have Tegra20 support.
So, I think that the removal of the ifdef is more of a bug-fix that
"because we always build with all Tegra SoCs support. Let me know, and
I'll re-write the commit description to something more accurate...

>  	/* Clear the flow controller flags for this CPU. */
> -	cpu_to_csr_req r1, r0
> +	cpu_to_csr_reg r1, r0
>  	mov32	r2, TEGRA_FLOW_CTRL_BASE
>  	ldr	r1, [r2, r1]
>  	/* Clear event & intr flag */
> @@ -70,7 +69,6 @@ no_cpu0_chk:
>  	bic	r1, r1, r0
>  	str	r1, [r2]
>  1:
> -#endif
>  
>  	check_cpu_part_num 0xc09, r8, r9
>  	bne	not_ca9

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

* [PATCH] ARM: tegra: remove the ifdef of ARCH SoC in the tegra_resume
  2013-06-03 15:26 ` Stephen Warren
@ 2013-06-03 22:48   ` Arnd Bergmann
  2013-06-04  1:25     ` Joseph Lo
  0 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2013-06-03 22:48 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 03 June 2013, Stephen Warren wrote:
> Was that ifdef completely incorrect before? I can see why the cmp/beq
> might be ifdef'd (although it's not worth it), but I assume the code
> after that beq was intended to run on all chips after Tegra20. The ifdef
> as it was written does something rather different; it prevents any of
> that code from running unless the kernel doesn't have Tegra20 support.
> So, I think that the removal of the ifdef is more of a bug-fix that
> "because we always build with all Tegra SoCs support. Let me know, and
> I'll re-write the commit description to something more accurate...

The #ifdef was recently changed from #if TEGRA3 to #if !TEGRA2, which support
for TEGRA4 was added. I think this is where it broke.

	Arnd

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

* [PATCH] ARM: tegra: remove the ifdef of ARCH SoC in the tegra_resume
  2013-06-03 22:48   ` Arnd Bergmann
@ 2013-06-04  1:25     ` Joseph Lo
  0 siblings, 0 replies; 5+ messages in thread
From: Joseph Lo @ 2013-06-04  1:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2013-06-04 at 06:48 +0800, Arnd Bergmann wrote:
> On Monday 03 June 2013, Stephen Warren wrote:
> > Was that ifdef completely incorrect before? I can see why the cmp/beq
> > might be ifdef'd (although it's not worth it), but I assume the code
> > after that beq was intended to run on all chips after Tegra20. The ifdef
> > as it was written does something rather different; it prevents any of
> > that code from running unless the kernel doesn't have Tegra20 support.
> > So, I think that the removal of the ifdef is more of a bug-fix that
> > "because we always build with all Tegra SoCs support. Let me know, and
> > I'll re-write the commit description to something more accurate...
> 
> The #ifdef was recently changed from #if TEGRA3 to #if !TEGRA2, which support
> for TEGRA4 was added. I think this is where it broke.
> 
Yes, exactly. Sorry again for the error code.

Joseph

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

* [PATCH] ARM: tegra: remove the ifdef of ARCH SoC in the tegra_resume
  2013-06-03  8:10 [PATCH] ARM: tegra: remove the ifdef of ARCH SoC in the tegra_resume Joseph Lo
  2013-06-03 15:26 ` Stephen Warren
@ 2013-06-05 17:44 ` Stephen Warren
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Warren @ 2013-06-05 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

On 06/03/2013 02:10 AM, Joseph Lo wrote:
> Removing the ifdef of ARCH_TEGRA_SoC in the tegra_resume function. Because
> we always build with all Tegra SoCs support and had a runtime chip
> detection code there. And we expect most of the chips would need the code
> in the future.
> 
> We also fix a typo of a macro name that cause a build error.

Applied to Tegra's for-3.11/soc, with re-written commit description.

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

end of thread, other threads:[~2013-06-05 17:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-03  8:10 [PATCH] ARM: tegra: remove the ifdef of ARCH SoC in the tegra_resume Joseph Lo
2013-06-03 15:26 ` Stephen Warren
2013-06-03 22:48   ` Arnd Bergmann
2013-06-04  1:25     ` Joseph Lo
2013-06-05 17:44 ` Stephen Warren

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