linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] mmc: Fixes relating to Bus Width Testing on Intel platforms
@ 2016-05-20  7:33 Adrian Hunter
  2016-05-20  7:33 ` [PATCH 1/3] mmc: longer timeout for long read time quirk Adrian Hunter
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Adrian Hunter @ 2016-05-20  7:33 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/3] mmc: longer timeout for long read time quirk
  2016-05-20  7:33 [PATCH 0/3] mmc: Fixes relating to Bus Width Testing on Intel platforms Adrian Hunter
@ 2016-05-20  7:33 ` Adrian Hunter
  2016-05-20  7:33 ` [PATCH 2/3] mmc: sdhci-pci: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers Adrian Hunter
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Adrian Hunter @ 2016-05-20  7:33 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc

From: Matt Gumbel <matthew.k.gumbel@intel.com>

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

Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org
---
 drivers/mmc/card/block.c | 5 +++--
 drivers/mmc/core/core.c  | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 33b98595d8d7..a92d183907ed 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -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
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 99275e40bf2f..8b4dfd45433b 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -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;
 	}
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] mmc: sdhci-pci: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers
  2016-05-20  7:33 [PATCH 0/3] mmc: Fixes relating to Bus Width Testing on Intel platforms Adrian Hunter
  2016-05-20  7:33 ` [PATCH 1/3] mmc: longer timeout for long read time quirk Adrian Hunter
@ 2016-05-20  7:33 ` Adrian Hunter
  2016-05-20  7:33 ` [PATCH 3/3] mmc: sdhci-acpi: " Adrian Hunter
  2016-05-23  9:56 ` [PATCH 0/3] mmc: Fixes relating to Bus Width Testing on Intel platforms Ulf Hansson
  3 siblings, 0 replies; 5+ messages in thread
From: Adrian Hunter @ 2016-05-20  7:33 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc

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

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org
---
 drivers/mmc/host/sdhci-pci-core.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pci-core.c b/drivers/mmc/host/sdhci-pci-core.c
index 97d4eebd6bf5..a4dbf7421edc 100644
--- a/drivers/mmc/host/sdhci-pci-core.c
+++ b/drivers/mmc/host/sdhci-pci-core.c
@@ -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;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] mmc: sdhci-acpi: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers
  2016-05-20  7:33 [PATCH 0/3] mmc: Fixes relating to Bus Width Testing on Intel platforms Adrian Hunter
  2016-05-20  7:33 ` [PATCH 1/3] mmc: longer timeout for long read time quirk Adrian Hunter
  2016-05-20  7:33 ` [PATCH 2/3] mmc: sdhci-pci: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers Adrian Hunter
@ 2016-05-20  7:33 ` Adrian Hunter
  2016-05-23  9:56 ` [PATCH 0/3] mmc: Fixes relating to Bus Width Testing on Intel platforms Ulf Hansson
  3 siblings, 0 replies; 5+ messages in thread
From: Adrian Hunter @ 2016-05-20  7:33 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc

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

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: stable@vger.kernel.org
---
 drivers/mmc/host/sdhci-acpi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index b2d70ba6caa7..3f923644eaa4 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -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,
 };
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/3] mmc: Fixes relating to Bus Width Testing on Intel platforms
  2016-05-20  7:33 [PATCH 0/3] mmc: Fixes relating to Bus Width Testing on Intel platforms Adrian Hunter
                   ` (2 preceding siblings ...)
  2016-05-20  7:33 ` [PATCH 3/3] mmc: sdhci-acpi: " Adrian Hunter
@ 2016-05-23  9:56 ` Ulf Hansson
  3 siblings, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2016-05-23  9:56 UTC (permalink / raw)
  To: Adrian Hunter; +Cc: linux-mmc

On 20 May 2016 at 09:33, Adrian Hunter <adrian.hunter@intel.com> wrote:
> 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

Thanks, applied all for fixes!

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-23  9:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-20  7:33 [PATCH 0/3] mmc: Fixes relating to Bus Width Testing on Intel platforms Adrian Hunter
2016-05-20  7:33 ` [PATCH 1/3] mmc: longer timeout for long read time quirk Adrian Hunter
2016-05-20  7:33 ` [PATCH 2/3] mmc: sdhci-pci: Remove MMC_CAP_BUS_WIDTH_TEST for Intel controllers Adrian Hunter
2016-05-20  7:33 ` [PATCH 3/3] mmc: sdhci-acpi: " Adrian Hunter
2016-05-23  9:56 ` [PATCH 0/3] mmc: Fixes relating to Bus Width Testing on Intel platforms Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).