All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudeep Holla <sudeep.holla@arm.com>
To: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>,
	linux-pm <linux-pm@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Kevin Hilman <khilman@kernel.org>,
	Thibaud Cornic <thibaud_cornic@sigmadesigns.com>,
	Mason <slash.tmp@free.fr>, Sebastian Frias <sf84@laposte.net>,
	Robin Murphy <robin.murphy@arm.com>
Subject: Re: [RFC PATCH v1] ARM: tango: add Suspend-to-RAM support
Date: Wed, 29 Jun 2016 18:48:18 +0100	[thread overview]
Message-ID: <577409E2.7020106@arm.com> (raw)
In-Reply-To: <5773D3FB.4030101@sigmadesigns.com>



On 29/06/16 14:58, Marc Gonzalez wrote:
> Ask firmware to put RAM in self-refresh mode and power system down.
>
>      echo mem > /sys/power/state
>
> See Documentation/power/states.txt
>
> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
> ---
> This is a RFC because I have a few doubts:
> 1) return value when tango_suspend() fails and unexpectedly returns (I used -EIO)
> 2) conditionally building pm.c (using CONFIG_SUSPEND? CONFIG_PM_SLEEP? other?)
> 3) .valid is required, right?
> ---
>   arch/arm/mach-tango/Makefile |  1 +
>   arch/arm/mach-tango/pm.c     | 37 +++++++++++++++++++++++++++++++++++++
>   arch/arm/mach-tango/smc.h    |  1 +
>   3 files changed, 39 insertions(+)
>   create mode 100644 arch/arm/mach-tango/pm.c
>
> diff --git a/arch/arm/mach-tango/Makefile b/arch/arm/mach-tango/Makefile
> index 7ca753aa9fb6..822b7ca803c6 100644
> --- a/arch/arm/mach-tango/Makefile
> +++ b/arch/arm/mach-tango/Makefile
> @@ -3,3 +3,4 @@ AFLAGS_smc.o := -Wa,-march=armv7-a$(plus_sec)
>
>   obj-y += setup.o smc.o xenv.o
>   obj-$(CONFIG_SMP) += platsmp.o
> +obj-$(CONFIG_SUSPEND) += pm.o
> diff --git a/arch/arm/mach-tango/pm.c b/arch/arm/mach-tango/pm.c
> new file mode 100644
> index 000000000000..08a39beaea09
> --- /dev/null
> +++ b/arch/arm/mach-tango/pm.c
> @@ -0,0 +1,37 @@
> +#include <linux/init.h>
> +#include <linux/suspend.h>
> +#include <asm/suspend.h>
> +#include "smc.h"
> +
> +static int tango_pm_powerdown(unsigned long arg)
> +{
> +	tango_suspend(virt_to_phys(cpu_resume));
> +
> +	return -EIO; /* tango_suspend has failed */
> +}
> +
> +static int tango_pm_enter(suspend_state_t state)
> +{
> +	if (state == PM_SUSPEND_MEM)
> +		return cpu_suspend(0, tango_pm_powerdown);
> +
> +	return -EINVAL;
> +}
> +
> +static int tango_pm_valid(suspend_state_t state)
> +{
> +	return state == PM_SUSPEND_MEM;
> +}
> +
> +static const struct platform_suspend_ops tango_pm_ops = {
> +	.enter = tango_pm_enter,
> +	.valid = tango_pm_valid,

You can use suspend_valid_only_mem instead which does exactly same thing.

-- 
Regards,
Sudeep

-- 
Regards,
Sudeep

WARNING: multiple messages have this Message-ID (diff)
From: sudeep.holla@arm.com (Sudeep Holla)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v1] ARM: tango: add Suspend-to-RAM support
Date: Wed, 29 Jun 2016 18:48:18 +0100	[thread overview]
Message-ID: <577409E2.7020106@arm.com> (raw)
In-Reply-To: <5773D3FB.4030101@sigmadesigns.com>



On 29/06/16 14:58, Marc Gonzalez wrote:
> Ask firmware to put RAM in self-refresh mode and power system down.
>
>      echo mem > /sys/power/state
>
> See Documentation/power/states.txt
>
> Signed-off-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
> ---
> This is a RFC because I have a few doubts:
> 1) return value when tango_suspend() fails and unexpectedly returns (I used -EIO)
> 2) conditionally building pm.c (using CONFIG_SUSPEND? CONFIG_PM_SLEEP? other?)
> 3) .valid is required, right?
> ---
>   arch/arm/mach-tango/Makefile |  1 +
>   arch/arm/mach-tango/pm.c     | 37 +++++++++++++++++++++++++++++++++++++
>   arch/arm/mach-tango/smc.h    |  1 +
>   3 files changed, 39 insertions(+)
>   create mode 100644 arch/arm/mach-tango/pm.c
>
> diff --git a/arch/arm/mach-tango/Makefile b/arch/arm/mach-tango/Makefile
> index 7ca753aa9fb6..822b7ca803c6 100644
> --- a/arch/arm/mach-tango/Makefile
> +++ b/arch/arm/mach-tango/Makefile
> @@ -3,3 +3,4 @@ AFLAGS_smc.o := -Wa,-march=armv7-a$(plus_sec)
>
>   obj-y += setup.o smc.o xenv.o
>   obj-$(CONFIG_SMP) += platsmp.o
> +obj-$(CONFIG_SUSPEND) += pm.o
> diff --git a/arch/arm/mach-tango/pm.c b/arch/arm/mach-tango/pm.c
> new file mode 100644
> index 000000000000..08a39beaea09
> --- /dev/null
> +++ b/arch/arm/mach-tango/pm.c
> @@ -0,0 +1,37 @@
> +#include <linux/init.h>
> +#include <linux/suspend.h>
> +#include <asm/suspend.h>
> +#include "smc.h"
> +
> +static int tango_pm_powerdown(unsigned long arg)
> +{
> +	tango_suspend(virt_to_phys(cpu_resume));
> +
> +	return -EIO; /* tango_suspend has failed */
> +}
> +
> +static int tango_pm_enter(suspend_state_t state)
> +{
> +	if (state == PM_SUSPEND_MEM)
> +		return cpu_suspend(0, tango_pm_powerdown);
> +
> +	return -EINVAL;
> +}
> +
> +static int tango_pm_valid(suspend_state_t state)
> +{
> +	return state == PM_SUSPEND_MEM;
> +}
> +
> +static const struct platform_suspend_ops tango_pm_ops = {
> +	.enter = tango_pm_enter,
> +	.valid = tango_pm_valid,

You can use suspend_valid_only_mem instead which does exactly same thing.

-- 
Regards,
Sudeep

-- 
Regards,
Sudeep

  reply	other threads:[~2016-06-29 17:48 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-29 13:58 [RFC PATCH v1] ARM: tango: add Suspend-to-RAM support Marc Gonzalez
2016-06-29 13:58 ` Marc Gonzalez
2016-06-29 17:48 ` Sudeep Holla [this message]
2016-06-29 17:48   ` Sudeep Holla
2016-06-30  8:44   ` [RFC PATCH v2] " Marc Gonzalez
2016-06-30  8:44     ` Marc Gonzalez
2016-07-04  9:01     ` Marc Gonzalez
2016-07-04  9:01       ` Marc Gonzalez
2016-07-07 13:08       ` [PATCH v3] " Marc Gonzalez
2016-07-07 13:08         ` Marc Gonzalez
2016-07-07 14:01         ` Arnd Bergmann
2016-07-07 14:01           ` Arnd Bergmann

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=577409E2.7020106@arm.com \
    --to=sudeep.holla@arm.com \
    --cc=khilman@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=marc_gonzalez@sigmadesigns.com \
    --cc=mark.rutland@arm.com \
    --cc=robin.murphy@arm.com \
    --cc=sf84@laposte.net \
    --cc=slash.tmp@free.fr \
    --cc=thibaud_cornic@sigmadesigns.com \
    --cc=thomas.petazzoni@free-electrons.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 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.