aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-03-05 11:51:10 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-05 11:51:10 -0500
commit550cf00dbc8ee402bef71628cb71246493dd4500 (patch)
treecfcfd6cab72c620b5e567fe64f06e6d8a3c3befc /drivers
parent5d329e245f9a1edb905284730650a0c6c806fb2e (diff)
parente7747475b61fdc2a4a412475a9d64d8c309916e3 (diff)
Merge tag 'mmc-fixes-for-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc
MMC fixes from Chris Ball for 3.3: - atmel-mci: oops fix against regression introduced in 3.2 - core: power saving regression fix against 3.3-rc1 - core: suspend/resume fix for UHS-I cards - esdhc-imx: MMC card regression fix against 3.0 - mmci: oops fix for ARM systems with large (64k) pages - MAINTAINERS update for atmel-mci. * tag 'mmc-fixes-for-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc: mmc: core: Fixup suspend/resume issues for UHS-I cards mmc: mmci: reduce max_blk_count to avoid overflowing max_req_size mmc: sdhci-esdhc-imx: fix for mmc cards on i.MX5 mmc: core: fix regression: set default clock gating delay to 0 MAINTAINERS: hand over atmel-mci (sd/mmc interface) mmc: atmel-mci: don't use dma features when using DMA with no chan available
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/core/core.c3
-rw-r--r--drivers/mmc/core/host.c4
-rw-r--r--drivers/mmc/core/mmc.c3
-rw-r--r--drivers/mmc/core/sd.c8
-rw-r--r--drivers/mmc/core/sdio.c8
-rw-r--r--drivers/mmc/host/atmel-mci.c21
-rw-r--r--drivers/mmc/host/mmci.c7
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c5
8 files changed, 36 insertions, 23 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 690255c7d4dc..132378b89d76 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2068,6 +2068,9 @@ static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
2068 */ 2068 */
2069 mmc_hw_reset_for_init(host); 2069 mmc_hw_reset_for_init(host);
2070 2070
2071 /* Initialization should be done at 3.3 V I/O voltage. */
2072 mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
2073
2071 /* 2074 /*
2072 * sdio_reset sends CMD52 to reset card. Since we do not know 2075 * sdio_reset sends CMD52 to reset card. Since we do not know
2073 * if the card is being re-initialized, just send it. CMD52 2076 * if the card is being re-initialized, just send it. CMD52
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 30055f2b0d44..c3704e293a7b 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -238,10 +238,10 @@ static inline void mmc_host_clk_init(struct mmc_host *host)
238 /* Hold MCI clock for 8 cycles by default */ 238 /* Hold MCI clock for 8 cycles by default */
239 host->clk_delay = 8; 239 host->clk_delay = 8;
240 /* 240 /*
241 * Default clock gating delay is 200ms. 241 * Default clock gating delay is 0ms to avoid wasting power.
242 * This value can be tuned by writing into sysfs entry. 242 * This value can be tuned by writing into sysfs entry.
243 */ 243 */
244 host->clkgate_delay = 200; 244 host->clkgate_delay = 0;
245 host->clk_gated = false; 245 host->clk_gated = false;
246 INIT_DELAYED_WORK(&host->clk_gate_work, mmc_host_clk_gate_work); 246 INIT_DELAYED_WORK(&host->clk_gate_work, mmc_host_clk_gate_work);
247 spin_lock_init(&host->clk_lock); 247 spin_lock_init(&host->clk_lock);
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index a48066344fa8..2b9ed1401dc4 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -816,6 +816,9 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
816 if (!mmc_host_is_spi(host)) 816 if (!mmc_host_is_spi(host))
817 mmc_set_bus_mode(host, MMC_BUSMODE_OPENDRAIN); 817 mmc_set_bus_mode(host, MMC_BUSMODE_OPENDRAIN);
818 818
819 /* Initialization should be done at 3.3 V I/O voltage. */
820 mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
821
819 /* 822 /*
820 * Since we're changing the OCR value, we seem to 823 * Since we're changing the OCR value, we seem to
821 * need to tell some cards to go back to the idle 824 * need to tell some cards to go back to the idle
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 5017f9354ce2..c272c6868ecf 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -911,6 +911,9 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
911 BUG_ON(!host); 911 BUG_ON(!host);
912 WARN_ON(!host->claimed); 912 WARN_ON(!host->claimed);
913 913
914 /* The initialization should be done at 3.3 V I/O voltage. */
915 mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
916
914 err = mmc_sd_get_cid(host, ocr, cid, &rocr); 917 err = mmc_sd_get_cid(host, ocr, cid, &rocr);
915 if (err) 918 if (err)
916 return err; 919 return err;
@@ -1156,11 +1159,6 @@ int mmc_attach_sd(struct mmc_host *host)
1156 BUG_ON(!host); 1159 BUG_ON(!host);
1157 WARN_ON(!host->claimed); 1160 WARN_ON(!host->claimed);
1158 1161
1159 /* Make sure we are at 3.3V signalling voltage */
1160 err = mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, false);
1161 if (err)
1162 return err;
1163
1164 /* Disable preset value enable if already set since last time */ 1162 /* Disable preset value enable if already set since last time */
1165 if (host->ops->enable_preset_value) { 1163 if (host->ops->enable_preset_value) {
1166 mmc_host_clk_hold(host); 1164 mmc_host_clk_hold(host);
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 12cde6ee17f5..2c7c83f832d2 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -585,6 +585,9 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
585 * Inform the card of the voltage 585 * Inform the card of the voltage
586 */ 586 */
587 if (!powered_resume) { 587 if (!powered_resume) {
588 /* The initialization should be done at 3.3 V I/O voltage. */
589 mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
590
588 err = mmc_send_io_op_cond(host, host->ocr, &ocr); 591 err = mmc_send_io_op_cond(host, host->ocr, &ocr);
589 if (err) 592 if (err)
590 goto err; 593 goto err;
@@ -996,6 +999,11 @@ static int mmc_sdio_power_restore(struct mmc_host *host)
996 * With these steps taken, mmc_select_voltage() is also required to 999 * With these steps taken, mmc_select_voltage() is also required to
997 * restore the correct voltage setting of the card. 1000 * restore the correct voltage setting of the card.
998 */ 1001 */
1002
1003 /* The initialization should be done at 3.3 V I/O voltage. */
1004 if (!mmc_card_keep_power(host))
1005 mmc_set_signal_voltage(host, MMC_SIGNAL_VOLTAGE_330, 0);
1006
999 sdio_reset(host); 1007 sdio_reset(host);
1000 mmc_go_idle(host); 1008 mmc_go_idle(host);
1001 mmc_send_if_cond(host, host->ocr_avail); 1009 mmc_send_if_cond(host, host->ocr_avail);
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 6985cdb0bb26..e4449a54ae8f 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -1948,12 +1948,12 @@ static bool atmci_filter(struct dma_chan *chan, void *slave)
1948 } 1948 }
1949} 1949}
1950 1950
1951static void atmci_configure_dma(struct atmel_mci *host) 1951static bool atmci_configure_dma(struct atmel_mci *host)
1952{ 1952{
1953 struct mci_platform_data *pdata; 1953 struct mci_platform_data *pdata;
1954 1954
1955 if (host == NULL) 1955 if (host == NULL)
1956 return; 1956 return false;
1957 1957
1958 pdata = host->pdev->dev.platform_data; 1958 pdata = host->pdev->dev.platform_data;
1959 1959
@@ -1970,12 +1970,15 @@ static void atmci_configure_dma(struct atmel_mci *host)
1970 host->dma.chan = 1970 host->dma.chan =
1971 dma_request_channel(mask, atmci_filter, pdata->dma_slave); 1971 dma_request_channel(mask, atmci_filter, pdata->dma_slave);
1972 } 1972 }
1973 if (!host->dma.chan) 1973 if (!host->dma.chan) {
1974 dev_notice(&host->pdev->dev, "DMA not available, using PIO\n"); 1974 dev_warn(&host->pdev->dev, "no DMA channel available\n");
1975 else 1975 return false;
1976 } else {
1976 dev_info(&host->pdev->dev, 1977 dev_info(&host->pdev->dev,
1977 "Using %s for DMA transfers\n", 1978 "Using %s for DMA transfers\n",
1978 dma_chan_name(host->dma.chan)); 1979 dma_chan_name(host->dma.chan));
1980 return true;
1981 }
1979} 1982}
1980 1983
1981static inline unsigned int atmci_get_version(struct atmel_mci *host) 1984static inline unsigned int atmci_get_version(struct atmel_mci *host)
@@ -2085,8 +2088,7 @@ static int __init atmci_probe(struct platform_device *pdev)
2085 2088
2086 /* Get MCI capabilities and set operations according to it */ 2089 /* Get MCI capabilities and set operations according to it */
2087 atmci_get_cap(host); 2090 atmci_get_cap(host);
2088 if (host->caps.has_dma) { 2091 if (host->caps.has_dma && atmci_configure_dma(host)) {
2089 dev_info(&pdev->dev, "using DMA\n");
2090 host->prepare_data = &atmci_prepare_data_dma; 2092 host->prepare_data = &atmci_prepare_data_dma;
2091 host->submit_data = &atmci_submit_data_dma; 2093 host->submit_data = &atmci_submit_data_dma;
2092 host->stop_transfer = &atmci_stop_transfer_dma; 2094 host->stop_transfer = &atmci_stop_transfer_dma;
@@ -2096,15 +2098,12 @@ static int __init atmci_probe(struct platform_device *pdev)
2096 host->submit_data = &atmci_submit_data_pdc; 2098 host->submit_data = &atmci_submit_data_pdc;
2097 host->stop_transfer = &atmci_stop_transfer_pdc; 2099 host->stop_transfer = &atmci_stop_transfer_pdc;
2098 } else { 2100 } else {
2099 dev_info(&pdev->dev, "no DMA, no PDC\n"); 2101 dev_info(&pdev->dev, "using PIO\n");
2100 host->prepare_data = &atmci_prepare_data; 2102 host->prepare_data = &atmci_prepare_data;
2101 host->submit_data = &atmci_submit_data; 2103 host->submit_data = &atmci_submit_data;
2102 host->stop_transfer = &atmci_stop_transfer; 2104 host->stop_transfer = &atmci_stop_transfer;
2103 } 2105 }
2104 2106
2105 if (host->caps.has_dma)
2106 atmci_configure_dma(host);
2107
2108 platform_set_drvdata(pdev, host); 2107 platform_set_drvdata(pdev, host);
2109 2108
2110 /* We need at least one slot to succeed */ 2109 /* We need at least one slot to succeed */
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 0d955ffaf44e..11e589cd8233 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1271,12 +1271,13 @@ static int __devinit mmci_probe(struct amba_device *dev,
1271 /* 1271 /*
1272 * Block size can be up to 2048 bytes, but must be a power of two. 1272 * Block size can be up to 2048 bytes, but must be a power of two.
1273 */ 1273 */
1274 mmc->max_blk_size = 2048; 1274 mmc->max_blk_size = 1 << 11;
1275 1275
1276 /* 1276 /*
1277 * No limit on the number of blocks transferred. 1277 * Limit the number of blocks transferred so that we don't overflow
1278 * the maximum request size.
1278 */ 1279 */
1279 mmc->max_blk_count = mmc->max_req_size; 1280 mmc->max_blk_count = mmc->max_req_size >> 11;
1280 1281
1281 spin_lock_init(&host->lock); 1282 spin_lock_init(&host->lock);
1282 1283
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index d601e41af282..0be4e2013632 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -269,8 +269,9 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg)
269 imx_data->scratchpad = val; 269 imx_data->scratchpad = val;
270 return; 270 return;
271 case SDHCI_COMMAND: 271 case SDHCI_COMMAND:
272 if ((host->cmd->opcode == MMC_STOP_TRANSMISSION) 272 if ((host->cmd->opcode == MMC_STOP_TRANSMISSION ||
273 && (imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT)) 273 host->cmd->opcode == MMC_SET_BLOCK_COUNT) &&
274 (imx_data->flags & ESDHC_FLAG_MULTIBLK_NO_INT))
274 val |= SDHCI_CMD_ABORTCMD; 275 val |= SDHCI_CMD_ABORTCMD;
275 276
276 if (is_imx6q_usdhc(imx_data)) { 277 if (is_imx6q_usdhc(imx_data)) {