public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: b.zolnierkie@samsung.com (Bartlomiej Zolnierkiewicz)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 7/7] ARM: EXYNOS: cpuidle: add secure firmware support to AFTR mode code
Date: Mon, 02 Jun 2014 15:40:21 +0200	[thread overview]
Message-ID: <2929163.ygQuOcYWlC@amdc1032> (raw)
In-Reply-To: <538C78DB.1060809@gmail.com>

On Monday, June 02, 2014 03:15:07 PM Tomasz Figa wrote:
> Hi,
> 
> On 02.06.2014 14:35, Bartlomiej Zolnierkiewicz wrote:
> > * Use do_idle firmware method instead of cpu_do_idle() on boards with
> >   secure firmware enabled.
> > 
> > * Use sysram_ns_base_addr + 0x24 address for exynos_boot_vector_addr()
> >   and sysram_ns_base_addr + 0x20 one for exynos_boot_vector_flag() on
> >   boards with secure firmware enabled.
> > 
> > This patch fixes hang on an attempt to enter AFTR mode for TRATS2
> > board (which uses EXYNOS4412 SoC with secure firmware enabled).
> > 
> > This patch shouldn't cause any functionality changes on boards that
> > don't use secure firmware.
> > 
> > Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> > Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
> > ---
> >  arch/arm/mach-exynos/pm.c        | 8 ++++++--
> >  drivers/cpuidle/cpuidle-exynos.c | 7 ++++++-
> >  2 files changed, 12 insertions(+), 3 deletions(-)
> > 
> > diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
> > index 0fb9a5a..62a0a5e 100644
> > --- a/arch/arm/mach-exynos/pm.c
> > +++ b/arch/arm/mach-exynos/pm.c
> > @@ -169,7 +169,9 @@ int exynos_cluster_power_state(int cluster)
> >  
> >  static inline void __iomem *exynos_boot_vector_addr(void)
> >  {
> > -	if (samsung_rev() == EXYNOS4210_REV_1_1)
> > +	if (firmware_run())
> > +		return sysram_ns_base_addr + 0x24;
> > +	else if (samsung_rev() == EXYNOS4210_REV_1_1)
> 
> Aha, so this is the use case for the function added by patch 1/7.
> 
> Well, I don't see the need to do it this way and complicate the API. As
> I mentioned in my comments to patches 2/7 and 5/7, more general firmware
> operations should be taking care of setting those registers to
> appropriate values and so there shouldn't be any need to use them
> directly outside the implementation of firmware ops.

More general firmware operations would handle the secure firmware case
fine but how would you like to handle a fallback case given that you
cannot use samsung_rev() etc. in drivers/cpuidle/cpuidle-exynos.c?

> [snip]
> 
> >  static int idle_finisher(unsigned long flags)
> >  {
> >  	exynos_enter_aftr();
> > -	cpu_do_idle();
> > +	if (firmware_run())
> > +		/* no need to check the return value on EXYNOS SoCs */
> > +		call_firmware_op(do_idle, FW_DO_IDLE_AFTR);
> > +	else
> > +		cpu_do_idle();
> 
> This could be done just by
> 
> 	if (call_firmware_op(do_idle, FW_DO_IDLE_AFTR) == -ENOSYS)
> 		cpu_do_idle();
> 
> which is 3 lines less than with a function that is suppose to simplify
> the code.

OK.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

  reply	other threads:[~2014-06-02 13:40 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02 12:35 [PATCH v2 0/7] ARM: EXYNOS: cpuidle: fix AFTR mode on boards with secure firmware enabled Bartlomiej Zolnierkiewicz
2014-06-02 12:35 ` [PATCH v2 1/7] arm: firmware: Check firmware is running or not Bartlomiej Zolnierkiewicz
2014-06-02 12:51   ` Tomasz Figa
2014-06-02 13:05     ` Bartlomiej Zolnierkiewicz
2014-06-02 12:35 ` [PATCH v2 2/7] ARM: EXYNOS: add support for firmware-assisted c15resume Bartlomiej Zolnierkiewicz
2014-06-02 12:56   ` Tomasz Figa
2014-06-02 12:35 ` [PATCH v2 3/7] ARM: EXYNOS: add AFTR mode support to firmware do_idle method Bartlomiej Zolnierkiewicz
2014-06-02 13:01   ` Tomasz Figa
2014-06-02 12:35 ` [PATCH v2 4/7] ARM: EXYNOS: PM: replace EXYNOS_BOOT_VECTOR_* macros by static inlines Bartlomiej Zolnierkiewicz
2014-06-02 13:05   ` Tomasz Figa
2014-06-02 13:16     ` Bartlomiej Zolnierkiewicz
2014-06-02 16:13   ` Daniel Lezcano
2014-06-02 12:35 ` [PATCH v2 5/7] ARM: EXYNOS: PM: use c15resume firmware method if secure firmware is enabled Bartlomiej Zolnierkiewicz
2014-06-02 13:07   ` Tomasz Figa
2014-06-02 12:35 ` [PATCH v2 6/7] ARM: EXYNOS: PM: fix register setup on EXYNOS4x12 for AFTR mode code Bartlomiej Zolnierkiewicz
2014-06-02 13:10   ` Tomasz Figa
2014-06-02 12:35 ` [PATCH v2 7/7] ARM: EXYNOS: cpuidle: add secure firmware support to " Bartlomiej Zolnierkiewicz
2014-06-02 13:15   ` Tomasz Figa
2014-06-02 13:40     ` Bartlomiej Zolnierkiewicz [this message]
2014-06-02 16:28   ` Daniel Lezcano

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=2929163.ygQuOcYWlC@amdc1032 \
    --to=b.zolnierkie@samsung.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