Skip to contentSkip to conversation

mmc: Fixes relating to Bus Width Testing on Intel platforms

PATCH Applied Adrian Hunter 2 participants 5 messages May 20, 2016 – May 23, 2016

Subsystems (2)
lore
Share & tools
lore

Adrian Hunter

author maintainer
#0 lore raw

cover mmc: Fixes relating to Bus Width Testing on Intel platforms

Hi

Here are a couple of fixes relating to Bus Width Testing and reading the Extended CSD register on Intel platforms.

Adrian Hunter (2):
mmc: sdhci-pci: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers
mmc: sdhci-acpi: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers

Matt Gumbel (1):
mmc: longer timeout for long read time quirk

 drivers/mmc/card/block.c          | 5 +++--
 drivers/mmc/core/core.c           | 4 ++--
 drivers/mmc/host/sdhci-acpi.c     | 6 +++---
 drivers/mmc/host/sdhci-pci-core.c | 5 +----
 4 files changed, 9 insertions(+), 11 deletions(-)

Regards
Adrian

author maintainer
#1 lore raw

PATCH 1/3 mmc: longer timeout for long read time quirk

From: Matt Gumbel <[email protected]>

008GE0 Toshiba mmc in some Intel Baytrail tablets responds to MMC_SEND_EXT_CSD in 450-600ms.

This patch will...

() Increase the long read time quirk timeout from 300ms to 600ms. Original
author of that quirk says 300ms was only a guess and that the number may need to be raised in the future.

() Add this specific MMC to the quirk

---
 drivers/mmc/card/block.c | 5 +++--
 drivers/mmc/core/core.c  | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/mmc/card/block.c +3 -2
index 33b98595d8d7..a92d183907ed 100644
@@ -2536,11 +2536,12 @@ static const struct mmc_fixup blk_fixups[] =
 		  MMC_QUIRK_BLK_NO_CMD23),
 
 	/*
-	 * Some Micron MMC cards needs longer data read timeout than
-	 * indicated in CSD.
+	 * Some MMC cards need longer data read timeout than indicated in CSD.
 	 */
 	MMC_FIXUP(CID_NAME_ANY, CID_MANFID_MICRON, 0x200, add_quirk_mmc,
 		  MMC_QUIRK_LONG_READ_TIME),
+	MMC_FIXUP("008GE0", CID_MANFID_TOSHIBA, CID_OEMID_ANY, add_quirk_mmc,
+		  MMC_QUIRK_LONG_READ_TIME),
 
 	/*
 	 * On these Samsung MoviNAND parts, performing secure erase or
drivers/mmc/core/core.c +2 -2
index 99275e40bf2f..8b4dfd45433b 100644
@@ -875,11 +875,11 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card)
 	/*
 	 * Some cards require longer data read timeout than indicated in CSD.
 	 * Address this by setting the read timeout to a "reasonably high"
-	 * value. For the cards tested, 300ms has proven enough. If necessary,
+	 * value. For the cards tested, 600ms has proven enough. If necessary,
 	 * this value can be increased if other problematic cards require this.
 	 */
 	if (mmc_card_long_read_time(card) && data->flags & MMC_DATA_READ) {
-		data->timeout_ns = 300000000;
+		data->timeout_ns = 600000000;
 		data->timeout_clks = 0;
 	}
 
Signature · 1 line
1.9.1
author maintainer
#2 lore raw

PATCH 2/3 mmc: sdhci-pci: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers

In reply to Adrian Hunter

The CMD19/CMD14 bus width test has been found to be unreliable in some cases. It is not essential, so simply remove it.

---
 drivers/mmc/host/sdhci-pci-core.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/mmc/host/sdhci-pci-core.c +1 -4
index 97d4eebd6bf5..a4dbf7421edc 100644
@@ -356,7 +356,6 @@ static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot)
 {
 	slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE |
 				 MMC_CAP_HW_RESET | MMC_CAP_1_8V_DDR |
-				 MMC_CAP_BUS_WIDTH_TEST |
 				 MMC_CAP_WAIT_WHILE_BUSY;
 	slot->host->mmc->caps2 |= MMC_CAP2_HC_ERASE_SZ;
 	slot->hw_reset = sdhci_pci_int_hw_reset;
@@ -372,15 +371,13 @@ static int byt_emmc_probe_slot(struct sdhci_pci_slot *slot)
 static int byt_sdio_probe_slot(struct sdhci_pci_slot *slot)
 {
 	slot->host->mmc->caps |= MMC_CAP_POWER_OFF_CARD | MMC_CAP_NONREMOVABLE |
-				 MMC_CAP_BUS_WIDTH_TEST |
 				 MMC_CAP_WAIT_WHILE_BUSY;
 	return 0;
 }
 
 static int byt_sd_probe_slot(struct sdhci_pci_slot *slot)
 {
-	slot->host->mmc->caps |= MMC_CAP_BUS_WIDTH_TEST |
-				 MMC_CAP_WAIT_WHILE_BUSY;
+	slot->host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY;
 	slot->cd_con_id = NULL;
 	slot->cd_idx = 0;
 	slot->cd_override_level = true;
Signature · 1 line
1.9.1
author maintainer
#3 lore raw

PATCH 3/3 mmc: sdhci-acpi: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers

In reply to Adrian Hunter

The CMD19/CMD14 bus width test has been found to be unreliable in some cases. It is not essential, so simply remove it.

---
 drivers/mmc/host/sdhci-acpi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci-acpi.c +3 -3
index b2d70ba6caa7..3f923644eaa4 100644
@@ -274,7 +274,7 @@ static const struct sdhci_acpi_slot sdhci_acpi_slot_int_emmc = {
 	.chip    = &sdhci_acpi_chip_int,
 	.caps    = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE |
 		   MMC_CAP_HW_RESET | MMC_CAP_1_8V_DDR |
-		   MMC_CAP_BUS_WIDTH_TEST | MMC_CAP_WAIT_WHILE_BUSY,
+		   MMC_CAP_WAIT_WHILE_BUSY,
 	.caps2   = MMC_CAP2_HC_ERASE_SZ,
 	.flags   = SDHCI_ACPI_RUNTIME_PM,
 	.quirks  = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
@@ -289,7 +289,7 @@ static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sdio = {
 		   SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
 	.quirks2 = SDHCI_QUIRK2_HOST_OFF_CARD_ON,
 	.caps    = MMC_CAP_NONREMOVABLE | MMC_CAP_POWER_OFF_CARD |
-		   MMC_CAP_BUS_WIDTH_TEST | MMC_CAP_WAIT_WHILE_BUSY,
+		   MMC_CAP_WAIT_WHILE_BUSY,
 	.flags   = SDHCI_ACPI_RUNTIME_PM,
 	.pm_caps = MMC_PM_KEEP_POWER,
 	.probe_slot	= sdhci_acpi_sdio_probe_slot,
@@ -301,7 +301,7 @@ static const struct sdhci_acpi_slot sdhci_acpi_slot_int_sd = {
 	.quirks  = SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC,
 	.quirks2 = SDHCI_QUIRK2_CARD_ON_NEEDS_BUS_ON |
 		   SDHCI_QUIRK2_STOP_WITH_TC,
-	.caps    = MMC_CAP_BUS_WIDTH_TEST | MMC_CAP_WAIT_WHILE_BUSY,
+	.caps    = MMC_CAP_WAIT_WHILE_BUSY,
 	.probe_slot	= sdhci_acpi_sd_probe_slot,
 };
 
Signature · 1 line
1.9.1
Applied
#4 lore raw
In reply to Adrian Hunter
Quoted 20 lines · Adrian Hunter

Hi

Here are a couple of fixes relating to Bus Width Testing and reading the Extended CSD register on Intel platforms.

Adrian Hunter (2):
mmc: sdhci-pci: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers
mmc: sdhci-acpi: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers

Matt Gumbel (1):
mmc: longer timeout for long read time quirk

 drivers/mmc/card/block.c          | 5 +++--
 drivers/mmc/core/core.c           | 4 ++--
 drivers/mmc/host/sdhci-acpi.c     | 6 +++---
 drivers/mmc/host/sdhci-pci-core.c | 5 +----
 4 files changed, 9 insertions(+), 11 deletions(-)
Quoted 2 lines

Regards
Adrian

Thanks, applied all for fixes!

Kind regards
Uffe