]> git.baikalelectronics.ru Git - kernel.git/commit
mmc: core: Fix recursive locking issue in CQE recovery path
authorSarthak Garg <sartgarg@codeaurora.org>
Thu, 7 May 2020 16:15:33 +0000 (21:45 +0530)
committerUlf Hansson <ulf.hansson@linaro.org>
Fri, 8 May 2020 05:30:11 +0000 (07:30 +0200)
commit8b40d3d443b3cef415e3d5717a1d1b012f8b0be7
tree3ac8a3730cd137c943611633d5ad8bf35165164b
parent0d22d206807f5d66155dae57c96df41b5f501d8f
mmc: core: Fix recursive locking issue in CQE recovery path

Consider the following stack trace

-001|raw_spin_lock_irqsave
-002|mmc_blk_cqe_complete_rq
-003|__blk_mq_complete_request(inline)
-003|blk_mq_complete_request(rq)
-004|mmc_cqe_timed_out(inline)
-004|mmc_mq_timed_out

mmc_mq_timed_out acquires the queue_lock for the first
time. The mmc_blk_cqe_complete_rq function also tries to acquire
the same queue lock resulting in recursive locking where the task
is spinning for the same lock which it has already acquired leading
to watchdog bark.

Fix this issue with the lock only for the required critical section.

Cc: <stable@vger.kernel.org>
Fixes: e17106ca344e ("mmc: block: Add CQE support")
Suggested-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Sarthak Garg <sartgarg@codeaurora.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/1588868135-31783-1-git-send-email-vbadigan@codeaurora.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/queue.c