public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: t.figa@samsung.com (Tomasz Figa)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] ARM: EXYNOS5: save CLK_TOP_SRC3 register before powergating
Date: Thu, 27 Dec 2012 15:51:20 +0100	[thread overview]
Message-ID: <2189333.1zyqbQ2mTY@amdc1227> (raw)
In-Reply-To: <CAJuYYwQ7W-1DKbECW1LASVEwXdcZhs09ksx0ppsaphA=YkWeeQ@mail.gmail.com>

Hi Thomas,

On Tuesday 04 of December 2012 14:29:24 Thomas Abraham wrote:
> On 27 November 2012 17:52, Prasanna Kumar <prasanna.ps@samsung.com> 
wrote:
> > From: Prasanna Kumar <prasanna.ps@samsung.com>
> > 
> > This patch adds a software workaround to the hardware
> > problem found in exynos5 while powergating.
> > 
> > It is observed that CLK_TOP_SRC3 register gets modified if
> > the G-Scaler/MFC devices are power gated. The clock for G-Scaler gets
> > set to XXTI which results in the device running very slow .
> > A big drop in performance is noticed whilerunning the video.
> > This issue also occurs while powergating MFC.
> > 
> > The value of clock source register is restored once the powergating
> > operation is completed.
> > 
> > Signed-off-by: Prasanna Kumar <prasanna.ps@samsung.com>
> > ---
> > 
> >  arch/arm/mach-exynos/pm_domains.c |   27 +++++++++++++++++++++++++++
> >  1 files changed, 27 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/arm/mach-exynos/pm_domains.c
> > b/arch/arm/mach-exynos/pm_domains.c index 9f1351d..955cbe3 100644
> > --- a/arch/arm/mach-exynos/pm_domains.c
> > +++ b/arch/arm/mach-exynos/pm_domains.c
> > @@ -24,6 +24,8 @@
> > 
> >  #include <mach/regs-pmu.h>
> >  #include <plat/devs.h>
> > 
> > +#include <mach/regs-clock.h>
> > +#include <plat/cpu.h>
> > 
> >  /*
> >  
> >   * Exynos specific wrapper around the generic power domain
> > 
> > @@ -41,6 +43,7 @@ static int exynos_pd_power(struct generic_pm_domain
> > *domain, bool power_on)> 
> >         void __iomem *base;
> >         u32 timeout, pwr;
> >         char *op;
> > 
> > +       u32 tmp = 0;
> > 
> >         pd = container_of(domain, struct exynos_pm_domain, pd);
> >         base = pd->base;
> > 
> > @@ -48,6 +51,23 @@ static int exynos_pd_power(struct generic_pm_domain
> > *domain, bool power_on)> 
> >         pwr = power_on ? S5P_INT_LOCAL_PWR_EN : 0;
> >         __raw_writel(pwr, base);
> > 
> > +       /*
> > +        *It is found that the CLK SRC register in exynos5
> > +        *gets modified when power domain of gsc/mfc/isp/disp1
> > +        *is powered off.This happens only after the system is
> > +        *suspended and resumed and not before that.
> > +        *The following fix adresses this hardware issue.
> > +        *It saves the value of clock source register and
> > +        *resores it later
> > +        */
> > +
> > +       if (soc_is_exynos5250()) {
> > +               if (!power_on) {
> > +                       /* save clock source register */
> > +                       tmp = __raw_readl(EXYNOS5_CLKSRC_TOP3);
> > +               }
> > +       }
> 
> Does the value of EXYNOS5_CLKSRC_TOP3 register change as soon as the
> G-Scaler/MFC devices are power gated?
> 
> - If yes, the value of CLKSRC register should be saved before the
> power domain register is programmed.
> 
> - If not, as mentioned in the comment, if this issue occurs during a
> suspend-resume cycle, the value of this register can be saved and
> restored in the clock driver code itself.
> 
> The other thing that needs to be relooked into here is the use of
> EXYNOS5_CLKSRC_TOP3 register address. Currently, the clock registers
> are statically io-remapped. With the upcoming migration to common
> clock for Exynos5, the clock registers will not be statically
> io-remapped but instead remapped during clock initialization. So the
> use of EXYNOS5_CLKSRC_TOP3 will not hold and so we need to relook into
> this.
> 
> > +
> > 
> >         /* Wait max 1ms */
> >         timeout = 10;
> > 
> > @@ -61,6 +81,13 @@ static int exynos_pd_power(struct generic_pm_domain
> > *domain, bool power_on)> 
> >                 cpu_relax();
> >                 usleep_range(80, 100);
> >         
> >         }
> > 
> > +
> > +       if (soc_is_exynos5250()) {
> 
> We could use the of_machine_is_compatible api here instead of
> soc_is_exynos5250() macro.

I don't think that of_machine_is_compatible() is preferred over 
soc_is_xxx(). The former has dependencies on OF support and requires
a string comparison, while the latter is just a single integer check.

Best regards,
-- 
Tomasz Figa
Samsung Poland R&D Center
SW Solution Development, Linux Platform

      parent reply	other threads:[~2012-12-27 14:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27 12:22 [PATCH 0/3]ARM: Exynos5 : Add Power domain device tree support and fix for hardware issue Prasanna Kumar
2012-11-27 12:22 ` [PATCH 1/3] ARM: dts: exynos5: Set up power domain for MFC and G-scaler Prasanna Kumar
2012-12-04  9:05   ` Thomas Abraham
2012-11-27 12:22 ` [PATCH 2/3] arm: exynos5: Enable PM generic domain support in Kconfig Prasanna Kumar
2012-12-04  9:07   ` Thomas Abraham
2012-11-27 12:22 ` [PATCH 3/3] ARM: EXYNOS5: save CLK_TOP_SRC3 register before powergating Prasanna Kumar
2012-12-04  8:59   ` Thomas Abraham
2012-12-07 12:49     ` Prasanna Kumar
2012-12-20 12:26       ` [PATCH v2 0/3] ARM: Exynos5 : Add Power domain device tree support and fix for hardware issue Prasanna Kumar
2012-12-20 12:26       ` [PATCH v2 1/3] ARM: dts: exynos5: Set up power domain for MFC,G-scaler,MAU and ISP Prasanna Kumar
2012-12-27  4:58         ` Prasanna Kumar
2012-12-20 12:26       ` [PATCH v2 2/3] arm: exynos5: Enable PM generic domain support in Kconfig Prasanna Kumar
2012-12-20 12:26       ` [PATCH v2 3/3] ARM: EXYNOS5: save CLK_TOP_SRC3 register before powergating Prasanna Kumar
2012-12-20 21:06         ` tomasz.figa at gmail.com
2012-12-21  1:37           ` jonghwan Choi
2012-12-24  4:26             ` Prasanna Kumar
2012-12-24  5:42               ` Prasanna Kumar
2012-12-24  4:18           ` Prasanna Kumar
2012-12-27 15:23         ` Tomasz Figa
2012-12-27 14:51     ` Tomasz Figa [this message]

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=2189333.1zyqbQ2mTY@amdc1227 \
    --to=t.figa@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