Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mmc: sdhci: Disable SD card clock before changing parameters

Per the SD Host Controller Simplified Specification v4.20 §3.2.3, change
the SD card clock parameters only after first disabling the external card
clock. Doing this fixes a spurious clock pulse on Baytrail and Apollo Lake
SD controllers which otherwise breaks voltage switching with a specific
Swissbit SD card. This change is limited to Intel host controllers to
avoid an issue reported on ARM64 devices.

Signed-off-by: Kyle Roeschley <kyle.roeschley@ni.com>
Signed-off-by: Brad Mouring <brad.mouring@ni.com>
Signed-off-by: Erick Shepherd <erick.shepherd@ni.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20250724185354.815888-1-erick.shepherd@ni.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Erick Shepherd and committed by
Ulf Hansson
5f755ba9 c17b750b

+13 -2
+13 -2
drivers/mmc/host/sdhci-pci-core.c
··· 679 679 return 0; 680 680 } 681 681 682 + static void sdhci_intel_set_clock(struct sdhci_host *host, unsigned int clock) 683 + { 684 + u16 clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL); 685 + 686 + /* Stop card clock separately to avoid glitches on clock line */ 687 + if (clk & SDHCI_CLOCK_CARD_EN) 688 + sdhci_writew(host, clk & ~SDHCI_CLOCK_CARD_EN, SDHCI_CLOCK_CONTROL); 689 + 690 + sdhci_set_clock(host, clock); 691 + } 692 + 682 693 static const struct sdhci_ops sdhci_intel_byt_ops = { 683 - .set_clock = sdhci_set_clock, 694 + .set_clock = sdhci_intel_set_clock, 684 695 .set_power = sdhci_intel_set_power, 685 696 .enable_dma = sdhci_pci_enable_dma, 686 697 .set_bus_width = sdhci_set_bus_width, ··· 701 690 }; 702 691 703 692 static const struct sdhci_ops sdhci_intel_glk_ops = { 704 - .set_clock = sdhci_set_clock, 693 + .set_clock = sdhci_intel_set_clock, 705 694 .set_power = sdhci_intel_set_power, 706 695 .enable_dma = sdhci_pci_enable_dma, 707 696 .set_bus_width = sdhci_set_bus_width,