public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mmc: bfin_sdh: fix unused sg warning on BF51x/BF52x systems
@ 2010-01-19  8:02 Mike Frysinger
  2010-01-19  8:02 ` [PATCH 2/3] mmc: bfin_sdh: drop redundant MMC depend string Mike Frysinger
  2010-01-19  8:02 ` [PATCH 3/3] mmc: bfin_sdh: set timeout based on actual card data Mike Frysinger
  0 siblings, 2 replies; 4+ messages in thread
From: Mike Frysinger @ 2010-01-19  8:02 UTC (permalink / raw)
  To: linux-mmc, Adrian Hunter, Andrew Morton; +Cc: linux-kernel, uclinux-dist-devel

The local sg variable is only used with BF54x code.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/mmc/host/bfin_sdh.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/bfin_sdh.c b/drivers/mmc/host/bfin_sdh.c
index 3343a57..f218a99 100644
--- a/drivers/mmc/host/bfin_sdh.c
+++ b/drivers/mmc/host/bfin_sdh.c
@@ -115,7 +115,6 @@ static int sdh_setup_data(struct sdh_host *host, struct mmc_data *data)
 	unsigned int length;
 	unsigned int data_ctl;
 	unsigned int dma_cfg;
-	struct scatterlist *sg;
 
 	dev_dbg(mmc_dev(host->mmc), "%s enter flags: 0x%x\n", __func__, data->flags);
 	host->data = data;
@@ -151,6 +150,7 @@ static int sdh_setup_data(struct sdh_host *host, struct mmc_data *data)
 #if defined(CONFIG_BF54x)
 	dma_cfg |= DMAFLOW_ARRAY | NDSIZE_5 | RESTART | WDSIZE_32 | DMAEN;
 	{
+		struct scatterlist *sg;
 		int i;
 		for_each_sg(data->sg, sg, host->dma_len, i) {
 			host->sg_cpu[i].start_addr = sg_dma_address(sg);
-- 
1.6.6


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

* [PATCH 2/3] mmc: bfin_sdh: drop redundant MMC depend string
  2010-01-19  8:02 [PATCH 1/3] mmc: bfin_sdh: fix unused sg warning on BF51x/BF52x systems Mike Frysinger
@ 2010-01-19  8:02 ` Mike Frysinger
  2010-01-19  8:02 ` [PATCH 3/3] mmc: bfin_sdh: set timeout based on actual card data Mike Frysinger
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2010-01-19  8:02 UTC (permalink / raw)
  To: linux-mmc, Adrian Hunter, Andrew Morton; +Cc: linux-kernel, uclinux-dist-devel

The host/Kconfig file is only included when MMC is selected.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/mmc/host/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index ce1d288..f6af92a 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -399,7 +399,7 @@ config MMC_VIA_SDMMC
 
 config SDH_BFIN
 	tristate "Blackfin Secure Digital Host support"
-	depends on MMC && ((BF54x && !BF544) || (BF51x && !BF512))
+	depends on (BF54x && !BF544) || (BF51x && !BF512)
 	help
 	  If you say yes here you will get support for the Blackfin on-chip
 	  Secure Digital Host interface.  This includes support for MMC and
-- 
1.6.6


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

* [PATCH 3/3] mmc: bfin_sdh: set timeout based on actual card data
  2010-01-19  8:02 [PATCH 1/3] mmc: bfin_sdh: fix unused sg warning on BF51x/BF52x systems Mike Frysinger
  2010-01-19  8:02 ` [PATCH 2/3] mmc: bfin_sdh: drop redundant MMC depend string Mike Frysinger
@ 2010-01-19  8:02 ` Mike Frysinger
  2010-01-26  0:07   ` Andrew Morton
  1 sibling, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2010-01-19  8:02 UTC (permalink / raw)
  To: linux-mmc, Adrian Hunter, Andrew Morton
  Cc: linux-kernel, uclinux-dist-devel, Cliff Cai

From: Cliff Cai <cliff.cai@analog.com>

The hardcoded value doesn't really work for all cards.

Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 drivers/mmc/host/bfin_sdh.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/bfin_sdh.c b/drivers/mmc/host/bfin_sdh.c
index f218a99..56f7b44 100644
--- a/drivers/mmc/host/bfin_sdh.c
+++ b/drivers/mmc/host/bfin_sdh.c
@@ -115,6 +115,7 @@ static int sdh_setup_data(struct sdh_host *host, struct mmc_data *data)
 	unsigned int length;
 	unsigned int data_ctl;
 	unsigned int dma_cfg;
+	unsigned int cycle_ns, timeout;
 
 	dev_dbg(mmc_dev(host->mmc), "%s enter flags: 0x%x\n", __func__, data->flags);
 	host->data = data;
@@ -135,8 +136,11 @@ static int sdh_setup_data(struct sdh_host *host, struct mmc_data *data)
 	data_ctl |= ((ffs(data->blksz) - 1) << 4);
 
 	bfin_write_SDH_DATA_CTL(data_ctl);
-
-	bfin_write_SDH_DATA_TIMER(0xFFFF);
+	/* the time of a host clock period in ns */
+	cycle_ns = 1000000000 / (get_sclk() / (2 * (host->clk_div + 1)));
+	timeout = data->timeout_ns / cycle_ns;
+	timeout += data->timeout_clks;
+	bfin_write_SDH_DATA_TIMER(timeout);
 	SSYNC();
 
 	if (data->flags & MMC_DATA_READ) {
-- 
1.6.6


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

* Re: [PATCH 3/3] mmc: bfin_sdh: set timeout based on actual card data
  2010-01-19  8:02 ` [PATCH 3/3] mmc: bfin_sdh: set timeout based on actual card data Mike Frysinger
@ 2010-01-26  0:07   ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2010-01-26  0:07 UTC (permalink / raw)
  To: Mike Frysinger
  Cc: linux-mmc, Adrian Hunter, linux-kernel, uclinux-dist-devel,
	Cliff Cai

On Tue, 19 Jan 2010 03:02:11 -0500
Mike Frysinger <vapier@gentoo.org> wrote:

> From: Cliff Cai <cliff.cai@analog.com>
> 
> The hardcoded value doesn't really work for all cards.
> 
> Signed-off-by: Cliff Cai <cliff.cai@analog.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Please don't write crappy changelogs.  

How am I to determine whether we want this fix in 2.6.33 and possibly
earlier?  How is anyone whose 2.6.32.x kernel "doesn't really work" to
determine whether this patch might fix it?


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

end of thread, other threads:[~2010-01-26  0:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-19  8:02 [PATCH 1/3] mmc: bfin_sdh: fix unused sg warning on BF51x/BF52x systems Mike Frysinger
2010-01-19  8:02 ` [PATCH 2/3] mmc: bfin_sdh: drop redundant MMC depend string Mike Frysinger
2010-01-19  8:02 ` [PATCH 3/3] mmc: bfin_sdh: set timeout based on actual card data Mike Frysinger
2010-01-26  0:07   ` Andrew Morton

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