From: Lukasz Luba <lukasz.luba@arm.com>
To: Bernard Zhao <bernard@vivo.com>, Kukjin Kim <kgene@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com
Subject: Re: [PATCH] memory/samsung: Maybe wrong triming parameter
Date: Thu, 7 May 2020 16:42:46 +0100 [thread overview]
Message-ID: <2eeb33f7-1acc-66bb-704a-b724fa0be0a8@arm.com> (raw)
In-Reply-To: <20200507114514.11589-1-bernard@vivo.com>
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>
Thank you Bernard for reporting and fixing this.
Regards,
Lukasz
next prev parent reply other threads:[~2020-05-07 15:42 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 [this message]
2020-05-08 14:46 ` Krzysztof Kozlowski
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=2eeb33f7-1acc-66bb-704a-b724fa0be0a8@arm.com \
--to=lukasz.luba@arm.com \
--cc=bernard@vivo.com \
--cc=kgene@kernel.org \
--cc=krzk@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=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