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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 16 Dec 2019 18:50:35 -0800
From:   "Bao D. Nguyen" <nguyenb@...eaurora.org>
To:     ulf.hansson@...aro.org, robh+dt@...nel.org
Cc:     linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
        asutoshd@...eaurora.org, cang@...eaurora.org,
        Ziqi Chen <ziqichen@...eaurora.org>,
        Sayali Lokhande <sayalil@...eaurora.org>,
        "Bao D. Nguyen" <nguyenb@...eaurora.org>
Subject: [<PATCH v1> 2/9] mmc: core: allow hosts to specify a large discard size

From: Ziqi Chen <ziqichen@...eaurora.org>

max_busy_timeout is used to decide whether R1B response should
be used or a R1 response should be used. This is also used to
decide what the discard size of mmc queue (registered with block
layer) can be set to. In order to keep both the features in place,
this change will allow for hosts to specify a larger discard size
while still specifying max_busy_timeout.

Signed-off-by: Ziqi Chen <ziqichen@...eaurora.org>
Signed-off-by: Sayali Lokhande <sayalil@...eaurora.org>
Signed-off-by: Bao D. Nguyen <nguyenb@...eaurora.org>
---
 drivers/mmc/core/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index abf8f5e..1e37f78 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2059,6 +2059,10 @@ unsigned int mmc_calc_max_discard(struct mmc_card *card)
 	struct mmc_host *host = card->host;
 	unsigned int max_discard, max_trim;
 
+	if (!host->max_busy_timeout ||
+			(host->caps2 & MMC_CAP2_MAX_DISCARD_SIZE))
+		return UINT_MAX;
+
 	/*
 	 * Without erase_group_def set, MMC erase timeout depends on clock
 	 * frequence which can change.  In that case, the best choice is
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ