linux/drivers/mmc/core
Zachary Hays dcf6e2e38a mmc: block: handle complete_work on separate workqueue
The kblockd workqueue is created with the WQ_MEM_RECLAIM flag set.
This generates a rescuer thread for that queue that will trigger when
the CPU is under heavy load and collect the uncompleted work.

In the case of mmc, this creates the possibility of a deadlock when
there are multiple partitions on the device as other blk-mq work is
also run on the same queue. For example:

- worker 0 claims the mmc host to work on partition 1
- worker 1 attempts to claim the host for partition 2 but has to wait
  for worker 0 to finish
- worker 0 schedules complete_work to release the host
- rescuer thread is triggered after time-out and collects the dangling
  work
- rescuer thread attempts to complete the work in order starting with
  claim host
- the task to release host is now blocked by a task to claim it and
  will never be called

The above results in multiple hung tasks that lead to failures to
mount partitions.

Handling complete_work on a separate workqueue avoids this by keeping
the work completion tasks separate from the other blk-mq work. This
allows the host to be released without getting blocked by other tasks
attempting to claim the host.

Signed-off-by: Zachary Hays <zhays@lexmark.com>
Fixes: 81196976ed ("mmc: block: Add blk-mq support")
Cc: <stable@vger.kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2019-02-08 12:24:17 +01:00
..
block.c mmc: block: handle complete_work on separate workqueue 2019-02-08 12:24:17 +01:00
block.h mmc: block: Remove code no longer needed after the switch to blk-mq 2017-12-11 13:02:22 +01:00
bus.c mmc: core: Remove code no longer needed after the switch to blk-mq 2017-12-11 13:05:58 +01:00
bus.h
card.h mmc: core: Cleanup BKOPS support 2018-12-17 09:01:15 +01:00
core.c mmc: core: Introduce MMC_CAP_SYNC_RUNTIME_PM 2018-12-17 08:26:24 +01:00
core.h mmc: core: remove obsolete mmc_set_blockcount() function 2018-12-17 08:26:24 +01:00
debugfs.c mmc: Export host capabilities to debugfs. 2018-03-22 10:36:27 +01:00
host.c mmc: core: don't override the CD GPIO level when "cd-inverted" is set 2019-01-11 15:27:35 +01:00
host.h mmc: core: Don't try UHS-I mode if 4-bit mode isn't supported 2018-03-15 09:30:39 +01:00
Kconfig mmc: core: Allow building PWRSEQ_SD8787 with LIBERTAS_SDIO 2018-10-08 11:40:43 +02:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mmc_ops.c mmc: core: Cleanup BKOPS support 2018-12-17 09:01:15 +01:00
mmc_ops.h mmc: core: Cleanup BKOPS support 2018-12-17 09:01:15 +01:00
mmc_test.c mmc: convert to DEFINE_SHOW_ATTRIBUTE 2018-12-17 08:26:24 +01:00
mmc.c mmc: core: Cleanup BKOPS support 2018-12-17 09:01:15 +01:00
pwrseq_emmc.c
pwrseq_sd8787.c
pwrseq_simple.c mmc: pwrseq_simple: Fix incorrect handling of GPIO bitmap 2018-10-15 16:26:00 +02:00
pwrseq.c
pwrseq.h
queue.c mmc: stop abusing the request queue_lock pointer 2018-11-17 07:20:45 -07:00
queue.h mmc: stop abusing the request queue_lock pointer 2018-11-17 07:20:45 -07:00
quirks.h mmc: core: sdio: Set SDIO clock of SDR104 to 150MHz for Marvell 8887 chip 2018-05-02 15:08:39 +02:00
sd_ops.c
sd_ops.h
sd.c mmc: core: Rename ->reset() bus ops to ->hw_reset() 2018-05-08 09:33:29 +02:00
sd.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sdio_bus.c mmc: sdio: Respect all error codes from dev_pm_domain_attach() 2018-05-14 22:58:45 +02:00
sdio_bus.h
sdio_cis.c
sdio_cis.h
sdio_io.c
sdio_irq.c mmc: update sdio_claim_irq documentation 2018-03-22 10:50:24 +01:00
sdio_ops.c
sdio_ops.h
sdio_uart.c tty: replace ->proc_fops with ->proc_show 2018-05-16 07:24:30 +02:00
sdio.c mmc: core: Drop the unused mmc_power_save|restore_host() 2018-07-16 11:21:45 +02:00
slot-gpio.c mmc: slot-gpio: Delete legacy GPIO handling 2018-12-17 08:26:24 +01:00
slot-gpio.h