From: Andreas Fenkart <afenkart@gmail.com>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: "open list:ARM/Amlogic Meson..."
<linux-amlogic@lists.infradead.org>,
Ulf Hansson <ulf.hansson@linaro.org>,
linux-mmc <linux-mmc@vger.kernel.org>,
krzysztof.michonski@digitalstrom.com,
Kevin Hilman <khilman@baylibre.com>
Subject: Re: regression caused by: "amlogic: mmc: meson-gx: add signal resampling"
Date: Fri, 18 Jan 2019 11:05:51 +0100 [thread overview]
Message-ID: <CALtMJEC=MUp-rigViGP3LkAwBpqooVfhq1zHu7VrLZmmM6+qQA@mail.gmail.com> (raw)
In-Reply-To: <c0ab226f363d22f31e13db5ae0af85ea7f7b451e.camel@baylibre.com>
From 7ea0b63ddfc841251cbcc33c8ed0151e52e372f2 Mon Sep 17 00:00:00 2001
From: Andreas Fenkart <afenkart@gmail.com>
Date: Thu, 17 Jan 2019 15:39:52 +0100
Subject: [PATCH] mmc: meson-gx: enable signal re-sampling together with tuning
card detection fails on "BeeLink Mini M8 SII" if enabled too early
mmc1: error -110 whilst initialising MMC card
Fixes: 71645e65729f ("mmc: meson-gx: add signal resampling")
Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
---
drivers/mmc/host/meson-gx-mmc.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index c2690c1a50ff..dba499009d0c 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -738,6 +738,11 @@ static int meson_mmc_clk_phase_tuning(struct
mmc_host *mmc, u32 opcode,
static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
{
struct meson_host *host = mmc_priv(mmc);
+ int adj = 0;
+
+ /* enable signal resampling w/o delay */
+ adj = ADJUST_ADJ_EN;
+ writel(adj, host->regs + host->data->adjust);
return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk);
}
@@ -768,6 +773,9 @@ static void meson_mmc_set_ios(struct mmc_host
*mmc, struct mmc_ios *ios)
if (!IS_ERR(mmc->supply.vmmc))
mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
+ /* disable signal resampling */
+ writel(0, host->regs + host->data->adjust);
+
/* Reset rx phase */
clk_set_phase(host->rx_clk, 0);
@@ -1166,7 +1174,7 @@ static int meson_mmc_get_cd(struct mmc_host *mmc)
static void meson_mmc_cfg_init(struct meson_host *host)
{
- u32 cfg = 0, adj = 0;
+ u32 cfg = 0;
cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK,
ilog2(SD_EMMC_CFG_RESP_TIMEOUT));
@@ -1177,10 +1185,6 @@ static void meson_mmc_cfg_init(struct meson_host *host)
cfg |= CFG_ERR_ABORT;
writel(cfg, host->regs + SD_EMMC_CFG);
-
- /* enable signal resampling w/o delay */
- adj = ADJUST_ADJ_EN;
- writel(adj, host->regs + host->data->adjust);
}
static int meson_mmc_card_busy(struct mmc_host *mmc)
--
2.20.1
Am Do., 17. Jan. 2019 um 16:08 Uhr schrieb Jerome Brunet <jbrunet@baylibre.com>:
>
> On Thu, 2019-01-17 at 15:47 +0100, Andreas Fenkart wrote:
> > From: Andreas Fenkart <afenkart@gmail.com>
> > Date: Thu, 17 Jan 2019 15:39:52 +0100
> > Subject: [PATCH] mmc: meson-gx: enable signal re-sampling together with
> > tuning
> >
> > card detection fails on some p212 derived boards if enabled too early
>
> Please clearly mention what board you are using, this is too vague.
>
> > mmc1: error -110 whilst initialising MMC card
> >
>
> missing the 'Fixes' tag here
>
> > Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
> > ---
> > drivers/mmc/host/meson-gx-mmc.c | 16 ++++++++++------
> > 1 file changed, 10 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-
> > mmc.c
> > index c2690c1a50ff..b65ec4bea980 100644
> > --- a/drivers/mmc/host/meson-gx-mmc.c
> > +++ b/drivers/mmc/host/meson-gx-mmc.c
> > @@ -709,7 +709,8 @@ static int meson_mmc_find_tuning_point(unsigned long
> > *test)
> > static int meson_mmc_clk_phase_tuning(struct mmc_host *mmc, u32 opcode,
> > struct clk *clk)
> > {
> > - int point, ret;
> > + struct meson_host *host = mmc_priv(mmc);
> > + int point, ret, adj = 0;
> > DECLARE_BITMAP(test, CLK_PHASE_POINT_NUM);
> >
> > dev_dbg(mmc_dev(mmc), "%s phase/delay tunning...\n",
> > @@ -729,6 +730,10 @@ static int meson_mmc_clk_phase_tuning(struct
> > mmc_host *mmc, u32 opcode,
> > if (point < 0)
> > return point; /* tuning failed */
> >
> > + /* enable signal resampling w/o delay */
> > + adj = ADJUST_ADJ_EN;
> > + writel(adj, host->regs + host->data->adjust);
> > +
>
> That's really what I meant.
>
> Here, you are enabling the signal resampling after the tuning.
> Several boards won't tune without signal resampling.
>
> This should be done at the very beginning of the function at least.
> I would prefer if it was done in meson_mmc_execute_tuning() before calling
> meson_mmc_clk_phase_tuning()
>
> Signal resampling should not be dealt with in the unrelated phase tuning
> function
>
> > clk_set_phase(clk, point * CLK_PHASE_STEP);
> > dev_dbg(mmc_dev(mmc), "success with phase: %d\n",
> > clk_get_phase(clk));
> > @@ -768,6 +773,9 @@ static void meson_mmc_set_ios(struct mmc_host
> > *mmc, struct mmc_ios *ios)
> > if (!IS_ERR(mmc->supply.vmmc))
> > mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
> >
> > + /* disable signal resampling w/o delay */
>
> nitpick : 'disable signal resampling' is enough.
> when disabled, the delay does not matter.
>
> > + writel(0, host->regs + host->data->adjust);
> > +
> > /* Reset rx phase */
> > clk_set_phase(host->rx_clk, 0);
> >
> > @@ -1166,7 +1174,7 @@ static int meson_mmc_get_cd(struct mmc_host *mmc)
> >
> > static void meson_mmc_cfg_init(struct meson_host *host)
> > {
> > - u32 cfg = 0, adj = 0;
> > + u32 cfg = 0;
> >
> > cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK,
> > ilog2(SD_EMMC_CFG_RESP_TIMEOUT));
> > @@ -1177,10 +1185,6 @@ static void meson_mmc_cfg_init(struct meson_host
> > *host)
> > cfg |= CFG_ERR_ABORT;
> >
> > writel(cfg, host->regs + SD_EMMC_CFG);
> > -
> > - /* enable signal resampling w/o delay */
> > - adj = ADJUST_ADJ_EN;
> > - writel(adj, host->regs + host->data->adjust);
> > }
> >
> > static int meson_mmc_card_busy(struct mmc_host *mmc)
>
>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2019-01-18 10:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-16 10:13 regression caused by: "amlogic: mmc: meson-gx: add signal resampling" Andreas Fenkart
2019-01-16 11:14 ` Ulf Hansson
2019-01-16 13:12 ` Jerome Brunet
2019-01-17 12:35 ` Andreas Fenkart
2019-01-17 12:42 ` Neil Armstrong
2019-01-17 13:56 ` Andreas Fenkart
2019-01-17 14:11 ` Jerome Brunet
2019-01-17 14:47 ` Andreas Fenkart
2019-01-17 15:08 ` Jerome Brunet
2019-01-18 10:05 ` Andreas Fenkart [this message]
2019-01-18 10:26 ` Jerome Brunet
2019-01-18 13:32 ` [PATCH v2] mmc: meson-gx: enable signal re-sampling together with tuning Andreas Fenkart
2019-01-18 14:37 ` Jerome Brunet
2019-01-22 7:48 ` Ulf Hansson
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='CALtMJEC=MUp-rigViGP3LkAwBpqooVfhq1zHu7VrLZmmM6+qQA@mail.gmail.com' \
--to=afenkart@gmail.com \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=krzysztof.michonski@digitalstrom.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.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).