Skip to content

Commit 60d5356

Browse files
ahunter6storulf
authored andcommitted
mmc: sdhci-pci: Prefer SDR25 timing for High Speed mode for BYT-based Intel controllers
A UHS setting of SDR25 can give better results for High Speed mode. This is because there is no setting corresponding to high speed. Currently SDHCI sets no value, which means zero which is also the setting for SDR12. There was an attempt to change this in sdhci.c but it caused problems for some drivers, so it was reverted and the change was made to sdhci-brcmstb in commit 2fefc7c ("mmc: sdhci-brcmstb: Fix incorrect switch to HS mode"). Several other drivers also do this. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: stable@vger.kernel.org # v5.4+ Link: https://lore.kernel.org/r/20201112133656.20317-1-adrian.hunter@intel.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 09162bc commit 60d5356

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

drivers/mmc/host/sdhci-pci-core.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,15 @@ static void sdhci_intel_set_power(struct sdhci_host *host, unsigned char mode,
665665
}
666666
}
667667

668+
static void sdhci_intel_set_uhs_signaling(struct sdhci_host *host,
669+
unsigned int timing)
670+
{
671+
/* Set UHS timing to SDR25 for High Speed mode */
672+
if (timing == MMC_TIMING_MMC_HS || timing == MMC_TIMING_SD_HS)
673+
timing = MMC_TIMING_UHS_SDR25;
674+
sdhci_set_uhs_signaling(host, timing);
675+
}
676+
668677
#define INTEL_HS400_ES_REG 0x78
669678
#define INTEL_HS400_ES_BIT BIT(0)
670679

@@ -721,7 +730,7 @@ static const struct sdhci_ops sdhci_intel_byt_ops = {
721730
.enable_dma = sdhci_pci_enable_dma,
722731
.set_bus_width = sdhci_set_bus_width,
723732
.reset = sdhci_reset,
724-
.set_uhs_signaling = sdhci_set_uhs_signaling,
733+
.set_uhs_signaling = sdhci_intel_set_uhs_signaling,
725734
.hw_reset = sdhci_pci_hw_reset,
726735
};
727736

@@ -731,7 +740,7 @@ static const struct sdhci_ops sdhci_intel_glk_ops = {
731740
.enable_dma = sdhci_pci_enable_dma,
732741
.set_bus_width = sdhci_set_bus_width,
733742
.reset = sdhci_cqhci_reset,
734-
.set_uhs_signaling = sdhci_set_uhs_signaling,
743+
.set_uhs_signaling = sdhci_intel_set_uhs_signaling,
735744
.hw_reset = sdhci_pci_hw_reset,
736745
.irq = sdhci_cqhci_irq,
737746
};

0 commit comments

Comments
 (0)