From: ulf.hansson@linaro.org (Ulf Hansson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmc: mediatek: make sure clock is enabled when executing ops->card_busy()
Date: Fri, 29 Jan 2016 11:23:39 +0100 [thread overview]
Message-ID: <CAPDyKFrv2dVarscYz79svnhBGMy2TYbgePKYyKw_dMJiWmLrUA@mail.gmail.com> (raw)
In-Reply-To: <1454009514-6474-1-git-send-email-chaotian.jing@mediatek.com>
On 28 January 2016 at 20:31, Chaotian Jing <chaotian.jing@mediatek.com> wrote:
> add pm_runtime_get_sync() before access MSDC_PS register
This isn't need as the mmc core does that when claiming the host, see
below commit.
>From that point there have been some additional fixup, as there were
actually some paths when to core invoked some of the host_ops
callbacks, without claiming the host. Although that should also have
been fixed now.
commit 9250aea76bfcbf4c2a7868e5566281bf2bb7af27
mmc: core: Enable runtime PM management of host devices
Kind regards
Uffe
>
> Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
> ---
> drivers/mmc/host/mtk-sd.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index 82a97ac..a56b16d 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -1054,13 +1054,15 @@ static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios)
> static int msdc_card_busy(struct mmc_host *mmc)
> {
> struct msdc_host *host = mmc_priv(mmc);
> - u32 status = readl(host->base + MSDC_PS);
> + u32 status;
>
> - /* check if any pin between dat[0:3] is low */
> - if (((status >> 16) & 0xf) != 0xf)
> - return 1;
> + pm_runtime_get_sync(host->dev);
> + status = readl(host->base + MSDC_PS);
> + pm_runtime_mark_last_busy(host->dev);
> + pm_runtime_put_autosuspend(host->dev);
>
> - return 0;
> + /* check if any pin between dat[0:3] is low */
> + return !!(((status >> 16) & 0xf) != 0xf);
> }
>
> static void msdc_request_timeout(struct work_struct *work)
> --
> 1.8.1.1.dirty
>
prev parent reply other threads:[~2016-01-29 10:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-28 19:31 [PATCH] mmc: mediatek: make sure clock is enabled when executing ops->card_busy() Chaotian Jing
2016-01-29 10:23 ` Ulf Hansson [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=CAPDyKFrv2dVarscYz79svnhBGMy2TYbgePKYyKw_dMJiWmLrUA@mail.gmail.com \
--to=ulf.hansson@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).