]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mmc: sdhci-of-dwcmshc: reduce CIT for better performance
authorShawn Lin <shawn.lin@rock-chips.com>
Tue, 25 Nov 2025 23:26:40 +0000 (07:26 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 26 Nov 2025 10:47:05 +0000 (11:47 +0100)
CQHCI_SSC1.CIT indicates to the CQE the polling period to use for
periodic SEND_QUEUE_STATUS (CMD13) polling. Some eMMCs have only one
hardware queue, and CMD13 can only query one slot at a time for data
transmission, which cannot be processed in parallel. Modifying the
CMD13 query interval can increase the query frequency and improve
random write performance.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/cqhci.h
drivers/mmc/host/sdhci-of-dwcmshc.c

index ce189a1866b9de6ceae461aa113f7ebc95b58606..3668856531c14573708ecb8893e358be0c9ec7b0 100644 (file)
@@ -93,6 +93,7 @@
 /* send status config 1 */
 #define CQHCI_SSC1                     0x40
 #define CQHCI_SSC1_CBC_MASK            GENMASK(19, 16)
+#define CQHCI_SSC1_CIT_MASK            GENMASK(15, 0)
 
 /* send status config 2 */
 #define CQHCI_SSC2                     0x44
index 36e7c0bec43151a75eb5ad3af44d9a1660791288..51949cde095867ab9eca91964f1c7fcc17c87271 100644 (file)
@@ -644,6 +644,11 @@ static void rk35xx_sdhci_cqe_pre_enable(struct mmc_host *mmc)
        struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host);
        u32 reg;
 
+       /* Set Send Status Command Idle Timer to 10.66us (256 * 1 / 24) */
+       reg = sdhci_readl(host, dwc_priv->vendor_specific_area2 + CQHCI_SSC1);
+       reg = (reg & ~CQHCI_SSC1_CIT_MASK) | 0x0100;
+       sdhci_writel(host, reg, dwc_priv->vendor_specific_area2 + CQHCI_SSC1);
+
        reg = sdhci_readl(host, dwc_priv->vendor_specific_area2 + CQHCI_CFG);
        reg |= CQHCI_ENABLE;
        sdhci_writel(host, reg, dwc_priv->vendor_specific_area2 + CQHCI_CFG);