linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v7 2/2] ARM hibernation / suspend-to-disk
Date: Thu, 6 Mar 2014 20:42:51 -0800	[thread overview]
Message-ID: <20140307044251.GD9985@codeaurora.org> (raw)
In-Reply-To: <1394016605-24120-3-git-send-email-sebastian.capella@linaro.org>

On 03/05, Sebastian Capella wrote:
> diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h
> index 8756e4b..d32adbb 100644
> --- a/arch/arm/include/asm/memory.h
> +++ b/arch/arm/include/asm/memory.h
> @@ -291,6 +291,7 @@ static inline void *phys_to_virt(phys_addr_t x)
>   */
>  #define __pa(x)			__virt_to_phys((unsigned long)(x))
>  #define __va(x)			((void *)__phys_to_virt((phys_addr_t)(x)))
> +#define __pa_symbol(x)		__pa((unsigned long)(x))

Thanks for removing RELOC_HIDE, as Russell already stated it's
never been necessary on ARM.

Looking at this definition now it doesn't look right. Isn't
&__nosave_begin a virtual address? Casting it to an unsigned long
isn't going to give you a physical address. Why can't we use
__pa()?

> +extern const void __nosave_begin, __nosave_end;
> +
> +int pfn_is_nosave(unsigned long pfn)
> +{
> +	unsigned long nosave_begin_pfn =
> +			__pa_symbol(&__nosave_begin) >> PAGE_SHIFT;
> +	unsigned long nosave_end_pfn =
> +			PAGE_ALIGN(__pa_symbol(&__nosave_end)) >> PAGE_SHIFT;
> +
> +	return (pfn >= nosave_begin_pfn) && (pfn < nosave_end_pfn);
> +}

Perhaps this code could be:

	unsigned long nosave_begin_pfn = virt_to_pfn(&__nosave_begin);
	unsigned long nosave_end_pfn = virt_to_pfn(&__nosave_end);

	return (pfn >= nosave_begin_pfn) && (pfn <= nosave_end_pfn);

or if virt_to_pfn() doesn't exist on ARM and we can't add it for
some reason:

	unsigned long nosave_begin_pfn = __phys_to_pfn(__pa(&__nosave_begin));
	unsigned long nosave_end_pfn = __phys_to_pfn(__pa(&__nosave_end));

	return (pfn >= nosave_begin_pfn) && (pfn <= nosave_end_pfn);

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

  parent reply	other threads:[~2014-03-07  4:42 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-05 10:50 [PATCH v7 0/2] hibernation support on ARM Sebastian Capella
2014-03-05 10:50 ` [PATCH v7 1/2] ARM: avoid tracers in soft_restart Sebastian Capella
2014-03-06 23:45   ` Sebastian Capella
2014-03-19 23:26     ` Sebastian Capella
2014-03-05 10:50 ` [PATCH v7 2/2] ARM hibernation / suspend-to-disk Sebastian Capella
2014-03-07  4:21   ` Sebastian Capella
2014-03-07  4:42   ` Stephen Boyd [this message]
2014-03-10 18:32     ` Sebastian Capella
2014-03-16  9:46       ` Russell King - ARM Linux
2014-03-17 22:07         ` Sebastian Capella
2014-03-16  7:09   ` Ezequiel Garcia
2014-03-17 19:10     ` Sebastian Capella
2014-03-17 20:44       ` Ezequiel Garcia
2014-03-17 22:39         ` Sebastian Capella
2014-03-19 15:44           ` Ezequiel Garcia
2014-03-19 20:47             ` Sebastian Capella
2014-03-19 21:06               ` Sebastian Capella
2014-03-24 18:06                 ` Sebastian Capella
2014-03-25 18:38                 ` Alexander Holler
2014-03-25 18:48                   ` Sebastian Capella
2014-03-25 23:36                   ` Alexander Holler
2014-03-26  0:00                     ` Alexander Holler
2014-03-20  3:02             ` TonyHo
2014-03-20 17:26               ` Sebastian Capella
2014-04-16 10:12   ` Russell King - ARM Linux
2014-04-16 16:42     ` Sebastian Capella
2014-04-17 20:38       ` Sebastian Capella
2014-04-23  0:38         ` Sebastian Capella
2014-04-23 16:39           ` Sebastian Capella
2014-05-07 15:37             ` Pavel Machek
2014-05-07 22:20               ` Sebastian Capella

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=20140307044251.GD9985@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).