Skip to contentSkip to conversation

mmc: sdhci: Remove SDHCI_QUIRK_MISSING_CAPS

PATCH In review Adrian Hunter 6 participants 12 messages Jan 13, 2023 – Jan 16, 2023

Subsystems (6)
lore
Share & tools
lore

Adrian Hunter

author maintainer
#0 lore raw

cover mmc: sdhci: Remove SDHCI_QUIRK_MISSING_CAPS

Hi

This patch set is to remove SDHCI_QUIRK_MISSING_CAPS.

SDHCI_QUIRK_MISSING_CAPS is not needed because __sdhci_read_caps() can be called instead.

__sdhci_read_caps() is also called from sdhci_setup_host() via sdhci_read_caps(), however only the first call to __sdhci_read_caps() does anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a reset, so calling __sdhci_read_caps() earlier could have unforeseen side-effects. However code flow has been reviewed with that in mind.

Adrian Hunter (6):
mmc: sdhci-pci: Replace SDHCI_QUIRK_MISSING_CAPS for Ricoh controller
mmc: sdhci-brcmstb: Replace SDHCI_QUIRK_MISSING_CAPS
mmc: sdhci-sprd: Replace SDHCI_QUIRK_MISSING_CAPS
mmc: sdhci-pxav3: Replace SDHCI_QUIRK_MISSING_CAPS
mmc: sdhci-iproc: Replace SDHCI_QUIRK_MISSING_CAPS
mmc: sdhci: Remove SDHCI_QUIRK_MISSING_CAPS

 drivers/mmc/host/sdhci-brcmstb.c  |  4 +---
 drivers/mmc/host/sdhci-iproc.c    | 14 ++++++++------
 drivers/mmc/host/sdhci-pci-core.c |  8 +++++---
 drivers/mmc/host/sdhci-pxav3.c    |  4 +---
 drivers/mmc/host/sdhci-sprd.c     |  6 ++----
 drivers/mmc/host/sdhci.c          |  3 ---
 drivers/mmc/host/sdhci.h          |  2 --
 7 files changed, 17 insertions(+), 24 deletions(-)

Regards
Adrian

author maintainer
#1 lore raw

PATCH 1/6 mmc: sdhci-pci: Replace SDHCI_QUIRK_MISSING_CAPS for Ricoh controller

SDHCI_QUIRK_MISSING_CAPS is not needed because __sdhci_read_caps() can be called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace SDHCI_QUIRK_MISSING_CAPS with __sdhci_read_caps() for Ricoh SDHCI controller.

__sdhci_read_caps() is also called from sdhci_setup_host() via sdhci_read_caps(), however only the first call to __sdhci_read_caps() does anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a reset, so calling __sdhci_read_caps() earlier could have unforeseen side-effects. However the code flow has been reviewed with that in mind.

---
 drivers/mmc/host/sdhci-pci-core.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci-pci-core.c +5 -3
index c359f867df0a..01975d145200 100644
@@ -251,13 +251,16 @@ static int ricoh_probe(struct sdhci_pci_chip *chip)
 
 static int ricoh_mmc_probe_slot(struct sdhci_pci_slot *slot)
 {
-	slot->host->caps =
+	u32 caps =
 		FIELD_PREP(SDHCI_TIMEOUT_CLK_MASK, 0x21) |
 		FIELD_PREP(SDHCI_CLOCK_BASE_MASK, 0x21) |
 		SDHCI_TIMEOUT_CLK_UNIT |
 		SDHCI_CAN_VDD_330 |
 		SDHCI_CAN_DO_HISPD |
 		SDHCI_CAN_DO_SDMA;
+	u32 caps1 = 0;
+
+	__sdhci_read_caps(slot->host, NULL, &caps, &caps1);
 	return 0;
 }
 
@@ -286,8 +289,7 @@ static const struct sdhci_pci_fixes sdhci_ricoh_mmc = {
 #endif
 	.quirks		= SDHCI_QUIRK_32BIT_DMA_ADDR |
 			  SDHCI_QUIRK_CLOCK_BEFORE_RESET |
-			  SDHCI_QUIRK_NO_CARD_NO_RESET |
-			  SDHCI_QUIRK_MISSING_CAPS
+			  SDHCI_QUIRK_NO_CARD_NO_RESET,
 };
 
 static void ene_714_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
Signature · 1 line
2.34.1
author maintainer
#2 lore raw

PATCH 2/6 mmc: sdhci-brcmstb: Replace SDHCI_QUIRK_MISSING_CAPS

In reply to Adrian Hunter

SDHCI_QUIRK_MISSING_CAPS is not needed because sdhci_read_caps() can be called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace SDHCI_QUIRK_MISSING_CAPS with sdhci_read_caps().

__sdhci_read_caps() is also called from sdhci_setup_host() via sdhci_read_caps(), however only the first call to __sdhci_read_caps() does anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a reset, so calling __sdhci_read_caps() earlier could have unforeseen side-effects. However the code flow has been reviewed with that in mind.

---
 drivers/mmc/host/sdhci-brcmstb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/sdhci-brcmstb.c +1 -3
index f2cf3d70db79..0a19b7af1d41 100644
@@ -324,13 +324,11 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
 	 * will allow these modes to be specified by device tree
 	 * properties through mmc_of_parse().
 	 */
-	host->caps = sdhci_readl(host, SDHCI_CAPABILITIES);
+	sdhci_read_caps(host);
 	if (match_priv->flags & BRCMSTB_MATCH_FLAGS_NO_64BIT)
 		host->caps &= ~SDHCI_CAN_64BIT;
-	host->caps1 = sdhci_readl(host, SDHCI_CAPABILITIES_1);
 	host->caps1 &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_SDR104 |
 			 SDHCI_SUPPORT_DDR50);
-	host->quirks |= SDHCI_QUIRK_MISSING_CAPS;
 
 	if (match_priv->flags & BRCMSTB_MATCH_FLAGS_BROKEN_TIMEOUT)
 		host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
Signature · 1 line
2.34.1
#3 lore raw

Re: [PATCH 2/6] mmc: sdhci-brcmstb: Replace SDHCI_QUIRK_MISSING_CAPS

Quoted 10 lines · Adrian Hunter

SDHCI_QUIRK_MISSING_CAPS is not needed because sdhci_read_caps() can be called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace SDHCI_QUIRK_MISSING_CAPS with sdhci_read_caps().

__sdhci_read_caps() is also called from sdhci_setup_host() via sdhci_read_caps(), however only the first call to __sdhci_read_caps() does anything because after that host->read_caps has been set to true.

Quoted 5 lines

Note, __sdhci_read_caps() does more than just set host->caps, such as do a reset, so calling __sdhci_read_caps() earlier could have unforeseen side-effects. However the code flow has been reviewed with that in mind.

Signature · 1 line
Florian
author maintainer
#4 lore raw

PATCH 3/6 mmc: sdhci-sprd: Replace SDHCI_QUIRK_MISSING_CAPS

In reply to Adrian Hunter

SDHCI_QUIRK_MISSING_CAPS is not needed because sdhci_read_caps() can be called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace SDHCI_QUIRK_MISSING_CAPS with sdhci_read_caps().

__sdhci_read_caps() is also called from sdhci_setup_host() via sdhci_read_caps(), however only the first call to __sdhci_read_caps() does anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a reset, so calling __sdhci_read_caps() earlier could have unforeseen side-effects. However the code flow has been reviewed with that in mind.

---
 drivers/mmc/host/sdhci-sprd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-sprd.c +2 -4
index 525f979e2a97..7f4ee2e12735 100644
@@ -553,8 +553,7 @@ static void sdhci_sprd_phy_param_parse(struct sdhci_sprd_host *sprd_host,
 
 static const struct sdhci_pltfm_data sdhci_sprd_pdata = {
 	.quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
-		  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
-		  SDHCI_QUIRK_MISSING_CAPS,
+		  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK,
 	.quirks2 = SDHCI_QUIRK2_BROKEN_HS200 |
 		   SDHCI_QUIRK2_USE_32BIT_BLK_CNT |
 		   SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
@@ -671,8 +670,7 @@ static int sdhci_sprd_probe(struct platform_device *pdev)
 	 * will allow these modes to be specified only by device
 	 * tree properties through mmc_of_parse().
 	 */
-	host->caps = sdhci_readl(host, SDHCI_CAPABILITIES);
-	host->caps1 = sdhci_readl(host, SDHCI_CAPABILITIES_1);
+	sdhci_read_caps(host);
 	host->caps1 &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_SDR104 |
 			 SDHCI_SUPPORT_DDR50);
 
Signature · 1 line
2.34.1
reviewer Acked-by on v1 3/6
#5 lore raw

Re: [PATCH 3/6] mmc: sdhci-sprd: Replace SDHCI_QUIRK_MISSING_CAPS

Quoted 11 lines · Adrian Hunter

SDHCI_QUIRK_MISSING_CAPS is not needed because sdhci_read_caps() can be called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace SDHCI_QUIRK_MISSING_CAPS with sdhci_read_caps().

__sdhci_read_caps() is also called from sdhci_setup_host() via sdhci_read_caps(), however only the first call to __sdhci_read_caps() does anything because after that host->read_caps has been set to true.

Quoted 5 lines

Note, __sdhci_read_caps() does more than just set host->caps, such as do a reset, so calling __sdhci_read_caps() earlier could have unforeseen side-effects. However the code flow has been reviewed with that in mind.

Thanks,
Chunyan

Quoted 31 lines
---
 drivers/mmc/host/sdhci-sprd.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mmc/host/sdhci-sprd.c +2 -5
index 525f979e2a97..7f4ee2e12735 100644
@@ -553,8 +553,7 @@ static void sdhci_sprd_phy_param_parse(struct sdhci_sprd_host *sprd_host,
 
 static const struct sdhci_pltfm_data sdhci_sprd_pdata = {
        .quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
-                 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
-                 SDHCI_QUIRK_MISSING_CAPS,
+                 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK,
        .quirks2 = SDHCI_QUIRK2_BROKEN_HS200 |
                   SDHCI_QUIRK2_USE_32BIT_BLK_CNT |
                   SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
@@ -671,8 +670,7 @@ static int sdhci_sprd_probe(struct platform_device *pdev)
         * will allow these modes to be specified only by device
         * tree properties through mmc_of_parse().
         */
-       host->caps = sdhci_readl(host, SDHCI_CAPABILITIES);
-       host->caps1 = sdhci_readl(host, SDHCI_CAPABILITIES_1);
+       sdhci_read_caps(host);
        host->caps1 &= ~(SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_SDR104 |
                         SDHCI_SUPPORT_DDR50);
 
--

2.34.1

author maintainer
#6 lore raw

PATCH 4/6 mmc: sdhci-pxav3: Replace SDHCI_QUIRK_MISSING_CAPS

In reply to Adrian Hunter

SDHCI_QUIRK_MISSING_CAPS is not needed because sdhci_read_caps() can be called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace SDHCI_QUIRK_MISSING_CAPS with sdhci_read_caps().

__sdhci_read_caps() is also called from sdhci_setup_host() via sdhci_read_caps(), however only the first call to __sdhci_read_caps() does anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a reset, so calling __sdhci_read_caps() earlier could have unforeseen side-effects. However the code flow has been reviewed with that in mind.

---
 drivers/mmc/host/sdhci-pxav3.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/sdhci-pxav3.c +1 -3
index a6d89a3f1946..e39dcc998772 100644
@@ -124,10 +124,8 @@ static int armada_38x_quirks(struct platform_device *pdev,
 	struct resource *res;
 
 	host->quirks &= ~SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN;
-	host->quirks |= SDHCI_QUIRK_MISSING_CAPS;
 
-	host->caps = sdhci_readl(host, SDHCI_CAPABILITIES);
-	host->caps1 = sdhci_readl(host, SDHCI_CAPABILITIES_1);
+	sdhci_read_caps(host);
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
 					   "conf-sdio3");
Signature · 1 line
2.34.1
Reviewed-by on v1 4/6
#7 lore raw

Re: [PATCH 4/6] mmc: sdhci-pxav3: Replace SDHCI_QUIRK_MISSING_CAPS

Quoted 10 lines · Adrian Hunter

SDHCI_QUIRK_MISSING_CAPS is not needed because sdhci_read_caps() can be called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace SDHCI_QUIRK_MISSING_CAPS with sdhci_read_caps().

__sdhci_read_caps() is also called from sdhci_setup_host() via sdhci_read_caps(), however only the first call to __sdhci_read_caps() does anything because after that host->read_caps has been set to true.

Quoted 5 lines

Note, __sdhci_read_caps() does more than just set host->caps, such as do a reset, so calling __sdhci_read_caps() earlier could have unforeseen side-effects. However the code flow has been reviewed with that in mind.

Quoted 23 lines
---
 drivers/mmc/host/sdhci-pxav3.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/mmc/host/sdhci-pxav3.c +1 -3
index a6d89a3f1946..e39dcc998772 100644
@@ -124,10 +124,8 @@ static int armada_38x_quirks(struct platform_device *pdev,
 	struct resource *res;
 
 	host->quirks &= ~SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN;
-	host->quirks |= SDHCI_QUIRK_MISSING_CAPS;
 
-	host->caps = sdhci_readl(host, SDHCI_CAPABILITIES);
-	host->caps1 = sdhci_readl(host, SDHCI_CAPABILITIES_1);
+	sdhci_read_caps(host);
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
 					   "conf-sdio3");
Signature · 1 line
2.34.1
author maintainer
#8 lore raw

PATCH 5/6 mmc: sdhci-iproc: Replace SDHCI_QUIRK_MISSING_CAPS

In reply to Adrian Hunter

SDHCI_QUIRK_MISSING_CAPS is not needed because __sdhci_read_caps() can be called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace SDHCI_QUIRK_MISSING_CAPS with __sdhci_read_caps().

__sdhci_read_caps() is also called from sdhci_setup_host() via sdhci_read_caps(), however only the first call to __sdhci_read_caps() does anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a reset, so calling __sdhci_read_caps() earlier could have unforeseen side-effects. However the code flow has been reviewed with that in mind.

---
 drivers/mmc/host/sdhci-iproc.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/mmc/host/sdhci-iproc.c +8 -6
index 6db35b1b8557..86eb0045515e 100644
@@ -18,6 +18,7 @@ struct sdhci_iproc_data {
 	u32 caps;
 	u32 caps1;
 	u32 mmc_caps;
+	bool missing_caps;
 };
 
 struct sdhci_iproc_host {
@@ -251,7 +252,6 @@ static const struct sdhci_iproc_data iproc_data = {
 static const struct sdhci_pltfm_data sdhci_bcm2835_pltfm_data = {
 	.quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
 		  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
-		  SDHCI_QUIRK_MISSING_CAPS |
 		  SDHCI_QUIRK_NO_HISPD_BIT,
 	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
 	.ops = &sdhci_iproc_32only_ops,
@@ -266,6 +266,7 @@ static const struct sdhci_iproc_data bcm2835_data = {
 	.caps1 = SDHCI_DRIVER_TYPE_A |
 		 SDHCI_DRIVER_TYPE_C,
 	.mmc_caps = 0x00000000,
+	.missing_caps = true,
 };
 
 static const struct sdhci_ops sdhci_iproc_bcm2711_ops = {
@@ -295,8 +296,7 @@ static const struct sdhci_iproc_data bcm2711_data = {
 };
 
 static const struct sdhci_pltfm_data sdhci_bcm7211a0_pltfm_data = {
-	.quirks = SDHCI_QUIRK_MISSING_CAPS |
-		SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
+	.quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
 		SDHCI_QUIRK_BROKEN_DMA |
 		SDHCI_QUIRK_BROKEN_ADMA,
 	.ops = &sdhci_iproc_ops,
@@ -315,6 +315,7 @@ static const struct sdhci_iproc_data bcm7211a0_data = {
 		SDHCI_CAN_DO_HISPD,
 	.caps1 = SDHCI_DRIVER_TYPE_C |
 		 SDHCI_DRIVER_TYPE_D,
+	.missing_caps = true,
 };
 
 static const struct of_device_id sdhci_iproc_of_match[] = {
@@ -397,9 +398,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev)
 		}
 	}
 
-	if (iproc_host->data->pdata->quirks & SDHCI_QUIRK_MISSING_CAPS) {
-		host->caps = iproc_host->data->caps;
-		host->caps1 = iproc_host->data->caps1;
+	if (iproc_host->data->missing_caps) {
+		__sdhci_read_caps(host, NULL,
+				  &iproc_host->data->caps,
+				  &iproc_host->data->caps1);
 	}
 
 	ret = sdhci_add_host(host);
Signature · 1 line
2.34.1
Acked-by on v1 5/6
#9 lore raw

Re: [PATCH 5/6] mmc: sdhci-iproc: Replace SDHCI_QUIRK_MISSING_CAPS

Quoted 10 lines · Adrian Hunter

SDHCI_QUIRK_MISSING_CAPS is not needed because __sdhci_read_caps() can be called instead.

In preparation to get rid of SDHCI_QUIRK_MISSING_CAPS, replace SDHCI_QUIRK_MISSING_CAPS with __sdhci_read_caps().

__sdhci_read_caps() is also called from sdhci_setup_host() via sdhci_read_caps(), however only the first call to __sdhci_read_caps() does anything because after that host->read_caps has been set to true.

Quoted 5 lines

Note, __sdhci_read_caps() does more than just set host->caps, such as do a reset, so calling __sdhci_read_caps() earlier could have unforeseen side-effects. However the code flow has been reviewed with that in mind.

Quoted 64 lines
---
  drivers/mmc/host/sdhci-iproc.c | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)
drivers/mmc/host/sdhci-iproc.c +8 -6
index 6db35b1b8557..86eb0045515e 100644
@@ -18,6 +18,7 @@ struct sdhci_iproc_data {
  	u32 caps;
  	u32 caps1;
  	u32 mmc_caps;
+	bool missing_caps;
  };
 
  struct sdhci_iproc_host {
@@ -251,7 +252,6 @@ static const struct sdhci_iproc_data iproc_data = {
  static const struct sdhci_pltfm_data sdhci_bcm2835_pltfm_data = {
  	.quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION |
  		  SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
-		  SDHCI_QUIRK_MISSING_CAPS |
  		  SDHCI_QUIRK_NO_HISPD_BIT,
  	.quirks2 = SDHCI_QUIRK2_PRESET_VALUE_BROKEN,
  	.ops = &sdhci_iproc_32only_ops,
@@ -266,6 +266,7 @@ static const struct sdhci_iproc_data bcm2835_data = {
  	.caps1 = SDHCI_DRIVER_TYPE_A |
  		 SDHCI_DRIVER_TYPE_C,
  	.mmc_caps = 0x00000000,
+	.missing_caps = true,
  };
 
  static const struct sdhci_ops sdhci_iproc_bcm2711_ops = {
@@ -295,8 +296,7 @@ static const struct sdhci_iproc_data bcm2711_data = {
  };
 
  static const struct sdhci_pltfm_data sdhci_bcm7211a0_pltfm_data = {
-	.quirks = SDHCI_QUIRK_MISSING_CAPS |
-		SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
+	.quirks = SDHCI_QUIRK_BROKEN_TIMEOUT_VAL |
  		SDHCI_QUIRK_BROKEN_DMA |
  		SDHCI_QUIRK_BROKEN_ADMA,
  	.ops = &sdhci_iproc_ops,
@@ -315,6 +315,7 @@ static const struct sdhci_iproc_data bcm7211a0_data = {
  		SDHCI_CAN_DO_HISPD,
  	.caps1 = SDHCI_DRIVER_TYPE_C |
  		 SDHCI_DRIVER_TYPE_D,
+	.missing_caps = true,
  };
 
  static const struct of_device_id sdhci_iproc_of_match[] = {
@@ -397,9 +398,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev)
  		}
  	}
 
-	if (iproc_host->data->pdata->quirks & SDHCI_QUIRK_MISSING_CAPS) {
-		host->caps = iproc_host->data->caps;
-		host->caps1 = iproc_host->data->caps1;
+	if (iproc_host->data->missing_caps) {
+		__sdhci_read_caps(host, NULL,
+				  &iproc_host->data->caps,
+				  &iproc_host->data->caps1);
  	}
 
  	ret = sdhci_add_host(host);
author maintainer
#10 lore raw

PATCH 6/6 mmc: sdhci: Remove SDHCI_QUIRK_MISSING_CAPS

In reply to Adrian Hunter

Now that it is no longer used, remove SDHCI_QUIRK_MISSING_CAPS.

Note, from now on, __sdhci_read_caps() should be used to provide missing capability flags.

---
 drivers/mmc/host/sdhci.c | 3 ---
 drivers/mmc/host/sdhci.h | 2 --
 2 files changed, 5 deletions(-)
drivers/mmc/host/sdhci.c +0 -3
index f3af1bd0f7b9..3241916141d7 100644
@@ -4121,9 +4121,6 @@ void __sdhci_read_caps(struct sdhci_host *host, const u16 *ver,
 	v = ver ? *ver : sdhci_readw(host, SDHCI_HOST_VERSION);
 	host->version = (v & SDHCI_SPEC_VER_MASK) >> SDHCI_SPEC_VER_SHIFT;
 
-	if (host->quirks & SDHCI_QUIRK_MISSING_CAPS)
-		return;
-
 	if (caps) {
 		host->caps = *caps;
 	} else {
drivers/mmc/host/sdhci.h +0 -2
index 605eaee805f7..f4f2085c274c 100644
@@ -423,8 +423,6 @@ struct sdhci_host {
 #define SDHCI_QUIRK_CAP_CLOCK_BASE_BROKEN		(1<<25)
 /* Controller cannot support End Attribute in NOP ADMA descriptor */
 #define SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC		(1<<26)
-/* Controller is missing device caps. Use caps provided by host */
-#define SDHCI_QUIRK_MISSING_CAPS			(1<<27)
 /* Controller uses Auto CMD12 command to stop the transfer */
 #define SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12		(1<<28)
 /* Controller doesn't have HISPD bit field in HI-SPEED SD card */
Signature · 1 line
2.34.1
#11 lore raw
In reply to Adrian Hunter
Quoted 35 lines · Adrian Hunter

Hi

This patch set is to remove SDHCI_QUIRK_MISSING_CAPS.

SDHCI_QUIRK_MISSING_CAPS is not needed because __sdhci_read_caps() can be called instead.

__sdhci_read_caps() is also called from sdhci_setup_host() via sdhci_read_caps(), however only the first call to __sdhci_read_caps() does anything because after that host->read_caps has been set to true.

Note, __sdhci_read_caps() does more than just set host->caps, such as do a reset, so calling __sdhci_read_caps() earlier could have unforeseen side-effects. However code flow has been reviewed with that in mind.

Adrian Hunter (6):
mmc: sdhci-pci: Replace SDHCI_QUIRK_MISSING_CAPS for Ricoh controller
mmc: sdhci-brcmstb: Replace SDHCI_QUIRK_MISSING_CAPS
mmc: sdhci-sprd: Replace SDHCI_QUIRK_MISSING_CAPS
mmc: sdhci-pxav3: Replace SDHCI_QUIRK_MISSING_CAPS
mmc: sdhci-iproc: Replace SDHCI_QUIRK_MISSING_CAPS
mmc: sdhci: Remove SDHCI_QUIRK_MISSING_CAPS

 drivers/mmc/host/sdhci-brcmstb.c  |  4 +---
 drivers/mmc/host/sdhci-iproc.c    | 14 ++++++++------
 drivers/mmc/host/sdhci-pci-core.c |  8 +++++---
 drivers/mmc/host/sdhci-pxav3.c    |  4 +---
 drivers/mmc/host/sdhci-sprd.c     |  6 ++----
 drivers/mmc/host/sdhci.c          |  3 ---
 drivers/mmc/host/sdhci.h          |  2 --
 7 files changed, 17 insertions(+), 24 deletions(-)
Quoted 2 lines

Regards
Adrian

Applied for next, thanks!

Kind regards
Uffe