lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210917172727.26834-3-huobean@gmail.com>
Date:   Fri, 17 Sep 2021 19:27:27 +0200
From:   Bean Huo <huobean@...il.com>
To:     Adrian Hunter <adrian.hunter@...el.com>,
        Ulf Hansson <ulf.hansson@...aro.org>
Cc:     Bean Huo <beanhuo@...ron.com>, linux-mmc@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH v1 2/2] mmc: sdhci: Use the SW timer when the HW timer cannot meet the timeout value required by the device

From: Bean Huo <beanhuo@...ron.com>

If the data transmission timeout value required by the device exceeds
the maximum timeout value of the host HW timer, we still use the HW
timer with the maximum timeout value of the HW timer. This setting is
suitable for most R/W situations. But sometimes, the device will complete
the R/W task within its required timeout value (greater than the HW timer).
In this case, the HW timer for data transmission will time out.

Currently, in this condition, we  disable the HW timer and use the SW
timer only when the SDHCI_QUIRK2_DISABLE_HW_TIMEOUT quirk is set by the
host driver. The patch is to remove this if statement restriction and
allow data transmission to use the SW timer when the hardware timer cannot
meet the required timeout value.

Signed-off-by: Bean Huo <beanhuo@...ron.com>
---
 drivers/mmc/host/sdhci.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 357b365bf0ec..463517fd9886 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -969,9 +969,6 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd,
 		count++;
 		current_timeout <<= 1;
 		if (count > host->max_timeout_count) {
-			if (!(host->quirks2 & SDHCI_QUIRK2_DISABLE_HW_TIMEOUT))
-				DBG("Too large timeout 0x%x requested for CMD%d!\n",
-				    count, cmd->opcode);
 			count = host->max_timeout_count;
 			*too_big = true;
 			break;
@@ -1016,8 +1013,7 @@ void __sdhci_set_timeout(struct sdhci_host *host, struct mmc_command *cmd)
 	bool too_big = false;
 	u8 count = sdhci_calc_timeout(host, cmd, &too_big);
 
-	if (too_big &&
-	    host->quirks2 & SDHCI_QUIRK2_DISABLE_HW_TIMEOUT) {
+	if (too_big) {
 		sdhci_calc_sw_timeout(host, cmd);
 		sdhci_set_data_timeout_irq(host, false);
 	} else if (!(host->ier & SDHCI_INT_DATA_TIMEOUT)) {
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ