Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Piyush Malgujar <pmalgujar@marvell.com>
To: <linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<adrian.hunter@intel.com>, <ulf.hansson@linaro.org>,
	<robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>,
	<yamada.masahiro@socionext.com>, <devicetree@vger.kernel.org>
Cc: <jannadurai@marvell.com>, <cchavva@marvell.com>,
	Piyush Malgujar <pmalgujar@marvell.com>
Subject: [PATCH 4/5] drivers: mmc: sdhci: Add option to configure sdhci timeout
Date: Mon, 19 Dec 2022 06:24:17 -0800	[thread overview]
Message-ID: <20221219142418.27949-5-pmalgujar@marvell.com> (raw)
In-Reply-To: <20221219142418.27949-1-pmalgujar@marvell.com>

From: Jayanthi Annadurai <jannadurai@marvell.com>

Add config option to choose the sdhci timeout in seconds.

Signed-off-by: Jayanthi Annadurai <jannadurai@marvell.com>
Signed-off-by: Piyush Malgujar <pmalgujar@marvell.com>
---
 drivers/mmc/host/Kconfig | 8 ++++++++
 drivers/mmc/host/sdhci.c | 3 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index b5b2ae0bb4625bdb9d17acdbb1887c9caa3a1f32..ab48f2bc4cff73d1aad8d7da542d761cf0346d9f 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -1132,3 +1132,11 @@ config MMC_LITEX
 	  module will be called litex_mmc.
 
 	  If unsure, say N.
+
+config MMC_SDHCI_TIMEOUT
+	int
+	default 1 if MMC_SDHCI_CADENCE
+	default 10
+	depends on MMC_SDHCI
+	help
+	  Default timeout value for command and data.
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index f3af1bd0f7b955272fbd8b034ecb591860b89aed..e9bc24258746834ec9c8f13fe24456587a2b758d 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1707,7 +1707,8 @@ static bool sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd)
 	else if (!cmd->data && cmd->busy_timeout > 9000)
 		timeout += DIV_ROUND_UP(cmd->busy_timeout, 1000) * HZ + HZ;
 	else
-		timeout += 10 * HZ;
+		timeout += CONFIG_MMC_SDHCI_TIMEOUT * HZ;
+
 	sdhci_mod_timer(host, cmd->mrq, timeout);
 
 	if (host->use_external_dma)
-- 
2.17.1


  parent reply	other threads:[~2022-12-19 14:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-19 14:24 [PATCH 0/5] drivers: mmc: sdhci-cadence: SD6 controller support Piyush Malgujar
2022-12-19 14:24 ` [PATCH 1/5] " Piyush Malgujar
2022-12-19 15:41   ` Krzysztof Kozlowski
2022-12-23 11:07   ` Dan Carpenter
2023-01-11  8:19   ` Adrian Hunter
2022-12-19 14:24 ` [PATCH 2/5] drivers: mmc: sdhci-cadence: enable MMC_SDHCI_IO_ACCESSORS Piyush Malgujar
2023-01-11  8:23   ` Adrian Hunter
2023-01-12 14:12     ` Piyush Malgujar
2023-01-13  7:20       ` Adrian Hunter
2022-12-19 14:24 ` [PATCH 3/5] dt-bindings: mmc: sdhci-cadence: SD6 support Piyush Malgujar
2022-12-19 15:40   ` Krzysztof Kozlowski
2023-01-06 16:48     ` Piyush Malgujar
2023-01-07 13:25       ` Krzysztof Kozlowski
2023-01-18 16:02         ` Piyush Malgujar
2022-12-19 14:24 ` Piyush Malgujar [this message]
2023-01-11  8:08   ` [PATCH 4/5] drivers: mmc: sdhci: Add option to configure sdhci timeout Adrian Hunter
2023-01-12 13:44     ` Piyush Malgujar
2022-12-19 14:24 ` [PATCH 5/5] drivers: mmc: sdhci-cadence: Add debug option for sdhci-cadence driver Piyush Malgujar
2023-01-11  8:29   ` Adrian Hunter

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=20221219142418.27949-5-pmalgujar@marvell.com \
    --to=pmalgujar@marvell.com \
    --cc=adrian.hunter@intel.com \
    --cc=cchavva@marvell.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jannadurai@marvell.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=yamada.masahiro@socionext.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