Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755030AbbBQKW6 (ORCPT ); Tue, 17 Feb 2015 05:22:58 -0500 Received: from down.free-electrons.com ([37.187.137.238]:33334 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753981AbbBQKW5 (ORCPT ); Tue, 17 Feb 2015 05:22:57 -0500 Date: Tue, 17 Feb 2015 11:22:55 +0100 From: Alexandre Belloni To: Wenyou Yang Cc: nicolas.ferre@atmel.com, linux@maxim.org.za, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sylvain.rochet@finsecur.com, patrice.vilchez@atmel.com, sergei.shtylyov@cogentembedded.com, mark.rutland@arm.com, lorenzo.pieralisi@arm.com Subject: Re: [PATCH 1/3] pm: at91: pm_suspend: add the WFI instruction support for ARMv7 Message-ID: <20150217102255.GB11529@piout.net> References: <1423709441-8342-1-git-send-email-wenyou.yang@atmel.com> <1423709486-8382-1-git-send-email-wenyou.yang@atmel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1423709486-8382-1-git-send-email-wenyou.yang@atmel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1569 Lines: 62 On 12/02/2015 at 10:51:26 +0800, Wenyou Yang wrote : > Add the WFI instruction to make the cpu to the idle state. > In the meanwhile, disable the processor's clock. > > Signed-off-by: Wenyou Yang Acked-by: Alexandre Belloni > --- > arch/arm/mach-at91/pm_suspend.S | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-at91/pm_suspend.S b/arch/arm/mach-at91/pm_suspend.S > index bebe3de..1c7256a 100644 > --- a/arch/arm/mach-at91/pm_suspend.S > +++ b/arch/arm/mach-at91/pm_suspend.S > @@ -51,6 +51,24 @@ tmp2 .req r5 > beq 1b > .endm > > +/* > + * Put the processor to enter the idle state > + */ > + .macro at91_cpu_idle > + > +#if defined(CONFIG_CPU_V7) > + mov tmp1, #AT91_PMC_PCK > + str tmp1, [pmc, #AT91_PMC_SCDR] > + > + dsb > + > + wfi @ Wait For Interrupt > +#else > + mcr p15, 0, tmp1, c7, c0, 4 > +#endif > + > + .endm > + > .text > > /* > @@ -120,7 +138,7 @@ skip_disable_main_clock: > ldr pmc, .pmc_base > > /* Wait for interrupt */ > - mcr p15, 0, tmp1, c7, c0, 4 > + at91_cpu_idle > > ldr r0, .pm_mode > tst r0, #AT91_PM_SLOW_CLOCK > -- > 1.7.9.5 > -- Alexandre Belloni, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/