mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
mmc: sdhci-pci: Fix eMMC driver strength for BYT-based controllers
commit1a8eb6b373
upstream. BIOS writers have begun the practice of setting 40 ohm eMMC driver strength even though the eMMC may not support it, on the assumption that the kernel will validate the value against the eMMC (Extended CSD DRIVER_STRENGTH [offset 197]) and revert to the default 50 ohm value if 40 ohm is invalid. This is done to avoid changing the value for different boards. Putting aside the merits of this approach, it is clear the eMMC's mask of supported driver strengths is more reliable than the value provided by BIOS. Add validation accordingly. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Fixes:51ced59cc0
("mmc: sdhci-pci: Use ACPI DSM to get driver strength for some Intel devices") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200422111629.4899-1-adrian.hunter@intel.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a923cdf088
commit
08e05f4f65
1 changed files with 3 additions and 0 deletions
|
@ -490,6 +490,9 @@ static int intel_select_drive_strength(struct mmc_card *card,
|
|||
struct sdhci_pci_slot *slot = sdhci_priv(host);
|
||||
struct intel_host *intel_host = sdhci_pci_priv(slot);
|
||||
|
||||
if (!(mmc_driver_type_mask(intel_host->drv_strength) & card_drv))
|
||||
return 0;
|
||||
|
||||
return intel_host->drv_strength;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue