linux-stable/include/linux/mmc
Zachary Hays c4609e81e0 mmc: block: handle complete_work on separate workqueue
commit dcf6e2e38a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-20 10:25:46 +01:00
..
card.h mmc: block: handle complete_work on separate workqueue 2019-02-20 10:25:46 +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: Drop the unused mmc_power_save|restore_host() 2018-07-16 11:21:45 +02: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 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
sh_mmcif.h
slot-gpio.h mmc: slot-gpio: Add a function to enable/disable card detect IRQ wakeup 2018-03-05 13:04:32 +01:00