linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: wzch <wzch@marvell.com>
To: Russell King <linux@arm.linux.org.uk>,
	Dave Martin <dave.martin@linaro.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: Wenzeng Chen <wzch@marvell.com>
Subject: [PATCH] ARM: suspend: use flush range instead of flush all
Date: Wed, 12 Sep 2012 15:18:48 +0800	[thread overview]
Message-ID: <1347434328-7207-1-git-send-email-wzch@marvell.com> (raw)

From: Wenzeng Chen <wzch@marvell.com>

In cpu suspend function __cpu_suspend_save(), we save cp15 registers,
resume function, sp and suspend_pgd, then flush the data to DDR, but
no need to flush all D cache, only need to flush range.

Change-Id: I591a1fde929f3f987c69306b601843ed975d3e41
Signed-off-by: Wenzeng Chen <wzch@marvell.com>
---
 arch/arm/kernel/suspend.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/arm/kernel/suspend.c b/arch/arm/kernel/suspend.c
index 1794cc3..bb582d8 100644
--- a/arch/arm/kernel/suspend.c
+++ b/arch/arm/kernel/suspend.c
@@ -17,6 +17,7 @@ extern void cpu_resume_mmu(void);
  */
 void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
 {
+	u32 *ptr_orig = ptr;
 	*save_ptr = virt_to_phys(ptr);
 
 	/* This must correspond to the LDM in cpu_resume() assembly */
@@ -26,7 +27,8 @@ void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr)
 
 	cpu_do_suspend(ptr);
 
-	flush_cache_all();
+	__cpuc_flush_dcache_area((void *)ptr_orig, ptrsz);
+	__cpuc_flush_dcache_area((void *)save_ptr, sizeof(*save_ptr));
 	outer_clean_range(*save_ptr, *save_ptr + ptrsz);
 	outer_clean_range(virt_to_phys(save_ptr),
 			  virt_to_phys(save_ptr) + sizeof(*save_ptr));
-- 
1.7.1


             reply	other threads:[~2012-09-12  7:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12  7:18 wzch [this message]
2012-09-12  7:43 ` [PATCH] ARM: suspend: use flush range instead of flush all Shilimkar, Santosh
2012-09-12  8:54   ` Russell King - ARM Linux
2012-09-12  9:10     ` Shilimkar, Santosh
2012-09-12  9:46       ` Russell King - ARM Linux
2012-09-12  9:57         ` Shilimkar, Santosh
2012-09-13  2:20         ` Raul Xiong
2012-09-13  8:52           ` Russell King - ARM Linux
2012-09-12  8:58   ` Lorenzo Pieralisi
2012-09-12  9:20     ` Shilimkar, Santosh

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=1347434328-7207-1-git-send-email-wzch@marvell.com \
    --to=wzch@marvell.com \
    --cc=catalin.marinas@arm.com \
    --cc=dave.martin@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=will.deacon@arm.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).