From: Russell King - ARM Linux <linux@arm.linux.org.uk> To: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.orglinux-arm-kernel@lists.infradead.orglinux-omap@vger.kernel.org Subject: [PATCH 09/11] ARM: pm: get rid of cpu_resume_turn_mmu_on Date: Thu, 01 Sep 2011 13:51:19 +0100 [thread overview] Message-ID: <E1Qz6jn-00078h-Ok@rmk-PC.arm.linux.org.uk> (raw) In-Reply-To: <20110901124752.GE29729@n2100.arm.linux.org.uk> We don't require cpu_resume_turn_mmu_on as we can combine the ldr instruction with the following code provided we ensure that cpu_resume_mmu is aligned for older CPUs. Note that we also align to a 32-byte boundary to ensure that the code can't cross a section boundary. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> --- arch/arm/kernel/sleep.S | 8 ++------ arch/arm/kernel/suspend.c | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S index 25d42df..c9a43ca 100644 --- a/arch/arm/kernel/sleep.S +++ b/arch/arm/kernel/sleep.S @@ -72,19 +72,15 @@ ENDPROC(cpu_suspend_abort) /* * r0 = control register value */ + .align 5 ENTRY(cpu_resume_mmu) ldr r3, =cpu_resume_after_mmu - b cpu_resume_turn_mmu_on -ENDPROC(cpu_resume_mmu) - .ltorg - .align 5 -ENTRY(cpu_resume_turn_mmu_on) mcr p15, 0, r0, c1, c0, 0 @ turn on MMU, I-cache, etc mrc p15, 0, r0, c0, c0, 0 @ read id reg mov r0, r0 mov r0, r0 mov pc, r3 @ jump to virtual address -ENDPROC(cpu_resume_turn_mmu_on) +ENDPROC(cpu_resume_mmu) cpu_resume_after_mmu: bl cpu_init @ restore the und/abt/irq banked regs mov r0, #0 @ return zero on success diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c index 7606122..115736a 100644 --- a/arch/arm/kernel/suspend.c +++ b/arch/arm/kernel/suspend.c @@ -9,7 +9,7 @@ static pgd_t *suspend_pgd; extern int __cpu_suspend(int, long, unsigned long, int (*)(unsigned long)); -extern void cpu_resume_turn_mmu_on(void); +extern void cpu_resume_mmu(void); /* * Hide the first two arguments to __cpu_suspend - these are an implementation @@ -41,7 +41,7 @@ static int __init cpu_suspend_init(void) { suspend_pgd = pgd_alloc(&init_mm); if (suspend_pgd) { - unsigned long addr = virt_to_phys(cpu_resume_turn_mmu_on); + unsigned long addr = virt_to_phys(cpu_resume_mmu); identity_mapping_add(suspend_pgd, addr, addr + SECTION_SIZE); } return suspend_pgd ? 0 : -ENOMEM; -- 1.7.4.4
WARNING: multiple messages have this Message-ID (diff)
From: linux@arm.linux.org.uk (Russell King - ARM Linux) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 09/11] ARM: pm: get rid of cpu_resume_turn_mmu_on Date: Thu, 01 Sep 2011 13:51:19 +0100 [thread overview] Message-ID: <E1Qz6jn-00078h-Ok@rmk-PC.arm.linux.org.uk> (raw) In-Reply-To: <20110901124752.GE29729@n2100.arm.linux.org.uk> We don't require cpu_resume_turn_mmu_on as we can combine the ldr instruction with the following code provided we ensure that cpu_resume_mmu is aligned for older CPUs. Note that we also align to a 32-byte boundary to ensure that the code can't cross a section boundary. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> --- arch/arm/kernel/sleep.S | 8 ++------ arch/arm/kernel/suspend.c | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S index 25d42df..c9a43ca 100644 --- a/arch/arm/kernel/sleep.S +++ b/arch/arm/kernel/sleep.S @@ -72,19 +72,15 @@ ENDPROC(cpu_suspend_abort) /* * r0 = control register value */ + .align 5 ENTRY(cpu_resume_mmu) ldr r3, =cpu_resume_after_mmu - b cpu_resume_turn_mmu_on -ENDPROC(cpu_resume_mmu) - .ltorg - .align 5 -ENTRY(cpu_resume_turn_mmu_on) mcr p15, 0, r0, c1, c0, 0 @ turn on MMU, I-cache, etc mrc p15, 0, r0, c0, c0, 0 @ read id reg mov r0, r0 mov r0, r0 mov pc, r3 @ jump to virtual address -ENDPROC(cpu_resume_turn_mmu_on) +ENDPROC(cpu_resume_mmu) cpu_resume_after_mmu: bl cpu_init @ restore the und/abt/irq banked regs mov r0, #0 @ return zero on success diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c index 7606122..115736a 100644 --- a/arch/arm/kernel/suspend.c +++ b/arch/arm/kernel/suspend.c @@ -9,7 +9,7 @@ static pgd_t *suspend_pgd; extern int __cpu_suspend(int, long, unsigned long, int (*)(unsigned long)); -extern void cpu_resume_turn_mmu_on(void); +extern void cpu_resume_mmu(void); /* * Hide the first two arguments to __cpu_suspend - these are an implementation @@ -41,7 +41,7 @@ static int __init cpu_suspend_init(void) { suspend_pgd = pgd_alloc(&init_mm); if (suspend_pgd) { - unsigned long addr = virt_to_phys(cpu_resume_turn_mmu_on); + unsigned long addr = virt_to_phys(cpu_resume_mmu); identity_mapping_add(suspend_pgd, addr, addr + SECTION_SIZE); } return suspend_pgd ? 0 : -ENOMEM; -- 1.7.4.4
next prev parent reply other threads:[~2011-09-01 14:02 UTC|newest] Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top 2011-09-01 12:47 [PATCH 00/11] Add L2 cache cleaning to generic CPU suspend Russell King - ARM Linux 2011-09-01 12:47 ` Russell King - ARM Linux 2011-09-01 12:48 ` [PATCH 01/11] ARM: pm: CPU specific code should not overwrite r1 (v:p offset) Russell King - ARM Linux 2011-09-01 12:48 ` Russell King - ARM Linux 2011-09-01 12:48 ` [PATCH 02/11] ARM: pm: arm920/926: fix number of registers saved Russell King - ARM Linux 2011-09-01 12:48 ` Russell King - ARM Linux 2011-09-01 12:49 ` [PATCH 03/11] ARM: pm: some ARMv7 requires a dsb in resume to ensure correctness Russell King - ARM Linux 2011-09-01 12:49 ` Russell King - ARM Linux 2011-09-07 15:41 ` Catalin Marinas 2011-09-07 15:41 ` Catalin Marinas 2011-09-07 16:19 ` Russell King - ARM Linux 2011-09-07 16:19 ` Russell King - ARM Linux 2011-09-07 16:26 ` Catalin Marinas 2011-09-07 16:26 ` Catalin Marinas 2011-09-07 16:54 ` Catalin Marinas 2011-09-07 16:54 ` Catalin Marinas 2011-09-01 12:49 ` [PATCH 04/11] ARM: pm: avoid writing the auxillary control register for ARMv7 Russell King - ARM Linux 2011-09-01 12:49 ` Russell King - ARM Linux 2011-09-01 12:49 ` [PATCH 05/11] ARM: pm: force non-zero return value from __cpu_suspend when aborting Russell King - ARM Linux 2011-09-01 12:49 ` Russell King - ARM Linux 2011-09-01 12:50 ` [PATCH 06/11] ARM: pm: preallocate a page table for suspend/resume Russell King - ARM Linux 2011-09-01 12:50 ` Russell King - ARM Linux 2011-09-01 12:50 ` [PATCH 07/11] ARM: pm: only use preallocated page table during resume Russell King - ARM Linux 2011-09-01 12:50 ` Russell King - ARM Linux 2011-09-01 12:50 ` [PATCH 08/11] ARM: pm: no need to save/restore context ID register Russell King - ARM Linux 2011-09-01 12:50 ` Russell King - ARM Linux 2011-09-03 16:33 ` Santosh 2011-09-03 16:33 ` Santosh 2011-09-04 10:08 ` Russell King - ARM Linux 2011-09-04 10:08 ` Russell King - ARM Linux 2011-09-01 12:51 ` Russell King - ARM Linux [this message] 2011-09-01 12:51 ` [PATCH 09/11] ARM: pm: get rid of cpu_resume_turn_mmu_on Russell King - ARM Linux 2011-09-01 12:51 ` [PATCH 10/11] ARM: pm: convert some assembly to C Russell King - ARM Linux 2011-09-01 12:51 ` Russell King - ARM Linux 2011-09-07 15:48 ` Lorenzo Pieralisi 2011-09-07 15:48 ` Lorenzo Pieralisi 2011-09-19 16:32 ` Russell King - ARM Linux 2011-09-19 16:32 ` Russell King - ARM Linux 2011-09-01 12:51 ` [PATCH 11/11] ARM: pm: add L2 cache cleaning for suspend Russell King - ARM Linux 2011-09-01 12:51 ` Russell King - ARM Linux 2011-09-01 15:33 ` [PATCH 00/11] Add L2 cache cleaning to generic CPU suspend Shawn Guo 2011-09-01 15:33 ` Shawn Guo 2011-09-01 15:34 ` Russell King - ARM Linux 2011-09-01 15:34 ` Russell King - ARM Linux 2011-09-01 15:57 ` Shawn Guo 2011-09-01 15:57 ` Shawn Guo 2011-09-10 16:10 ` Shawn Guo 2011-09-10 16:10 ` Shawn Guo 2011-09-19 16:22 ` Russell King - ARM Linux 2011-09-19 16:22 ` Russell King - ARM Linux 2011-09-20 3:24 ` Shawn Guo 2011-09-20 3:24 ` Shawn Guo 2011-09-03 16:36 ` Santosh 2011-09-03 16:36 ` Santosh 2011-09-04 10:12 ` Russell King - ARM Linux 2011-09-04 10:12 ` Russell King - ARM Linux
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=E1Qz6jn-00078h-Ok@rmk-PC.arm.linux.org.uk \ --to=linux@arm.linux.org.uk \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-omap@vger.kernel.orglinux-arm-kernel \ --cc=santosh.shilimkar@ti.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.