Kernel Tree For Xiaomi 11 Lite NE 5G
Go to file
Johan Hovold 328f3c084f regulator: core: fix deadlock on regulator enable
commit cb3543cff90a4448ed560ac86c98033ad5fecda9 upstream.

When updating the operating mode as part of regulator enable, the caller
has already locked the regulator tree and drms_uA_update() must not try
to do the same in order not to trigger a deadlock.

The lock inversion is reported by lockdep as:

  ======================================================
  WARNING: possible circular locking dependency detected
  6.1.0-next-20221215 #142 Not tainted
  ------------------------------------------------------
  udevd/154 is trying to acquire lock:
  ffffc11f123d7e50 (regulator_list_mutex){+.+.}-{3:3}, at: regulator_lock_dependent+0x54/0x280

  but task is already holding lock:
  ffff80000e4c36e8 (regulator_ww_class_acquire){+.+.}-{0:0}, at: regulator_enable+0x34/0x80

  which lock already depends on the new lock.

  ...

   Possible unsafe locking scenario:

         CPU0                    CPU1
         ----                    ----
    lock(regulator_ww_class_acquire);
                                 lock(regulator_list_mutex);
                                 lock(regulator_ww_class_acquire);
    lock(regulator_list_mutex);

   *** DEADLOCK ***

just before probe of a Qualcomm UFS controller (occasionally) deadlocks
when enabling one of its regulators.

Fixes: 9243a195be ("regulator: core: Change voltage setting path")
Fixes: f8702f9e4a ("regulator: core: Use ww_mutex for regulators locking")
Cc: stable@vger.kernel.org      # 5.0
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20221215104646.19818-1-johan+linaro@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-18 11:41:41 +01:00
arch powerpc/hv-gpci: Fix hv_gpci event list 2023-01-18 11:41:30 +01:00
block blk-mq: fix possible memleak when register 'hctx' failed 2023-01-18 11:41:38 +01:00
certs certs/blacklist_hashes.c: fix const confusion in certs blacklist 2022-06-22 14:11:22 +02:00
crypto crypto: tcrypt - Fix multibuffer skcipher speed test mem leak 2023-01-18 11:41:19 +01:00
Documentation ASoC: dt-bindings: wcd9335: fix reset line polarity in example 2023-01-18 11:41:06 +01:00
drivers regulator: core: fix deadlock on regulator enable 2023-01-18 11:41:41 +01:00
fs reiserfs: Add missing calls to reiserfs_security_free() 2023-01-18 11:41:41 +01:00
include ALSA: hda: add snd_hdac_stop_streams() helper 2023-01-18 11:41:39 +01:00
init init/Kconfig: fix CC_HAS_ASM_GOTO_TIED_OUTPUT test with dash 2022-12-08 11:22:59 +01:00
ipc ipc/sem: Fix dangling sem_array access in semtimedop race 2022-12-08 11:23:06 +01:00
kernel bpf: Prevent decl_tag from being referenced in func_proto arg 2023-01-18 11:41:37 +01:00
lib test_firmware: fix memory leak in test_firmware_init() 2023-01-18 11:41:23 +01:00
LICENSES
mm mm/hugetlb: fix races when looking up a CONT-PTE/PMD size hugetlb page 2022-12-19 12:24:15 +01:00
net mrp: introduce active flags to prevent UAF when applicant uninit 2023-01-18 11:41:37 +01:00
samples samples: vfio-mdev: Fix missing pci_disable_device() in mdpy_fb_probe() 2023-01-18 11:41:26 +01:00
scripts scripts/faddr2line: Fix regression in name resolution on ppc64le 2022-12-08 11:23:02 +01:00
security apparmor: Use pointer to struct aa_label for lbs_cred 2023-01-18 11:41:17 +01:00
sound ALSA: hda/hdmi: Add HP Device 0x8711 to force connect list 2023-01-18 11:41:41 +01:00
tools selftests/powerpc: Fix resource leaks 2023-01-18 11:41:30 +01:00
usr
virt KVM: arm64: vgic: Fix exit condition in scan_its_table() 2022-10-29 10:20:35 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.4.228 2022-12-19 12:24:17 +01:00
README

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.