mmc: queue: Flush recovery work on cleanup
PATCH 2/2 mmc: queue: Flush recovery work on cleanup
To prevent any recovery work running after the queue cleanup flush it. Any recovery running post-cleanup dereferenced mq->card as NULL and was not meaningful to begin with.
Signed-off-by Christian Loehle <[email protected]>
--- drivers/mmc/core/queue.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/mmc/core/queue.c +7 -0
@@ -493,6 +493,13 @@ void mmc_cleanup_queue(struct mmc_queue *mq)if (blk_queue_quiesced (q))blk_mq_unquiesce_queue (q); +/* +* If the recovery completes the last (and only remaining) request in +* the queue, and the card has been removed, we could end up here with +* the recovery not quite finished yet, so flush it. +*/ +flush_work (&mq->recovery_work); +blk_mq_free_tag_set (&mq->tag_set);/*
Signature · 5 lines
2.37.3 Hyperstone GmbH | Reichenaustr. 39a | 78467 Konstanz Managing Director: Dr. Jan Peter Berns. Commercial register of local courts: Freiburg HRB381782
Quoted 17 lines · Christian Löhle
To prevent any recovery work running after the queue cleanup flush it. Any recovery running post-cleanup dereferenced
mq->cardas NULL and was not meaningful to begin with.Signed-off-by Christian Loehle <[email protected]>--- drivers/mmc/core/queue.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/mmc/core/queue.c +0
-0
drivers/mmc/core/queue.c void mmc_cleanup_queue(struct mmc_queue *mq) · line 502
Quoted 10 lines
drivers/mmc/core/queue.c +7
-0@@ -493,6 +493,13 @@ void mmc_cleanup_queue(struct mmc_queue *mq)if (blk_queue_quiesced (q))blk_mq_unquiesce_queue (q); +/* +* If the recovery completes the last (and only remaining) request in +* the queue, and the card has been removed, we could end up here with +* the recovery not quite finished yet, so flush it. +*/ +flush_work (&mq->recovery_work); +
Not sure if it really matters in this case, but isn't cancel_work_sync() the more proper thing to call instead?
drivers/mmc/core/queue.c void mmc_cleanup_queue(struct mmc_queue *mq) · line 505
Quoted 3 lines
drivers/mmc/core/queue.c +0
-0blk_mq_free_tag_set (&mq->tag_set);/*
Kind regards
Uffe