OpenCloudOS-Kernel/include/linux/mmc
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
..
card.h mmc: block: handle complete_work on separate workqueue 2019-02-08 12:24:17 +01:00
core.h mmc: core: Export a function mmc_sw_reset() to allow soft reset of cards 2018-05-08 09:33:42 +02:00
host.h mmc: core: Introduce MMC_CAP_SYNC_RUNTIME_PM 2018-12-17 08:26:24 +01:00
mmc.h mmc: core: Adjust and reuse the macro of R1_STATUS(x) 2018-07-16 11:21:45 +02:00
pm.h
sd.h
sdhci-pci-data.h MMC core: 2017-11-13 10:17:35 -08:00
sdio.h
sdio_func.h mmc: sdio: fix alignment issue in struct sdio_func 2017-04-18 19:18:07 +02:00
sdio_ids.h brcmfmac: add support for CYW43012 SDIO chipset 2018-12-13 16:57:17 +02:00
sh_mmcif.h mmc: sh_mmcif: Remove unused clk_ctrl2_present from the platform data 2017-02-13 13:19:58 +01:00
slot-gpio.h mmc: slot-gpio: Delete legacy GPIO handling 2018-12-17 08:26:24 +01:00