diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-10-30 04:43:08 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-10-30 04:43:08 -0400 |
commit | 169ed55bd30305b933f52bfab32a58671d44ab68 (patch) | |
tree | 32e280957474f458901abfce16fa2a1687ef7497 /drivers/mmc | |
parent | 3d7851b3cdd43a734e5cc4c643fd886ab28ad4d5 (diff) | |
parent | 45f81b1c96d9793e47ce925d257ea693ce0b193e (diff) |
Merge branch 'tip/perf/jump-label-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into perf/urgent
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/card/block.c | 10 | ||||
-rw-r--r-- | drivers/mmc/card/queue.c | 1 | ||||
-rw-r--r-- | drivers/mmc/core/debugfs.c | 1 | ||||
-rw-r--r-- | drivers/mmc/host/Kconfig | 2 | ||||
-rw-r--r-- | drivers/mmc/host/omap_hsmmc.c | 43 |
5 files changed, 34 insertions, 23 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index d545f79f6000..00073b7c0368 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/kdev_t.h> | 29 | #include <linux/kdev_t.h> |
30 | #include <linux/blkdev.h> | 30 | #include <linux/blkdev.h> |
31 | #include <linux/mutex.h> | 31 | #include <linux/mutex.h> |
32 | #include <linux/smp_lock.h> | ||
33 | #include <linux/scatterlist.h> | 32 | #include <linux/scatterlist.h> |
34 | #include <linux/string_helpers.h> | 33 | #include <linux/string_helpers.h> |
35 | 34 | ||
@@ -51,6 +50,7 @@ MODULE_ALIAS("mmc:block"); | |||
51 | #define MMC_SHIFT 3 | 50 | #define MMC_SHIFT 3 |
52 | #define MMC_NUM_MINORS (256 >> MMC_SHIFT) | 51 | #define MMC_NUM_MINORS (256 >> MMC_SHIFT) |
53 | 52 | ||
53 | static DEFINE_MUTEX(block_mutex); | ||
54 | static DECLARE_BITMAP(dev_use, MMC_NUM_MINORS); | 54 | static DECLARE_BITMAP(dev_use, MMC_NUM_MINORS); |
55 | 55 | ||
56 | /* | 56 | /* |
@@ -108,7 +108,7 @@ static int mmc_blk_open(struct block_device *bdev, fmode_t mode) | |||
108 | struct mmc_blk_data *md = mmc_blk_get(bdev->bd_disk); | 108 | struct mmc_blk_data *md = mmc_blk_get(bdev->bd_disk); |
109 | int ret = -ENXIO; | 109 | int ret = -ENXIO; |
110 | 110 | ||
111 | lock_kernel(); | 111 | mutex_lock(&block_mutex); |
112 | if (md) { | 112 | if (md) { |
113 | if (md->usage == 2) | 113 | if (md->usage == 2) |
114 | check_disk_change(bdev); | 114 | check_disk_change(bdev); |
@@ -119,7 +119,7 @@ static int mmc_blk_open(struct block_device *bdev, fmode_t mode) | |||
119 | ret = -EROFS; | 119 | ret = -EROFS; |
120 | } | 120 | } |
121 | } | 121 | } |
122 | unlock_kernel(); | 122 | mutex_unlock(&block_mutex); |
123 | 123 | ||
124 | return ret; | 124 | return ret; |
125 | } | 125 | } |
@@ -128,9 +128,9 @@ static int mmc_blk_release(struct gendisk *disk, fmode_t mode) | |||
128 | { | 128 | { |
129 | struct mmc_blk_data *md = disk->private_data; | 129 | struct mmc_blk_data *md = disk->private_data; |
130 | 130 | ||
131 | lock_kernel(); | 131 | mutex_lock(&block_mutex); |
132 | mmc_blk_put(md); | 132 | mmc_blk_put(md); |
133 | unlock_kernel(); | 133 | mutex_unlock(&block_mutex); |
134 | return 0; | 134 | return 0; |
135 | } | 135 | } |
136 | 136 | ||
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index e876678176be..9c0b42bfe089 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c | |||
@@ -128,7 +128,6 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock | |||
128 | mq->req = NULL; | 128 | mq->req = NULL; |
129 | 129 | ||
130 | blk_queue_prep_rq(mq->queue, mmc_prep_request); | 130 | blk_queue_prep_rq(mq->queue, mmc_prep_request); |
131 | blk_queue_ordered(mq->queue, QUEUE_ORDERED_DRAIN); | ||
132 | queue_flag_set_unlocked(QUEUE_FLAG_NONROT, mq->queue); | 131 | queue_flag_set_unlocked(QUEUE_FLAG_NONROT, mq->queue); |
133 | if (mmc_can_erase(card)) { | 132 | if (mmc_can_erase(card)) { |
134 | queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mq->queue); | 133 | queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mq->queue); |
diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c index 53cb380c0987..46bc6d7551a3 100644 --- a/drivers/mmc/core/debugfs.c +++ b/drivers/mmc/core/debugfs.c | |||
@@ -245,6 +245,7 @@ static const struct file_operations mmc_dbg_ext_csd_fops = { | |||
245 | .open = mmc_ext_csd_open, | 245 | .open = mmc_ext_csd_open, |
246 | .read = mmc_ext_csd_read, | 246 | .read = mmc_ext_csd_read, |
247 | .release = mmc_ext_csd_release, | 247 | .release = mmc_ext_csd_release, |
248 | .llseek = default_llseek, | ||
248 | }; | 249 | }; |
249 | 250 | ||
250 | void mmc_add_card_debugfs(struct mmc_card *card) | 251 | void mmc_add_card_debugfs(struct mmc_card *card) |
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 68d12794cfd9..1a0261160e56 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig | |||
@@ -237,7 +237,7 @@ endchoice | |||
237 | 237 | ||
238 | config MMC_ATMELMCI_DMA | 238 | config MMC_ATMELMCI_DMA |
239 | bool "Atmel MCI DMA support (EXPERIMENTAL)" | 239 | bool "Atmel MCI DMA support (EXPERIMENTAL)" |
240 | depends on MMC_ATMELMCI && AVR32 && DMA_ENGINE && EXPERIMENTAL | 240 | depends on MMC_ATMELMCI && (AVR32 || ARCH_AT91SAM9G45) && DMA_ENGINE && EXPERIMENTAL |
241 | help | 241 | help |
242 | Say Y here to have the Atmel MCI driver use a DMA engine to | 242 | Say Y here to have the Atmel MCI driver use a DMA engine to |
243 | do data transfers and thus increase the throughput and | 243 | do data transfers and thus increase the throughput and |
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 4526d2791f29..4693e62145a6 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c | |||
@@ -364,6 +364,7 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) | |||
364 | { | 364 | { |
365 | struct regulator *reg; | 365 | struct regulator *reg; |
366 | int ret = 0; | 366 | int ret = 0; |
367 | int ocr_value = 0; | ||
367 | 368 | ||
368 | switch (host->id) { | 369 | switch (host->id) { |
369 | case OMAP_MMC1_DEVID: | 370 | case OMAP_MMC1_DEVID: |
@@ -396,6 +397,17 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) | |||
396 | } | 397 | } |
397 | } else { | 398 | } else { |
398 | host->vcc = reg; | 399 | host->vcc = reg; |
400 | ocr_value = mmc_regulator_get_ocrmask(reg); | ||
401 | if (!mmc_slot(host).ocr_mask) { | ||
402 | mmc_slot(host).ocr_mask = ocr_value; | ||
403 | } else { | ||
404 | if (!(mmc_slot(host).ocr_mask & ocr_value)) { | ||
405 | pr_err("MMC%d ocrmask %x is not supported\n", | ||
406 | host->id, mmc_slot(host).ocr_mask); | ||
407 | mmc_slot(host).ocr_mask = 0; | ||
408 | return -EINVAL; | ||
409 | } | ||
410 | } | ||
399 | mmc_slot(host).ocr_mask = mmc_regulator_get_ocrmask(reg); | 411 | mmc_slot(host).ocr_mask = mmc_regulator_get_ocrmask(reg); |
400 | 412 | ||
401 | /* Allow an aux regulator */ | 413 | /* Allow an aux regulator */ |
@@ -982,6 +994,17 @@ static inline void omap_hsmmc_reset_controller_fsm(struct omap_hsmmc_host *host, | |||
982 | OMAP_HSMMC_WRITE(host->base, SYSCTL, | 994 | OMAP_HSMMC_WRITE(host->base, SYSCTL, |
983 | OMAP_HSMMC_READ(host->base, SYSCTL) | bit); | 995 | OMAP_HSMMC_READ(host->base, SYSCTL) | bit); |
984 | 996 | ||
997 | /* | ||
998 | * OMAP4 ES2 and greater has an updated reset logic. | ||
999 | * Monitor a 0->1 transition first | ||
1000 | */ | ||
1001 | if (mmc_slot(host).features & HSMMC_HAS_UPDATED_RESET) { | ||
1002 | while ((!(OMAP_HSMMC_READ(host, SYSCTL) & bit)) | ||
1003 | && (i++ < limit)) | ||
1004 | cpu_relax(); | ||
1005 | } | ||
1006 | i = 0; | ||
1007 | |||
985 | while ((OMAP_HSMMC_READ(host->base, SYSCTL) & bit) && | 1008 | while ((OMAP_HSMMC_READ(host->base, SYSCTL) & bit) && |
986 | (i++ < limit)) | 1009 | (i++ < limit)) |
987 | cpu_relax(); | 1010 | cpu_relax(); |
@@ -2003,6 +2026,8 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) | |||
2003 | if (res == NULL || irq < 0) | 2026 | if (res == NULL || irq < 0) |
2004 | return -ENXIO; | 2027 | return -ENXIO; |
2005 | 2028 | ||
2029 | res->start += pdata->reg_offset; | ||
2030 | res->end += pdata->reg_offset; | ||
2006 | res = request_mem_region(res->start, res->end - res->start + 1, | 2031 | res = request_mem_region(res->start, res->end - res->start + 1, |
2007 | pdev->name); | 2032 | pdev->name); |
2008 | if (res == NULL) | 2033 | if (res == NULL) |
@@ -2116,23 +2141,9 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) | |||
2116 | mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | | 2141 | mmc->caps |= MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED | |
2117 | MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE; | 2142 | MMC_CAP_WAIT_WHILE_BUSY | MMC_CAP_ERASE; |
2118 | 2143 | ||
2119 | switch (mmc_slot(host).wires) { | 2144 | mmc->caps |= mmc_slot(host).caps; |
2120 | case 8: | 2145 | if (mmc->caps & MMC_CAP_8_BIT_DATA) |
2121 | mmc->caps |= MMC_CAP_8_BIT_DATA; | ||
2122 | /* Fall through */ | ||
2123 | case 4: | ||
2124 | mmc->caps |= MMC_CAP_4_BIT_DATA; | 2146 | mmc->caps |= MMC_CAP_4_BIT_DATA; |
2125 | break; | ||
2126 | case 1: | ||
2127 | /* Nothing to crib here */ | ||
2128 | case 0: | ||
2129 | /* Assuming nothing was given by board, Core use's 1-Bit */ | ||
2130 | break; | ||
2131 | default: | ||
2132 | /* Completely unexpected.. Core goes with 1-Bit Width */ | ||
2133 | dev_crit(mmc_dev(host->mmc), "Invalid width %d\n used!" | ||
2134 | "using 1 instead\n", mmc_slot(host).wires); | ||
2135 | } | ||
2136 | 2147 | ||
2137 | if (mmc_slot(host).nonremovable) | 2148 | if (mmc_slot(host).nonremovable) |
2138 | mmc->caps |= MMC_CAP_NONREMOVABLE; | 2149 | mmc->caps |= MMC_CAP_NONREMOVABLE; |