arch: xtensa: platforms: Fix deadlock in rs_close()
Duoming Zhou authored
[ Upstream commit eb5adc70

 ]

There is a deadlock in rs_close(), which is shown
below:

   (Thread 1)              |      (Thread 2)
                           | rs_open()
rs_close()                 |  mod_timer()
 spin_lock_bh() //(1)      |  (wait a time)
 ...                       | rs_poll()
 del_timer_sync()          |  spin_lock() //(2)
 (wait timer to stop)      |  ...

We hold timer_lock in position (1) of thread 1 and
use del_timer_sync() to wait timer to stop, but timer handler
also need timer_lock in position (2) of thread 2.
As a result, rs_close() will block forever.

This patch deletes the redundant timer_lock in order to
prevent the deadlock. Because there is no race condition
between rs_close, rs_open and rs_poll.
Signed-off-by: default avatarDuoming Zhou <duoming@zju.edu.cn>
Message-Id: <20220407154430.22387-1-duoming@zju.edu.cn>
Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel...
50f79a2a
Name Last commit Last update
Documentation ext4, doc: fix incorrect h_reserved size
LICENSES LICENSES/dual/CC-BY-4.0: Git rid of "smart quotes"
arch arch: xtensa: platforms: Fix deadlock in rs_close()
block iocost: don't reset the inuse weight of under-weighted debtors
certs certs: Add support for using elliptic curve keys for signing modules
crypto crypto: xts - Add softdep on ecb
drivers Revert "ibmvnic: Add ethtool private flag for driver-defined queue limits"
fs ext4: fix bug_on in start_this_handle during umount filesystem
include tcp: make sure treq->af_specific is initialized
init init/main.c: return 1 from handled __setup() functions
ipc ipc/sem: do not sleep with a spin lock held
kernel bpf: Fix crash due to out of bounds access into reg2btf_ids.
lib hex2bin: fix access beyond string end
mm mm: gup: make fault_in_safe_writeable() use fixup_user_fault()
net tcp: fix F-RTO may not work correctly when receiving DSACK
samples samples/bpf, xdpsock: Fix race when running for fix duration of time
scripts gcc-plugins: latent_entropy: use /dev/urandom
security Fix incorrect type in assignment of ipv6 port for audit
sound ASoC: wm8731: Disable the regulator when probing fails
tools perf arm-spe: Fix addresses of synthesized SPE events
usr usr/include/Makefile: add linux/nfc.h to the compile-test coverage
virt KVM: avoid NULL pointer dereference in kvm_dirty_ring_push
.clang-format clang-format: Update with the latest for_each macro list
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore Opt out of scripts/get_maintainer.pl
.gitattributes .gitattributes: use 'dts' diff driver for dts files
.gitignore .gitignore: ignore only top-level modules.builtin
.mailmap mailmap: add Andrej Shadura
COPYING COPYING: state that all contributions really are covered by this file
CREDITS MAINTAINERS: Move Daniel Drake to credits
Kbuild kbuild: rename hostprogs-y/always to hostprogs/always-y
Kconfig kbuild: ensure full rebuild when the compiler is updated
MAINTAINERS MAINTAINERS: adjust file entry for of_net.c after movement
Makefile Linux 5.15.37
README Drop all 00-INDEX files from Documentation/
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.