diff options
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r-- | drivers/mmc/card/block.c | 5 | ||||
-rw-r--r-- | drivers/mmc/card/queue.c | 15 | ||||
-rw-r--r-- | drivers/mmc/card/queue.h | 3 |
3 files changed, 12 insertions, 11 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 71da5641e258..f85e42224559 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -1024,7 +1024,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, | |||
1024 | INIT_LIST_HEAD(&md->part); | 1024 | INIT_LIST_HEAD(&md->part); |
1025 | md->usage = 1; | 1025 | md->usage = 1; |
1026 | 1026 | ||
1027 | ret = mmc_init_queue(&md->queue, card, &md->lock); | 1027 | ret = mmc_init_queue(&md->queue, card, &md->lock, subname); |
1028 | if (ret) | 1028 | if (ret) |
1029 | goto err_putdisk; | 1029 | goto err_putdisk; |
1030 | 1030 | ||
@@ -1297,6 +1297,9 @@ static void mmc_blk_remove(struct mmc_card *card) | |||
1297 | struct mmc_blk_data *md = mmc_get_drvdata(card); | 1297 | struct mmc_blk_data *md = mmc_get_drvdata(card); |
1298 | 1298 | ||
1299 | mmc_blk_remove_parts(card, md); | 1299 | mmc_blk_remove_parts(card, md); |
1300 | mmc_claim_host(card->host); | ||
1301 | mmc_blk_part_switch(card, md); | ||
1302 | mmc_release_host(card->host); | ||
1300 | mmc_blk_remove_req(md); | 1303 | mmc_blk_remove_req(md); |
1301 | mmc_set_drvdata(card, NULL); | 1304 | mmc_set_drvdata(card, NULL); |
1302 | } | 1305 | } |
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index c07322c2658c..6413afa318d2 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c | |||
@@ -106,10 +106,12 @@ static void mmc_request(struct request_queue *q) | |||
106 | * @mq: mmc queue | 106 | * @mq: mmc queue |
107 | * @card: mmc card to attach this queue | 107 | * @card: mmc card to attach this queue |
108 | * @lock: queue lock | 108 | * @lock: queue lock |
109 | * @subname: partition subname | ||
109 | * | 110 | * |
110 | * Initialise a MMC card request queue. | 111 | * Initialise a MMC card request queue. |
111 | */ | 112 | */ |
112 | int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock) | 113 | int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, |
114 | spinlock_t *lock, const char *subname) | ||
113 | { | 115 | { |
114 | struct mmc_host *host = card->host; | 116 | struct mmc_host *host = card->host; |
115 | u64 limit = BLK_BOUNCE_HIGH; | 117 | u64 limit = BLK_BOUNCE_HIGH; |
@@ -133,12 +135,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock | |||
133 | mq->queue->limits.max_discard_sectors = UINT_MAX; | 135 | mq->queue->limits.max_discard_sectors = UINT_MAX; |
134 | if (card->erased_byte == 0) | 136 | if (card->erased_byte == 0) |
135 | mq->queue->limits.discard_zeroes_data = 1; | 137 | mq->queue->limits.discard_zeroes_data = 1; |
136 | if (!mmc_can_trim(card) && is_power_of_2(card->erase_size)) { | 138 | mq->queue->limits.discard_granularity = card->pref_erase << 9; |
137 | mq->queue->limits.discard_granularity = | ||
138 | card->erase_size << 9; | ||
139 | mq->queue->limits.discard_alignment = | ||
140 | card->erase_size << 9; | ||
141 | } | ||
142 | if (mmc_can_secure_erase_trim(card)) | 139 | if (mmc_can_secure_erase_trim(card)) |
143 | queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD, | 140 | queue_flag_set_unlocked(QUEUE_FLAG_SECDISCARD, |
144 | mq->queue); | 141 | mq->queue); |
@@ -209,8 +206,8 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock | |||
209 | 206 | ||
210 | sema_init(&mq->thread_sem, 1); | 207 | sema_init(&mq->thread_sem, 1); |
211 | 208 | ||
212 | mq->thread = kthread_run(mmc_queue_thread, mq, "mmcqd/%d", | 209 | mq->thread = kthread_run(mmc_queue_thread, mq, "mmcqd/%d%s", |
213 | host->index); | 210 | host->index, subname ? subname : ""); |
214 | 211 | ||
215 | if (IS_ERR(mq->thread)) { | 212 | if (IS_ERR(mq->thread)) { |
216 | ret = PTR_ERR(mq->thread); | 213 | ret = PTR_ERR(mq->thread); |
diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h index 64e66e0d4994..6223ef8dc9cd 100644 --- a/drivers/mmc/card/queue.h +++ b/drivers/mmc/card/queue.h | |||
@@ -19,7 +19,8 @@ struct mmc_queue { | |||
19 | unsigned int bounce_sg_len; | 19 | unsigned int bounce_sg_len; |
20 | }; | 20 | }; |
21 | 21 | ||
22 | extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *); | 22 | extern int mmc_init_queue(struct mmc_queue *, struct mmc_card *, spinlock_t *, |
23 | const char *); | ||
23 | extern void mmc_cleanup_queue(struct mmc_queue *); | 24 | extern void mmc_cleanup_queue(struct mmc_queue *); |
24 | extern void mmc_queue_suspend(struct mmc_queue *); | 25 | extern void mmc_queue_suspend(struct mmc_queue *); |
25 | extern void mmc_queue_resume(struct mmc_queue *); | 26 | extern void mmc_queue_resume(struct mmc_queue *); |