From: Bean Huo <huobean@gmail.com>
To: ulf.hansson@linaro.org, adrian.hunter@intel.com,
linus.walleij@linaro.org, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: beanhuo@micron.com, stable <stable@vger.kernel.org>
Subject: [PATCH v1 2/2] mmc: core: Allows to override the timeout value for ioctl() path
Date: Sun, 24 Apr 2022 00:16:23 +0200 [thread overview]
Message-ID: <20220423221623.1074556-3-huobean@gmail.com> (raw)
In-Reply-To: <20220423221623.1074556-1-huobean@gmail.com>
From: Bean Huo <beanhuo@micron.com>
Occasionally, user-land applications initiate longer timeout values for certain commands
through ioctl() system call. But so far we are still using a fixed timeout of 10 seconds
in mmc_poll_for_busy() on the ioctl() path, even if a custom timeout is specified in the
userspace application. This patch allows custom timeout values to override this default
timeout values on the ioctl path.
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bean Huo <beanhuo@micron.com>
---
drivers/mmc/core/block.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index b35e7a95798b..6cb701aa1abc 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -609,11 +609,11 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
if (idata->rpmb || (cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
/*
- * Ensure RPMB/R1B command has completed by polling CMD13
- * "Send Status".
+ * Ensure RPMB/R1B command has completed by polling CMD13 "Send Status". Here we
+ * allow to override the default timeout value if a custom timeout is specified.
*/
- err = mmc_poll_for_busy(card, MMC_BLK_TIMEOUT_MS, false,
- MMC_BUSY_IO);
+ err = mmc_poll_for_busy(card, idata->ic.cmd_timeout_ms ? : MMC_BLK_TIMEOUT_MS,
+ false, MMC_BUSY_IO);
}
return err;
--
2.34.1
next prev parent reply other threads:[~2022-04-23 22:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-23 22:16 [PATCH v1 0/2] Two changes for eMMC Bean Huo
2022-04-23 22:16 ` [PATCH v1 1/2] mmc: sdhci-omap: Use of_device_get_match_data() helper Bean Huo
2022-04-26 13:55 ` Ulf Hansson
2022-04-23 22:16 ` Bean Huo [this message]
2022-04-24 11:52 ` [PATCH v1 2/2] mmc: core: Allows to override the timeout value for ioctl() path Avri Altman
2022-04-24 13:29 ` Linus Walleij
2022-04-25 20:01 ` Bean Huo
2022-04-25 20:15 ` Linus Walleij
2022-04-26 13:32 ` Ulf Hansson
2022-04-26 13:55 ` Ulf Hansson
2022-04-26 15:35 ` Linus Walleij
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=20220423221623.1074556-3-huobean@gmail.com \
--to=huobean@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=beanhuo@micron.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=stable@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
all inboxes | Powered by JetHome®