mmc: queue: Drop call to blk_cleanup_queue()

Message ID 20170613085906.5726-1-linus.walleij@linaro.org
State New
Headers show

Commit Message

Linus Walleij June 13, 2017, 8:59 a.m.
commit 0d8587376878c8da5a4953025e621c5dceb8b76a
"mmc: core: Allocate per-request data using the block layer core"
added a call to blk_cleanup_queue() into the mmc_cleanup_queue()
call.

This might look intutitive (and that is why I made the mistake),
since the cleanup is called if we fail in mmc_init_queue(), but due
to the nature of the MMC stack we are cleaning up the queue
inside the stack once the queue has been started.

The actual call to blk_cleanup_queue() is in mmc_blk_put() in
block.c, calling it twice wreaks havoc.

Fixes: 0d8587376878 ("mmc: core: Allocate per-request data using the block layer core")
Reported-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

---
 drivers/mmc/core/queue.c | 1 -
 1 file changed, 1 deletion(-)

-- 
2.9.4

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Ulf Hansson June 13, 2017, 9:27 a.m. | #1
On 13 June 2017 at 10:59, Linus Walleij <linus.walleij@linaro.org> wrote:
> commit 0d8587376878c8da5a4953025e621c5dceb8b76a

> "mmc: core: Allocate per-request data using the block layer core"

> added a call to blk_cleanup_queue() into the mmc_cleanup_queue()

> call.

>

> This might look intutitive (and that is why I made the mistake),

> since the cleanup is called if we fail in mmc_init_queue(), but due

> to the nature of the MMC stack we are cleaning up the queue

> inside the stack once the queue has been started.

>

> The actual call to blk_cleanup_queue() is in mmc_blk_put() in

> block.c, calling it twice wreaks havoc.

>

> Fixes: 0d8587376878 ("mmc: core: Allocate per-request data using the block layer core")

> Reported-by: Heiner Kallweit <hkallweit1@gmail.com>

> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


Thanks, applied for next! I may consider to squash this change into
the fixed commit, as to avoid bisect problems. In such case I will add
Heiner's tested by tag to that commit.

Kind regards
Uffe

> ---

>  drivers/mmc/core/queue.c | 1 -

>  1 file changed, 1 deletion(-)

>

> diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c

> index 4bf9978b707a..ba689a2ffc51 100644

> --- a/drivers/mmc/core/queue.c

> +++ b/drivers/mmc/core/queue.c

> @@ -312,7 +312,6 @@ void mmc_cleanup_queue(struct mmc_queue *mq)

>         q->queuedata = NULL;

>         blk_start_queue(q);

>         spin_unlock_irqrestore(q->queue_lock, flags);

> -       blk_cleanup_queue(mq->queue);

>

>         mq->card = NULL;

>  }

> --

> 2.9.4

>

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
index 4bf9978b707a..ba689a2ffc51 100644
--- a/drivers/mmc/core/queue.c
+++ b/drivers/mmc/core/queue.c
@@ -312,7 +312,6 @@  void mmc_cleanup_queue(struct mmc_queue *mq)
 	q->queuedata = NULL;
 	blk_start_queue(q);
 	spin_unlock_irqrestore(q->queue_lock, flags);
-	blk_cleanup_queue(mq->queue);
 
 	mq->card = NULL;
 }