From: Thierry Reding <treding@nvidia.com>
To: Paul Walmsley <paul@pwsan.com>
Cc: <linux-soc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-tegra@vger.kernel.org>, Kumar Gala <galak@codeaurora.org>,
"Paul Walmsley" <pwalmsley@nvidia.com>,
Allen Martin <amartin@nvidia.com>,
"Stephen Warren" <swarren@nvidia.com>,
Alexandre Courbot <gnurou@gmail.com>
Subject: Re: [PATCH] soc: tegra: pmc: restrict compilation of suspend-related support to ARM
Date: Wed, 10 Dec 2014 12:23:23 +0100 [thread overview]
Message-ID: <20141210112322.GE15287@ulmo.nvidia.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1412092224050.31750@utopia.booyaka.com>
[-- Attachment #1: Type: text/plain, Size: 3246 bytes --]
On Tue, Dec 09, 2014 at 10:36:50PM +0000, Paul Walmsley wrote:
>
> Tegra SoCs with 64-bit ARM support don't currently support deep CPU
> low-power states in mainline Linux. When this support is added in the
> future, it will probably look rather different from the existing
> 32-bit ARM support, since the ARM64 maintainers' strong preference is
> to use PSCI to implement it.
>
> So, for the time being, prevent the CPU suspend-related code and data
> in the Tegra PMC driver from compiling on ARM64.
>
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com>
> Cc: Thierry Reding <treding@nvidia.com>
> Cc: Allen Martin <amartin@nvidia.com>
> Cc: Stephen Warren <swarren@nvidia.com>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> ---
> Applies on next-20141209.
> Intended for v3.20.
> Boot-tested on Tegra124 Jetson TK1 on next-20141209.
> Also boot-tested on Tegra132 Norrin FFD on next-20141209 + some unrelated
> patches.
>
> drivers/soc/tegra/pmc.c | 7 +++++--
> include/soc/tegra/pm.h | 2 +-
> 2 files changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
> index a2c0ceb95f8f..4bdc654bd747 100644
> --- a/drivers/soc/tegra/pmc.c
> +++ b/drivers/soc/tegra/pmc.c
> @@ -739,7 +739,7 @@ static int tegra_pmc_probe(struct platform_device *pdev)
> return 0;
> }
>
> -#ifdef CONFIG_PM_SLEEP
> +#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM)
I would slightly prefer having this as separate #ifdef lines to make it
clearer that we're special-casing 32-bit ARM.
> static int tegra_pmc_suspend(struct device *dev)
> {
> tegra_pmc_writel(virt_to_phys(tegra_resume), PMC_SCRATCH41);
> @@ -753,10 +753,11 @@ static int tegra_pmc_resume(struct device *dev)
>
> return 0;
> }
> -#endif
>
> static SIMPLE_DEV_PM_OPS(tegra_pmc_pm_ops, tegra_pmc_suspend, tegra_pmc_resume);
>
> +#endif
I don't think this is necessary, SIMPLE_DEV_PM_OPS will not use the
supend or resume hooks if PM_SLEEP is disabled. The result will be an
empty dev_pm_ops structure. While that's somewhat useless, at least
it'll allow...
> +
> static const char * const tegra20_powergates[] = {
> [TEGRA_POWERGATE_CPU] = "cpu",
> [TEGRA_POWERGATE_3D] = "3d",
> @@ -894,7 +895,9 @@ static struct platform_driver tegra_pmc_driver = {
> .name = "tegra-pmc",
> .suppress_bind_attrs = true,
> .of_match_table = tegra_pmc_match,
> +#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM)
> .pm = &tegra_pmc_pm_ops,
> +#endif
... this #ifdef to be avoided.
> },
> .probe = tegra_pmc_probe,
> };
> diff --git a/include/soc/tegra/pm.h b/include/soc/tegra/pm.h
> index 30fe2078a547..03909101d4e7 100644
> --- a/include/soc/tegra/pm.h
> +++ b/include/soc/tegra/pm.h
> @@ -17,7 +17,7 @@ enum tegra_suspend_mode {
> TEGRA_MAX_SUSPEND_MODE,
> };
>
> -#ifdef CONFIG_PM_SLEEP
> +#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_ARM)
Similarly to the above, I'd prefer this to be two separate lines. That
also has the advantage that if we do add code for suspend/resume on 64
bit ARM later on we don't need to untangle the conditional again.
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-12-10 11:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-09 22:36 [PATCH] soc: tegra: pmc: restrict compilation of suspend-related support to ARM Paul Walmsley
2014-12-10 11:23 ` Thierry Reding [this message]
2014-12-12 3:04 ` Paul Walmsley
2015-01-07 14:33 ` Thierry Reding
2015-01-07 15:24 ` Dmitry Osipenko
2015-01-07 15:55 ` Dmitry Osipenko
2015-01-08 8:49 ` Thierry Reding
2015-01-08 9:42 ` Dmitry Osipenko
2015-01-08 10:58 ` Thierry Reding
2015-01-08 11:23 ` Dmitry Osipenko
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=20141210112322.GE15287@ulmo.nvidia.com \
--to=treding@nvidia.com \
--cc=amartin@nvidia.com \
--cc=galak@codeaurora.org \
--cc=gnurou@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=pwalmsley@nvidia.com \
--cc=swarren@nvidia.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).