public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: snjw23@gmail•com (Sylwester Nawrocki)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 3/3] ARM: S3C64XX: Implement basic power domain support
Date: Fri, 02 Dec 2011 21:10:27 +0100	[thread overview]
Message-ID: <4ED930B3.3020200@gmail.com> (raw)
In-Reply-To: <1322765339-29879-3-git-send-email-broonie@opensource.wolfsonmicro.com>

Hi Mark,

good to see someone adding a proper power domain support for s3c64xx.

On 12/01/2011 07:48 PM, Mark Brown wrote:
> The S3C64xx SoCs contain a set of gateable power domains which can be
> enabled and disabled at runtime in order to save power.  Use the generic
> power domain code to implement support for these in software, enabling
> runtime control of most domains:
> 
>  - ETM (not supported in mainline).
>  - Domain G: 3D acceleration (no mainline support).
>  - Domain V: MFC (no mainline support).
>  - Domain I: JPEG and camera interface (no mainline support).
>  - Domain P: 2D acceleration, TV encoder and scaler (no mainline support)
>  - Domain S: Security (no mainline support).
>  - Domain F: LCD (driver already uses runtime PM), post processing and
>    rotation (no mainline support).
> 
> The IROM domain is marked as always enabled as we should arrange for it
> to be enabled when we suspend which will need a bit more work.
> 
> Due to all the conditional device registration that the platform does
> wrap s3c_pm_init() with s3c64xx_pm_init() which actually puts the device
> into the power domain after the machines have registered, looking for
> platform data to tell if the device was registered. Since currently only
> Cragganmore actually sets up PM that is the only machine updated.
> 
> Signed-off-by: Mark Brown <broonie@opensource•wolfsonmicro.com>
> ---
...
> +
> +static int s3c64xx_pd_on(struct generic_pm_domain *domain)
> +{
> +	struct s3c64xx_pm_domain *pd;
> +	u32 val;
> +	long retry = 1000000L;
> +
> +	pd = container_of(domain, struct s3c64xx_pm_domain, pd);
> +
> +	val = __raw_readl(S3C64XX_NORMAL_CFG);
> +	val |= pd->ena;
> +	__raw_writel(val, S3C64XX_NORMAL_CFG);
> +
> +	/* Not all domains provide power status readback */
> +	if (pd->pwr_stat) {
> +		while (retry--)
> +			if (__raw_readl(S3C64XX_BLK_PWR_STAT) & pd->pwr_stat)
> +				break;

How about adding cpu_relax() in this busy wait loop ?

> +		if (!retry) {
> +			pr_err("Failed to start domain %s\n", pd->name);
> +			return -EBUSY;
> +		}
> +	}
> +
> +	return 0;
> +}

--

Regards,
Sylwester

  parent reply	other threads:[~2011-12-02 20:10 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-01 18:48 [PATCH 1/3] PM: Provide an always on power domain governor Mark Brown
2011-12-01 18:48 ` [PATCH 2/3] ARM: mach-shmobile: Use common " Mark Brown
2011-12-01 20:37   ` Rafael J. Wysocki
2011-12-02  0:33     ` Mark Brown
2011-12-02 22:36       ` Rafael J. Wysocki
2011-12-03 11:03         ` Mark Brown
2011-12-03 22:31           ` Rafael J. Wysocki
2011-12-04  1:22             ` Mark Brown
2011-12-04 19:53               ` Rafael J. Wysocki
2011-12-04  1:24           ` [PATCH v2] " Mark Brown
2011-12-01 18:48 ` [PATCH 3/3] ARM: S3C64XX: Implement basic power domain support Mark Brown
2011-12-02  0:35   ` Kyungmin Park
2011-12-02  0:56     ` Mark Brown
2011-12-02 18:25       ` Tomasz Figa
2011-12-02 18:57         ` Mark Brown
2011-12-02 19:06           ` Tomasz Figa
2011-12-02 20:10   ` Sylwester Nawrocki [this message]
2011-12-02 21:07     ` Mark Brown
2011-12-07 21:44       ` Rafael J. Wysocki
2011-12-08  1:09         ` Mark Brown
2011-12-08 22:15           ` Rafael J. Wysocki
2011-12-08 22:22             ` Rafael J. Wysocki
2011-12-04 20:56 ` [PATCH 1/3] PM: Provide an always on power domain governor Rafael J. Wysocki
2011-12-04 23:10   ` Mark Brown
2011-12-05  0:15     ` Rafael J. Wysocki
2011-12-05  0:15       ` Mark Brown
2011-12-06 10:20         ` Kukjin Kim
2011-12-06 12:04           ` Marek Szyprowski
2011-12-06 14:33             ` Mark Brown
2011-12-06 21:39           ` Rafael J. Wysocki
2011-12-07 12:35             ` Mark Brown
2011-12-07 21:28               ` Rafael J. Wysocki
2011-12-08  0:40                 ` Mark Brown

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=4ED930B3.3020200@gmail.com \
    --to=snjw23@gmail$(echo .)com \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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