From 7de427d088a967d2173739e21e744921d5496a8b Mon Sep 17 00:00:00 2001 From: Jorg Schummer Date: Thu, 19 Feb 2009 13:17:03 +0200 Subject: mmc: delayed_work was never cancelled The delayed work item mmc_host.detect is now cancelled before flushing the work queue. This takes care of cases when delayed_work was scheduled for mmc_host.detect, but not yet placed in the work queue. Signed-off-by: Jorg Schummer Signed-off-by: Pierre Ossman --- drivers/mmc/core/core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/mmc/core/core.c') diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index df6ce4a06cf..b5899e33b68 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -815,6 +815,7 @@ void mmc_stop_host(struct mmc_host *host) spin_unlock_irqrestore(&host->lock, flags); #endif + cancel_delayed_work(&host->detect); mmc_flush_scheduled_work(); mmc_bus_get(host); @@ -842,6 +843,7 @@ void mmc_stop_host(struct mmc_host *host) */ int mmc_suspend_host(struct mmc_host *host, pm_message_t state) { + cancel_delayed_work(&host->detect); mmc_flush_scheduled_work(); mmc_bus_get(host); -- cgit v1.2.3 From d3096f88ac4596a509fc5fbe6fa7e7a5497eb399 Mon Sep 17 00:00:00 2001 From: Balaji Rao Date: Wed, 25 Feb 2009 15:28:09 +0530 Subject: mmc: During unsafe resume, select the right volatge for the card During mmc unsafe resume, choose the right voltage for the card after powerup. Although this has not seen to cause trouble, it's the wrong behaviour. Signed-off-by: Balaji Rao Signed-off-by: Pierre Ossman --- drivers/mmc/core/core.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/mmc/core/core.c') diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index b5899e33b68..4a18d90556d 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -877,6 +877,7 @@ int mmc_resume_host(struct mmc_host *host) mmc_bus_get(host); if (host->bus_ops && !host->bus_dead) { mmc_power_up(host); + mmc_select_voltage(host, host->ocr); BUG_ON(!host->bus_ops->resume); host->bus_ops->resume(host); } -- cgit v1.2.3 From c0c88871574ccb4ee53dde1bbb678931b38ed47b Mon Sep 17 00:00:00 2001 From: Wolfgang Muees Date: Wed, 11 Mar 2009 14:28:39 +0100 Subject: mmc_spi: allow higher timeouts for SPI mode Some SD cards have very high timeouts in SPI mode. So adjust the timeouts from theory to practice. Signed-off-by: Wolfgang Muees Acked-by: David Brownell Signed-off-by: Pierre Ossman --- drivers/mmc/core/core.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/mmc/core/core.c') diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 4a18d90556d..5c83c67b186 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -297,6 +297,21 @@ void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card) data->timeout_clks = 0; } } + /* + * Some cards need very high timeouts if driven in SPI mode. + * The worst observed timeout was 900ms after writing a + * continuous stream of data until the internal logic + * overflowed. + */ + if (mmc_host_is_spi(card->host)) { + if (data->flags & MMC_DATA_WRITE) { + if (data->timeout_ns < 1000000000) + data->timeout_ns = 1000000000; /* 1s */ + } else { + if (data->timeout_ns < 100000000) + data->timeout_ns = 100000000; /* 100ms */ + } + } } EXPORT_SYMBOL(mmc_set_data_timeout); -- cgit v1.2.3