diff mbox

[RFC,v2,11/23] ARM: sleep: allow it to be build for R-class

Message ID 1480423205-48436-12-git-send-email-vladimir.murzin@arm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Vladimir Murzin Nov. 29, 2016, 12:39 p.m. UTC
Dependency on MMU is quite strict and prevent R-class from being built -
relax this condition and guard against M-class only

Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Vladimir Murzin <vladimir.murzin@arm.com>
---
 arch/arm/Kconfig        |    2 +-
 arch/arm/kernel/sleep.S |    4 ----
 2 files changed, 1 insertion(+), 5 deletions(-)

Comments

Russell King (Oracle) Nov. 29, 2016, 5:11 p.m. UTC | #1
On Tue, Nov 29, 2016 at 12:39:53PM +0000, Vladimir Murzin wrote:
> Dependency on MMU is quite strict and prevent R-class from being built -
> relax this condition and guard against M-class only

I thought I'd already commented on some of this change, but it seems
not.

> diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
> index 0f6c100..0e7fddf 100644
> --- a/arch/arm/kernel/sleep.S
> +++ b/arch/arm/kernel/sleep.S
> @@ -119,14 +119,12 @@ ENDPROC(cpu_resume_after_mmu)
>  	.text
>  	.align
>  
> -#ifdef CONFIG_MMU
>  	.arm
>  ENTRY(cpu_resume_arm)
>   THUMB(	badr	r9, 1f		)	@ Kernel is entered in ARM.
>   THUMB(	bx	r9		)	@ If this is a Thumb-2 kernel,
>   THUMB(	.thumb			)	@ switch to Thumb now.
>   THUMB(1:			)
> -#endif
>  
>  ENTRY(cpu_resume)
>  ARM_BE8(setend be)			@ ensure we are in BE mode
> @@ -160,9 +158,7 @@ THUMB(	mov	sp, r2			)
>  THUMB(	bx	r3			)
>  ENDPROC(cpu_resume)
>  
> -#ifdef CONFIG_MMU
>  ENDPROC(cpu_resume_arm)
> -#endif

These ifdefs were introduced to fix EFM32.  The commit description needs
to state why it's safe to remove them now (presumably because of the
dependency on !CPU_V7M).  However, it also needs to explain why it's
not going to cause a regression for EFM32 - EFM32 _was_ capable of
building this code.
Vladimir Murzin Nov. 30, 2016, 9:54 a.m. UTC | #2
On 29/11/16 17:11, Russell King - ARM Linux wrote:
> On Tue, Nov 29, 2016 at 12:39:53PM +0000, Vladimir Murzin wrote:
>> Dependency on MMU is quite strict and prevent R-class from being built -
>> relax this condition and guard against M-class only
> 
> I thought I'd already commented on some of this change, but it seems
> not.
> 
>> diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
>> index 0f6c100..0e7fddf 100644
>> --- a/arch/arm/kernel/sleep.S
>> +++ b/arch/arm/kernel/sleep.S
>> @@ -119,14 +119,12 @@ ENDPROC(cpu_resume_after_mmu)
>>  	.text
>>  	.align
>>  
>> -#ifdef CONFIG_MMU
>>  	.arm
>>  ENTRY(cpu_resume_arm)
>>   THUMB(	badr	r9, 1f		)	@ Kernel is entered in ARM.
>>   THUMB(	bx	r9		)	@ If this is a Thumb-2 kernel,
>>   THUMB(	.thumb			)	@ switch to Thumb now.
>>   THUMB(1:			)
>> -#endif
>>  
>>  ENTRY(cpu_resume)
>>  ARM_BE8(setend be)			@ ensure we are in BE mode
>> @@ -160,9 +158,7 @@ THUMB(	mov	sp, r2			)
>>  THUMB(	bx	r3			)
>>  ENDPROC(cpu_resume)
>>  
>> -#ifdef CONFIG_MMU
>>  ENDPROC(cpu_resume_arm)
>> -#endif
> 
> These ifdefs were introduced to fix EFM32.  The commit description needs
> to state why it's safe to remove them now (presumably because of the
> dependency on !CPU_V7M).  However, it also needs to explain why it's
> not going to cause a regression for EFM32 - EFM32 _was_ capable of
> building this code.
> 

After looking at 2678bb9f ("ARM: fix EFM32 build breakage caused by
cpu_resume_arm") I think the right fix should be based on CONFIG_CPU_THUMBONLY
rather than disallowing this code to be build for CPU_V7M. 

Indeed, I've just tried that it it works fine, so I'll update the patch to
reflect that.

Thanks for your valuable comment!

Cheers
Vladimir
diff mbox

Patch

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b5d529f..c462d9e 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -2179,7 +2179,7 @@  config ARCH_SUSPEND_POSSIBLE
 	def_bool y
 
 config ARM_CPU_SUSPEND
-	def_bool PM_SLEEP || BL_SWITCHER || ARM_PSCI_FW
+	def_bool (PM_SLEEP || BL_SWITCHER || ARM_PSCI_FW) && !CPU_V7M
 	depends on ARCH_SUSPEND_POSSIBLE
 
 config ARCH_HIBERNATION_POSSIBLE
diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
index 0f6c100..0e7fddf 100644
--- a/arch/arm/kernel/sleep.S
+++ b/arch/arm/kernel/sleep.S
@@ -119,14 +119,12 @@  ENDPROC(cpu_resume_after_mmu)
 	.text
 	.align
 
-#ifdef CONFIG_MMU
 	.arm
 ENTRY(cpu_resume_arm)
  THUMB(	badr	r9, 1f		)	@ Kernel is entered in ARM.
  THUMB(	bx	r9		)	@ If this is a Thumb-2 kernel,
  THUMB(	.thumb			)	@ switch to Thumb now.
  THUMB(1:			)
-#endif
 
 ENTRY(cpu_resume)
 ARM_BE8(setend be)			@ ensure we are in BE mode
@@ -160,9 +158,7 @@  THUMB(	mov	sp, r2			)
 THUMB(	bx	r3			)
 ENDPROC(cpu_resume)
 
-#ifdef CONFIG_MMU
 ENDPROC(cpu_resume_arm)
-#endif
 
 	.align 2
 _sleep_save_sp: