public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] sdhci: remove SDHCI_QUIRK_FORCE_1_BIT_DATA
@ 2010-11-09 11:37 zhangfei gao
  2010-11-09 12:27 ` Anton Vorontsov
  0 siblings, 1 reply; 3+ messages in thread
From: zhangfei gao @ 2010-11-09 11:37 UTC (permalink / raw)
  To: linux-mmc, Xiaobo Xie, Anton Vorontsov
  Cc: Chris Ball, Kyungmin Park, Philip Rakity

[-- Attachment #1: Type: text/plain, Size: 3066 bytes --]

Hi, Xiaobo & Anton

Here is patch to remove SDHCI_QUIRK_FORCE_1_BIT_DATA, which only used
in drivers/mmc/host/sdhci-of-core.c.
The reason is quirk is too valuable resource, the type is u32, while
the highest is (1<<29) now.

1. MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA  is opened by default in sdhci.c
2. platform driver could close such flag after sdhci_add_host.

We have verified on our platform, would you mind check whether it
impact your driver behavior.

>From a5460d2fe6294287c4e86cedde5ac0f47b6b0368 Mon Sep 17 00:00:00 2001
From: Zhangfei Gao <zhangfei.gao@marvell.com>
Date: Tue, 9 Nov 2010 07:17:32 -0500
Subject: [PATCH] sdhci: remove SDHCI_QUIRK_FORCE_1_BIT_DATA

	SDHCI_QUIRK_FORCE_1_BIT_DATA only used for modify caps, which could
be updated after sdhci_add_host

Signed-off-by: Zhangfei Gao <zhangfei.gao@marvell.com>
---
 drivers/mmc/host/sdhci-of-core.c |    7 +++----
 drivers/mmc/host/sdhci.c         |    3 +--
 include/linux/mmc/sdhci.h        |    2 --
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-core.c b/drivers/mmc/host/sdhci-of-core.c
index c51b711..620d5bf 100644
--- a/drivers/mmc/host/sdhci-of-core.c
+++ b/drivers/mmc/host/sdhci-of-core.c
@@ -157,10 +157,6 @@ static int __devinit sdhci_of_probe(struct
platform_device *ofdev,
 	if (of_get_property(np, "sdhci,auto-cmd12", NULL))
 		host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;

-
-	if (of_get_property(np, "sdhci,1-bit-only", NULL))
-		host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
-
 	if (sdhci_of_wp_inverted(np))
 		host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;

@@ -172,6 +168,9 @@ static int __devinit sdhci_of_probe(struct
platform_device *ofdev,
 	if (ret)
 		goto err_add_host;

+	if (of_get_property(np, "sdhci,1-bit-only", NULL))
+		host->mmc->caps &= ~(MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA);
+
 	return 0;

 err_add_host:
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 154cbf8..8114bd3 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1858,8 +1858,7 @@ int sdhci_add_host(struct sdhci_host *host)
 	mmc->f_max = host->max_clk;
 	mmc->caps |= MMC_CAP_SDIO_IRQ;

-	if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA))
-		mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
+	mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;

 	if (caps & SDHCI_CAN_DO_HISPD)
 		mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 1fdc673..ede02a4 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -67,8 +67,6 @@ struct sdhci_host {
 #define SDHCI_QUIRK_FORCE_BLK_SZ_2048			(1<<20)
 /* Controller cannot do multi-block transfers */
 #define SDHCI_QUIRK_NO_MULTIBLOCK			(1<<21)
-/* Controller can only handle 1-bit data transfers */
-#define SDHCI_QUIRK_FORCE_1_BIT_DATA			(1<<22)
 /* Controller needs 10ms delay between applying power and clock */
 #define SDHCI_QUIRK_DELAY_AFTER_POWER			(1<<23)
 /* Controller uses SDCLK instead of TMCLK for data timeouts */
-- 
1.7.0.4

[-- Attachment #2: 0001-sdhci-remove-SDHCI_QUIRK_FORCE_1_BIT_DATA.patch --]
[-- Type: text/x-patch, Size: 2611 bytes --]

From a5460d2fe6294287c4e86cedde5ac0f47b6b0368 Mon Sep 17 00:00:00 2001
From: Zhangfei Gao <zhangfei.gao@marvell.com>
Date: Tue, 9 Nov 2010 07:17:32 -0500
Subject: [PATCH] sdhci: remove SDHCI_QUIRK_FORCE_1_BIT_DATA

	SDHCI_QUIRK_FORCE_1_BIT_DATA only used for modify caps, which could be updated after sdhci_add_host

Signed-off-by: Zhangfei Gao <zhangfei.gao@marvell.com>
---
 drivers/mmc/host/sdhci-of-core.c |    7 +++----
 drivers/mmc/host/sdhci.c         |    3 +--
 include/linux/mmc/sdhci.h        |    2 --
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/mmc/host/sdhci-of-core.c b/drivers/mmc/host/sdhci-of-core.c
index c51b711..620d5bf 100644
--- a/drivers/mmc/host/sdhci-of-core.c
+++ b/drivers/mmc/host/sdhci-of-core.c
@@ -157,10 +157,6 @@ static int __devinit sdhci_of_probe(struct platform_device *ofdev,
 	if (of_get_property(np, "sdhci,auto-cmd12", NULL))
 		host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
 
-
-	if (of_get_property(np, "sdhci,1-bit-only", NULL))
-		host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
-
 	if (sdhci_of_wp_inverted(np))
 		host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
 
@@ -172,6 +168,9 @@ static int __devinit sdhci_of_probe(struct platform_device *ofdev,
 	if (ret)
 		goto err_add_host;
 
+	if (of_get_property(np, "sdhci,1-bit-only", NULL))
+		host->mmc->caps &= ~(MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA);
+
 	return 0;
 
 err_add_host:
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 154cbf8..8114bd3 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -1858,8 +1858,7 @@ int sdhci_add_host(struct sdhci_host *host)
 	mmc->f_max = host->max_clk;
 	mmc->caps |= MMC_CAP_SDIO_IRQ;
 
-	if (!(host->quirks & SDHCI_QUIRK_FORCE_1_BIT_DATA))
-		mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
+	mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
 
 	if (caps & SDHCI_CAN_DO_HISPD)
 		mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 1fdc673..ede02a4 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -67,8 +67,6 @@ struct sdhci_host {
 #define SDHCI_QUIRK_FORCE_BLK_SZ_2048			(1<<20)
 /* Controller cannot do multi-block transfers */
 #define SDHCI_QUIRK_NO_MULTIBLOCK			(1<<21)
-/* Controller can only handle 1-bit data transfers */
-#define SDHCI_QUIRK_FORCE_1_BIT_DATA			(1<<22)
 /* Controller needs 10ms delay between applying power and clock */
 #define SDHCI_QUIRK_DELAY_AFTER_POWER			(1<<23)
 /* Controller uses SDCLK instead of TMCLK for data timeouts */
-- 
1.7.0.4


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

* Re: [patch] sdhci: remove SDHCI_QUIRK_FORCE_1_BIT_DATA
  2010-11-09 11:37 [patch] sdhci: remove SDHCI_QUIRK_FORCE_1_BIT_DATA zhangfei gao
@ 2010-11-09 12:27 ` Anton Vorontsov
  2010-11-09 12:31   ` Philip Rakity
  0 siblings, 1 reply; 3+ messages in thread
From: Anton Vorontsov @ 2010-11-09 12:27 UTC (permalink / raw)
  To: zhangfei gao
  Cc: linux-mmc, Xiaobo Xie, Chris Ball, Kyungmin Park, Philip Rakity,
	Pierre Ossman

Hi,

On Tue, Nov 09, 2010 at 06:37:58AM -0500, zhangfei gao wrote:
> Here is patch to remove SDHCI_QUIRK_FORCE_1_BIT_DATA, which only used
> in drivers/mmc/host/sdhci-of-core.c.
> The reason is quirk is too valuable resource, the type is u32, while
> the highest is (1<<29) now.

FYI, initially that wasn't a quirk. Here is Pierre's last opinion on that:

http://lists.ozlabs.org/pipermail/devicetree-discuss/2009-June/000981.html

Thanks,

> 1. MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA  is opened by default in sdhci.c
> 2. platform driver could close such flag after sdhci_add_host.
> 
> We have verified on our platform, would you mind check whether it
> impact your driver behavior.

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

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

* Re: [patch] sdhci: remove SDHCI_QUIRK_FORCE_1_BIT_DATA
  2010-11-09 12:27 ` Anton Vorontsov
@ 2010-11-09 12:31   ` Philip Rakity
  0 siblings, 0 replies; 3+ messages in thread
From: Philip Rakity @ 2010-11-09 12:31 UTC (permalink / raw)
  To: Anton Vorontsov
  Cc: zhangfei gao, linux-mmc@vger.kernel.org, Xiaobo Xie, Chris Ball,
	Kyungmin Park, Pierre Ossman


On Nov 9, 2010, at 4:27 AM, Anton Vorontsov wrote:

> Hi,
> 
> On Tue, Nov 09, 2010 at 06:37:58AM -0500, zhangfei gao wrote:
>> Here is patch to remove SDHCI_QUIRK_FORCE_1_BIT_DATA, which only used
>> in drivers/mmc/host/sdhci-of-core.c.
>> The reason is quirk is too valuable resource, the type is u32, while
>> the highest is (1<<29) now.
> 
> FYI, initially that wasn't a quirk. Here is Pierre's last opinion on that:
> 
> http://lists.ozlabs.org/pipermail/devicetree-discuss/2009-June/000981.html
> 
> Thanks,
> 
>> 1. MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA  is opened by default in sdhci.c

This a mistake that 8_BIT is opened.  means platform specific drivers need to change since
the functionality they assumed is incorrect.   Should be added after call to add_host() as needed by
each platform driver.  Zhangfei's suggested patch is good starting point for this.

>> 2. platform driver could close such flag after sdhci_add_host.
>> 
>> We have verified on our platform, would you mind check whether it
>> impact your driver behavior.
> 
> -- 
> Anton Vorontsov
> email: cbouatmailru@gmail.com
> irc://irc.freenode.net/bd2


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

end of thread, other threads:[~2010-11-09 12:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-09 11:37 [patch] sdhci: remove SDHCI_QUIRK_FORCE_1_BIT_DATA zhangfei gao
2010-11-09 12:27 ` Anton Vorontsov
2010-11-09 12:31   ` Philip Rakity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox