Skip to content

Commit 79cf71c

Browse files
shawn1221Ulf Hansson
authored andcommitted
mmc: sdhci-of-dwcmshc: reduce CIT for better performance
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>
1 parent c7ce645 commit 79cf71c

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/mmc/host/cqhci.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
/* send status config 1 */
9494
#define CQHCI_SSC1 0x40
9595
#define CQHCI_SSC1_CBC_MASK GENMASK(19, 16)
96+
#define CQHCI_SSC1_CIT_MASK GENMASK(15, 0)
9697

9798
/* send status config 2 */
9899
#define CQHCI_SSC2 0x44

drivers/mmc/host/sdhci-of-dwcmshc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,11 @@ static void rk35xx_sdhci_cqe_pre_enable(struct mmc_host *mmc)
644644
struct dwcmshc_priv *dwc_priv = sdhci_pltfm_priv(pltfm_host);
645645
u32 reg;
646646

647+
/* Set Send Status Command Idle Timer to 10.66us (256 * 1 / 24) */
648+
reg = sdhci_readl(host, dwc_priv->vendor_specific_area2 + CQHCI_SSC1);
649+
reg = (reg & ~CQHCI_SSC1_CIT_MASK) | 0x0100;
650+
sdhci_writel(host, reg, dwc_priv->vendor_specific_area2 + CQHCI_SSC1);
651+
647652
reg = sdhci_readl(host, dwc_priv->vendor_specific_area2 + CQHCI_CFG);
648653
reg |= CQHCI_ENABLE;
649654
sdhci_writel(host, reg, dwc_priv->vendor_specific_area2 + CQHCI_CFG);

0 commit comments

Comments
 (0)