From: Chaotian Jing <chaotian.jing@mediatek.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
Jens Axboe <axboe@kernel.dk>, Hannes Reinecke <hare@suse.de>,
Chaotian Jing <chaotian.jing@mediatek.com>,
Avri Altman <avri.altman@wdc.com>,
YueHaibing <yuehaibing@huawei.com>,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Ming Lei <ming.lei@redhat.com>, Chris Boot <bootc@bootc.net>,
Zachary Hays <zhays@lexmark.com>, <linux-mmc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
<srv_heupstream@mediatek.com>
Subject: [PATCH v2 1/2] mmc: block: make the card_busy_detect() more generic
Date: Thu, 5 Sep 2019 15:53:17 +0800 [thread overview]
Message-ID: <20190905075318.15554-2-chaotian.jing@mediatek.com> (raw)
In-Reply-To: <20190905075318.15554-1-chaotian.jing@mediatek.com>
to use the card_busy_detect() to wait card levae the programming state,
there may be do not have the "struct request *" argument.
Signed-off-by: Chaotian Jing <chaotian.jing@mediatek.com>
---
drivers/mmc/core/block.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 2c71a434c915..aa7c19f7e298 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -981,7 +981,7 @@ static inline bool mmc_blk_in_tran_state(u32 status)
}
static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
- struct request *req, u32 *resp_errs)
+ u32 *resp_errs)
{
unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms);
int err = 0;
@@ -992,8 +992,8 @@ static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
err = __mmc_send_status(card, &status, 5);
if (err) {
- pr_err("%s: error %d requesting status\n",
- req->rq_disk->disk_name, err);
+ dev_err(mmc_dev(card->host),
+ "error %d requesting status\n", err);
return err;
}
@@ -1006,9 +1006,9 @@ static int card_busy_detect(struct mmc_card *card, unsigned int timeout_ms,
* leaves the program state.
*/
if (done) {
- pr_err("%s: Card stuck in wrong state! %s %s status: %#x\n",
- mmc_hostname(card->host),
- req->rq_disk->disk_name, __func__, status);
+ dev_err(mmc_dev(card->host),
+ "Card stuck in wrong state! %s status: %#x\n",
+ __func__, status);
return -ETIMEDOUT;
}
@@ -1671,7 +1671,7 @@ static int mmc_blk_fix_state(struct mmc_card *card, struct request *req)
mmc_blk_send_stop(card, timeout);
- err = card_busy_detect(card, timeout, req, NULL);
+ err = card_busy_detect(card, timeout, NULL);
mmc_retune_release(card->host);
@@ -1895,7 +1895,7 @@ static int mmc_blk_card_busy(struct mmc_card *card, struct request *req)
if (mmc_host_is_spi(card->host) || rq_data_dir(req) == READ)
return 0;
- err = card_busy_detect(card, MMC_BLK_TIMEOUT_MS, req, &status);
+ err = card_busy_detect(card, MMC_BLK_TIMEOUT_MS, &status);
/*
* Do not assume data transferred correctly if there are any error bits
--
2.18.0
next prev parent reply other threads:[~2019-09-05 7:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 7:53 [PATCH v2] fix device in programming state after ioctl() Chaotian Jing
2019-09-05 7:53 ` Chaotian Jing [this message]
2019-09-05 8:43 ` [PATCH v2 1/2] mmc: block: make the card_busy_detect() more generic Avri Altman
2019-09-05 7:53 ` [PATCH v2 2/2] mmc: block: add CMD13 polling for ioctl() cmd with R1B response Chaotian Jing
2019-09-05 8:44 ` Avri Altman
2019-10-21 11:43 ` 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=20190905075318.15554-2-chaotian.jing@mediatek.com \
--to=chaotian.jing@mediatek.com \
--cc=avri.altman@wdc.com \
--cc=axboe@kernel.dk \
--cc=bootc@bootc.net \
--cc=hare@suse.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=ming.lei@redhat.com \
--cc=srv_heupstream@mediatek.com \
--cc=ulf.hansson@linaro.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=yuehaibing@huawei.com \
--cc=zhays@lexmark.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).