From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:48547 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755700AbcDJRL1 (ORCPT ); Sun, 10 Apr 2016 13:11:27 -0400 Subject: Patch "mmc: sdhci: Fix override of timeout clk wrt max_busy_timeout" has been added to the 4.5-stable tree To: adrian.hunter@intel.com, gregkh@linuxfoundation.org, ulf.hansson@linaro.org Cc: , From: Date: Sun, 10 Apr 2016 10:11:26 -0700 Message-ID: <1460308286206128@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled mmc: sdhci: Fix override of timeout clk wrt max_busy_timeout to the 4.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mmc-sdhci-fix-override-of-timeout-clk-wrt-max_busy_timeout.patch and it can be found in the queue-4.5 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From 995136247915c5cee633d55ba23f6eebf67aa567 Mon Sep 17 00:00:00 2001 From: Adrian Hunter Date: Mon, 7 Mar 2016 13:33:55 +0200 Subject: mmc: sdhci: Fix override of timeout clk wrt max_busy_timeout From: Adrian Hunter commit 995136247915c5cee633d55ba23f6eebf67aa567 upstream. Normally the timeout clock frequency is read from the capabilities register. It is also possible to set the value prior to calling sdhci_add_host() in which case that value will override the capabilities register value. However that was being done after calculating max_busy_timeout so that max_busy_timeout was being calculated using the wrong value of timeout_clk. Fix that by moving the override before max_busy_timeout is calculated. The result is that the max_busy_timeout and max_discard increase for BSW devices so that, for example, the time for mkfs.ext4 on a 64GB eMMC drops from about 1 minute 40 seconds to about 20 seconds. Note, in the future, the capabilities setting will be tidied up and this override won't be used anymore. However this fix is needed for stable. Signed-off-by: Adrian Hunter Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/sdhci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3096,14 +3096,14 @@ int sdhci_add_host(struct sdhci_host *ho if (caps[0] & SDHCI_TIMEOUT_CLK_UNIT) host->timeout_clk *= 1000; + if (override_timeout_clk) + host->timeout_clk = override_timeout_clk; + mmc->max_busy_timeout = host->ops->get_max_timeout_count ? host->ops->get_max_timeout_count(host) : 1 << 27; mmc->max_busy_timeout /= host->timeout_clk; } - if (override_timeout_clk) - host->timeout_clk = override_timeout_clk; - mmc->caps |= MMC_CAP_SDIO_IRQ | MMC_CAP_ERASE | MMC_CAP_CMD23; mmc->caps2 |= MMC_CAP2_SDIO_IRQ_NOTHREAD; Patches currently in stable-queue which might be from adrian.hunter@intel.com are queue-4.5/mmc-sdhci-fix-command-response-crc-error-handling.patch queue-4.5/mmc-sdhci-avoid-unnecessary-mapping-unmapping-of-align-buffer.patch queue-4.5/perf-tools-fix-checking-asprintf-return-value.patch queue-4.5/mmc-sdhci-move-initialisation-of-command-error-member.patch queue-4.5/mmc-tegra-properly-disable-card-clock.patch queue-4.5/mmc-tegra-disable-uhs-i-modes-for-tegra114.patch queue-4.5/mmc-sdhci-fix-override-of-timeout-clk-wrt-max_busy_timeout.patch queue-4.5/mmc-sdhci-fix-data-timeout-part-2.patch queue-4.5/perf-x86-intel-add-definition-for-pt-pmi-bit.patch queue-4.5/mmc-sdhci-clean-up-command-error-handling.patch queue-4.5/mmc-sdhci-further-fix-for-dma-unmapping-in-sdhci_post_req.patch queue-4.5/mmc-sdhci-pxav3-fix-higher-speed-mode-capabilities.patch queue-4.5/mmc-sdhci-fix-data-timeout-part-1.patch queue-4.5/mmc-sdhci-plug-dma-mapping-leak-on-error.patch