linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lorenzo.pieralisi@arm.com (Lorenzo Pieralisi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 0/4] Generalize fncpy availability
Date: Tue, 20 Jun 2017 17:46:44 +0100	[thread overview]
Message-ID: <20170620164644.GF11351@red-moon> (raw)
In-Reply-To: <3834f2fa-5ac0-5b48-7c19-a1b68c1e9c65@gmail.com>

On Tue, Jun 20, 2017 at 09:20:34AM -0700, Florian Fainelli wrote:
> On 06/20/2017 02:10 AM, Lorenzo Pieralisi wrote:
> > [+Sudeep]
> > 
> > On Mon, Jun 19, 2017 at 10:32:38AM -0700, Florian Fainelli wrote:
> >> On 06/19/2017 05:24 AM, Mark Rutland wrote:
> >>> On Fri, Jun 16, 2017 at 05:07:40PM -0700, Florian Fainelli wrote:
> >>>> Hi all,
> >>>
> >>> Hi Florian,
> >>>
> >>>> This patch series makes ARM's fncpy() implementation more generic (dropping the
> >>>> Thumb-specifics) and available in an asm-generic header file.
> >>>>
> >>>> Tested on a Broadcom ARM64 STB platform with code that is written to SRAM.
> >>>>
> >>>> Changes in v3 (thanks Doug!):
> >>>> - correct include guard names in asm-generic/fncpy.h to __ASM_FNCPY_H
> >>>> - utilize Kbuild to provide the fncpy.h header on ARM64
> >>>>
> >>>> Changes in v2:
> >>>> - leave the ARM implementation where it is
> >>>> - make the generic truly generic (no)
> >>>>
> >>>> This is helpful in making SoC-specific power management code become true drivers
> >>>> that can be shared between different architectures.
> >>>> Could you elaborate on what this is needed for?
> >>
> >> Several uses cases come to mind:
> >>
> >> - it could be used as a trampoline code prior to entering S2 for systems
> >> that do not support PSCI 1.0
> > 
> > I think S2 here means PM_SUSPEND_MEM. It is very wrong to manage power
> > states through platform specific hooks on PSCI based systems, consider
> > upgrading to PSCI 1.0 please (or implement PSCI CPU_SUSPEND power
> > states that allow to achieve same power savings as PM_SUSPEND_MEM
> > by just entering suspend-to-idle).
> 
> S2 is PM_SUSPEND_STANDBY and S3 is PM_SUSPEND_MEM, at least that how I
> read it. I would rather we update to PSCI 1.0 (at least) to properly
> support SYSTEM_SUSPEND rather than retrofitting a system-wide suspend
> state into CPU_SUSPEND since that seems wrong.

I am not asking to retrofit anything, just implementing CPU_SUSPEND
according to platform capabilities, suspend-to-idle would allow you to
enter a system suspend state where all cores are in the deepest idle
state (which, as far as the core is concerned is identical to the state
reached on S2R). Upgrading to PSCI 1.0 is what has to be done anyway.

> >> - any code that has a specific need to relocate a performance, security
> >> sensitive code into SRAM and use it as another pool of memory.
> >>
> >>>
> >>> My understanding was that on 32-bit, this was to handle idle / suspend
> >>> cases, whereas for arm64 that should be handled by PSCI.
> >>
> >> For systems that support PSCI 1.0, I agree, but it may not be possible
> >> to update those systems easily, still use case 2 is completely valid.
> > 
> > Just to be clear, thinking of using platform specific suspend hooks
> > on PSCI systems is not a viable solution, I will let other people
> > comment on option 2.
> > 
> >>> what exactly do you intend to use this for?
> >>
> >> At the moment we use it to enter S2 on ARM64 systems (ARCH_BRCMSTB)
> > 
> > "At the moment", where ?
> 
> Obviously not in tree, since fncpy() is not available on ARM64, here is
> what it looks like for ARM & MIPS systems though:
> 
> http://lists.infradead.org/pipermail/linux-arm-kernel/2017-June/513953.html
> 
> > 
> >> which are PSCI 0.2 only. And yes, we do have a plan to evaluate
> >> upgrading to PSCI 1.0, but in general, any SoC which as an addressable
> >> SRAM could use it for whatever purpose it sees fit.
> > 
> > Not to implement suspend hooks on PSCI 0.2 systems.
> 
> You have made your point and it is very valid, still that does not mean
> fncpy() does not have any usefulness on ARM64 systems, this was one
> although not "ARM approved" use case (system suspend), but use case
> where you have code that should execute from SRAM is something that
> should be possible using the standard facilities offered in
> drives/misc/sram*.c

fncpy() won't be used to implement a suspend ops hook on ARM64, that's
the point I made so that it is clear from the beginning.

Thanks,
Lorenzo

  reply	other threads:[~2017-06-20 16:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-17  0:07 [PATCH v3 0/4] Generalize fncpy availability Florian Fainelli
2017-06-17  0:07 ` [PATCH v3 1/4] ARM: fncpy: Rename include guards Florian Fainelli
2017-06-17  0:07 ` [PATCH v3 2/4] asm-generic: Provide a fncpy() implementation Florian Fainelli
2017-06-18 23:51   ` Yury Norov
2017-06-19  1:11     ` Yury Norov
2017-06-19 15:18     ` Yury Norov
2017-06-19 17:27       ` Florian Fainelli
2017-06-19 17:43       ` Russell King - ARM Linux
2017-06-20 14:27         ` Yury Norov
2017-06-19 20:58     ` Florian Fainelli
2017-06-20 14:24       ` Yury Norov
2017-06-17  0:07 ` [PATCH v3 3/4] arm64: Provide a fncpy implementation Florian Fainelli
2017-06-17  0:07 ` [PATCH v3 4/4] misc: sram: Allow ARM64 to select SRAM_EXEC Florian Fainelli
2017-06-28 14:55   ` Mark Rutland
2017-06-19 12:24 ` [PATCH v3 0/4] Generalize fncpy availability Mark Rutland
2017-06-19 13:53   ` Tony Lindgren
2017-06-19 17:32   ` Florian Fainelli
2017-06-20  9:10     ` Lorenzo Pieralisi
2017-06-20 16:20       ` Florian Fainelli
2017-06-20 16:46         ` Lorenzo Pieralisi [this message]
2017-06-20 16:54         ` Sudeep Holla
2017-06-20 17:03           ` Florian Fainelli
2017-06-19 13:34 ` David Howells

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=20170620164644.GF11351@red-moon \
    --to=lorenzo.pieralisi@arm.com \
    --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).