From: Li Wei <liwei213@huawei.com>
To: ulf.hansson@linaro.org, adrian.hunter@intel.com,
jh80.chung@samsung.com, shawn.lin@rock-chips.com,
wsa+renesas@sang-engineering.com, hkallweit1@gmail.com,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: guodong.xu@linaro.org
Subject: [PATCH v9 1/2] mmc: dw_mmc: move controller reset before driver init
Date: Wed, 9 Aug 2017 11:25:18 +0800 [thread overview]
Message-ID: <20170809032519.96219-1-liwei213@huawei.com> (raw)
This commit modifies dw_mci_probe(), it moves reset assertion before
drv_data->init(host)
Some driver needs to access controller registers in its .init() ops. So,
in order to make such access safe, we should do controller reset before
.init() being called.
Signed-off-by: Wei Li <liwei213@huawei.com>
Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Chen Jun <chenjun14@huawei.com>
---
drivers/mmc/host/dw_mmc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index a9dfb26972f2..f2fa928e1a12 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -3067,6 +3067,12 @@ int dw_mci_probe(struct dw_mci *host)
goto err_clk_ciu;
}
+ if (!IS_ERR(host->pdata->rstc)) {
+ reset_control_assert(host->pdata->rstc);
+ usleep_range(10, 50);
+ reset_control_deassert(host->pdata->rstc);
+ }
+
if (drv_data && drv_data->init) {
ret = drv_data->init(host);
if (ret) {
@@ -3076,12 +3082,6 @@ int dw_mci_probe(struct dw_mci *host)
}
}
- if (!IS_ERR(host->pdata->rstc)) {
- reset_control_assert(host->pdata->rstc);
- usleep_range(10, 50);
- reset_control_deassert(host->pdata->rstc);
- }
-
setup_timer(&host->cmd11_timer,
dw_mci_cmd11_timer, (unsigned long)host);
--
2.11.0
next reply other threads:[~2017-08-09 3:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-09 3:25 Li Wei [this message]
2017-08-09 3:25 ` [PATCH v9 2/2] mmc: dw_mmc-k3: add sd support for hi3660 Li Wei
2017-08-09 3:47 ` Shawn Lin
[not found] ` <1699CE87DE933F49876AD744B5DC140FA0F515@DGGEMM506-MBS.china.huawei.com>
2017-08-10 0:45 ` 答复: " Shawn Lin
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=20170809032519.96219-1-liwei213@huawei.com \
--to=liwei213@huawei.com \
--cc=adrian.hunter@intel.com \
--cc=guodong.xu@linaro.org \
--cc=hkallweit1@gmail.com \
--cc=jh80.chung@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=ulf.hansson@linaro.org \
--cc=wsa+renesas@sang-engineering.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