b2e1ff89077f75ba073212010453996c3b4f1e20
[openwrt/openwrt.git] / target / linux / lantiq / patches-5.4 / 0800-spi-lantiq-ssc-Fix-warning-by-using-WQ_MEM_RECLAI.patch
1 From 907137d9ef048e7d0282c28e47b32aa4084ad395 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Mon, 6 Jul 2020 00:05:12 +0200
4 Subject: [PATCH v2] spi: lantiq-ssc: Fix warning by using WQ_MEM_RECLAIM
5
6 The lantiq-ssc driver uses internally an own workqueue to wait till the
7 data is not only written out of the FIFO but really written to the wire.
8 This workqueue is flushed while the SPI subsystem is working in some
9 other system workqueue.
10
11 The system workqueue is marked as WQ_MEM_RECLAIM, but the workqueue in
12 the lantiq-ssc driver does not use WQ_MEM_RECLAIM for now. Add this flag
13 too to prevent this warning.
14
15 This fixes the following warning:
16 [ 2.975956] WARNING: CPU: 1 PID: 17 at kernel/workqueue.c:2614 check_flush_dependency+0x168/0x184
17 [ 2.984752] workqueue: WQ_MEM_RECLAIM kblockd:blk_mq_run_work_fn is flushing !WQ_MEM_RECLAIM 1e100800.spi:0x0
18
19 Fixes: 891b7c5fbf61 ("mtd_blkdevs: convert to blk-mq")
20 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
21 ---
22 drivers/spi/spi-lantiq-ssc.c | 2 +-
23 1 file changed, 1 insertion(+), 1 deletion(-)
24
25 --- a/drivers/spi/spi-lantiq-ssc.c
26 +++ b/drivers/spi/spi-lantiq-ssc.c
27 @@ -907,7 +907,7 @@ static int lantiq_ssc_probe(struct platf
28 master->bits_per_word_mask = SPI_BPW_RANGE_MASK(2, 8) |
29 SPI_BPW_MASK(16) | SPI_BPW_MASK(32);
30
31 - spi->wq = alloc_ordered_workqueue(dev_name(dev), 0);
32 + spi->wq = alloc_ordered_workqueue(dev_name(dev), WQ_MEM_RECLAIM);
33 if (!spi->wq) {
34 err = -ENOMEM;
35 goto err_clk_put;