linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Lukasz Luba <lukasz.luba@arm.com>
Cc: opensource.kernel@vivo.com, linux-samsung-soc@vger.kernel.org,
	linux-pm@vger.kernel.org, Bernard Zhao <bernard@vivo.com>,
	linux-kernel@vger.kernel.org, Kukjin Kim <kgene@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] memory/samsung: Maybe wrong triming parameter
Date: Fri, 8 May 2020 16:46:10 +0200	[thread overview]
Message-ID: <20200508144610.GA5983@kozik-lap> (raw)
In-Reply-To: <2eeb33f7-1acc-66bb-704a-b724fa0be0a8@arm.com>

On Thu, May 07, 2020 at 04:42:46PM +0100, Lukasz Luba wrote:
> Hi Bernard,
> 
> 
> On 5/7/20 12:45 PM, Bernard Zhao wrote:
> > In function create_timings_aligned, all the max is to use
> > dmc->min_tck->xxx, aligned with val dmc->timings->xxx.
> > But the dmc->timings->tFAW use dmc->min_tck->tXP?
> > Maybe this point is wrong parameter useing.
> > 
> > Signed-off-by: Bernard Zhao <bernard@vivo.com>
> > ---
> >   drivers/memory/samsung/exynos5422-dmc.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
> > index 81a1b1d01683..22a43d662833 100644
> > --- a/drivers/memory/samsung/exynos5422-dmc.c
> > +++ b/drivers/memory/samsung/exynos5422-dmc.c
> > @@ -1091,7 +1091,7 @@ static int create_timings_aligned(struct exynos5_dmc *dmc, u32 *reg_timing_row,
> >   	/* power related timings */
> >   	val = dmc->timings->tFAW / clk_period_ps;
> >   	val += dmc->timings->tFAW % clk_period_ps ? 1 : 0;
> > -	val = max(val, dmc->min_tck->tXP);
> > +	val = max(val, dmc->min_tck->tFAW);
> >   	reg = &timing_power[0];
> >   	*reg_timing_power |= TIMING_VAL2REG(reg, val);
> > 
> 
> Good catch! Indeed this should be a dmc->min_tck->tFAW used for
> clamping.
> 
> It didn't show up in testing because the frequency values based on
> which the 'clk_period_ps' are calculated are sane.
> Check the dump below:
> 
> [    5.458227] DMC: mem tFAW=25000, clk_period_ps=6060
> [    5.461743] DMC: tFAW=5, tXP=2 val=5
> [    5.465273] DMC: mem tFAW=25000, clk_period_ps=4854
> [    5.470101] DMC: tFAW=5, tXP=2 val=6
> [    5.473668] DMC: mem tFAW=25000, clk_period_ps=3636
> [    5.478507] DMC: tFAW=5, tXP=2 val=7
> [    5.482072] DMC: mem tFAW=25000, clk_period_ps=2421
> [    5.486951] DMC: tFAW=5, tXP=2 val=11
> [    5.490531] DMC: mem tFAW=25000, clk_period_ps=1841
> [    5.495439] DMC: tFAW=5, tXP=2 val=14
> [    5.499113] DMC: mem tFAW=25000, clk_period_ps=1579
> [    5.503877] DMC: tFAW=5, tXP=2 val=16
> [    5.507476] DMC: mem tFAW=25000, clk_period_ps=1373
> [    5.512368] DMC: tFAW=5, tXP=2 val=19
> [    5.515968] DMC: mem tFAW=25000, clk_period_ps=1212
> [    5.520826] DMC: tFAW=5, tXP=2 val=21
> 
> That's why in the existing configuration it does not harm
> (the calculated 'val' is always >= 5) the board.
> 
> But I think this patch should be applied (after small changes in the
> commit message).
> 
> @Krzysztof could you have a look on the commit message or take the
> patch with small adjustment in the description, please?
> 
> I conditionally give (because of this description):
> 
> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>

Thanks for review.

I applied patch with CC-stable and adjusred commit msg.

Best regards,
Krzysztof


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2020-05-08 14:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 11:45 [PATCH] memory/samsung: Maybe wrong triming parameter Bernard Zhao
2020-05-07 15:42 ` Lukasz Luba
2020-05-08 14:46   ` Krzysztof Kozlowski [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=20200508144610.GA5983@kozik-lap \
    --to=krzk@kernel.org \
    --cc=bernard@vivo.com \
    --cc=kgene@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=lukasz.luba@arm.com \
    --cc=opensource.kernel@vivo.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).