linux-stable/drivers/platform/mellanox
Liming Sun 3454eeeebd platform/mellanox: fix potential deadlock in the tmfifo driver
This commit fixes the potential deadlock caused by the console Rx
and Tx processing at the same time. Rx and Tx both take the console
and tmfifo spinlock but in different order which causes potential
deadlock. The fix is to use different tmfifo spinlock for Rx and
Tx since they protect different resources and it's safe to split
the lock.

Below is the reported call trace when copying/pasting large string
in the console.

Rx:
    _raw_spin_lock_irqsave (hvc lock)
    __hvc_poll
    hvc_poll
    in_intr
    vring_interrupt
    mlxbf_tmfifo_rxtx_one_desc (tmfifo lock)
    mlxbf_tmfifo_rxtx
    mlxbf_tmfifo_work_rxtx
Tx:
    _raw_spin_lock_irqsave (tmfifo lock)
    mlxbf_tmfifo_virtio_notify
    virtqueue_notify
    virtqueue_kick
    put_chars
    hvc_push
    hvc_write (hvc lock)
    ...
    do_tty_write
    tty_write

Fixes: 1357dfd726 ("platform/mellanox: Add TmFifo driver for Mellanox BlueField Soc")
Cc: <stable@vger.kernel.org> # 5.4+
Reviewed-by: David Woods <dwoods@mellanox.com>
Signed-off-by: Liming Sun <lsun@mellanox.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2020-01-10 11:57:21 +02:00
..
Kconfig platform/mellanox: Fix Kconfig indentation 2019-11-21 14:31:34 +02:00
Makefile platform/mellanox: Add bootctl driver for Mellanox BlueField Soc 2019-10-15 10:55:10 +03:00
mlxbf-bootctl.c platform/mellanox: fix the mlx-bootctl sysfs 2019-12-20 19:00:50 +02:00
mlxbf-bootctl.h platform/mellanox: Add bootctl driver for Mellanox BlueField Soc 2019-10-15 10:55:10 +03:00
mlxbf-tmfifo-regs.h platform/mellanox: Add TmFifo driver for Mellanox BlueField Soc 2019-05-06 17:54:42 +03:00
mlxbf-tmfifo.c platform/mellanox: fix potential deadlock in the tmfifo driver 2020-01-10 11:57:21 +02:00
mlxreg-hotplug.c platform/mellanox: mlxreg-hotplug: Remove dev_err() usage after platform_get_irq() 2019-08-01 18:03:02 +03:00
mlxreg-io.c platform/mellanox: Use 2-factor allocator calls 2018-07-18 13:29:11 +03:00