Kernel Tree For Xiaomi 11 Lite NE 5G
Go to file
Benjamin Bara 25eb381a73 i2c: core: Run atomic i2c xfer when !preemptible
commit aa49c90894d06e18a1ee7c095edbd2f37c232d02 upstream.

Since bae1d3a05a, i2c transfers are non-atomic if preemption is
disabled. However, non-atomic i2c transfers require preemption (e.g. in
wait_for_completion() while waiting for the DMA).

panic() calls preempt_disable_notrace() before calling
emergency_restart(). Therefore, if an i2c device is used for the
restart, the xfer should be atomic. This avoids warnings like:

[   12.667612] WARNING: CPU: 1 PID: 1 at kernel/rcu/tree_plugin.h:318 rcu_note_context_switch+0x33c/0x6b0
[   12.676926] Voluntary context switch within RCU read-side critical section!
...
[   12.742376]  schedule_timeout from wait_for_completion_timeout+0x90/0x114
[   12.749179]  wait_for_completion_timeout from tegra_i2c_wait_completion+0x40/0x70
...
[   12.994527]  atomic_notifier_call_chain from machine_restart+0x34/0x58
[   13.001050]  machine_restart from panic+0x2a8/0x32c

Use !preemptible() instead, which is basically the same check as
pre-v5.2.

Fixes: bae1d3a05a ("i2c: core: remove use of in_atomic()")
Cc: stable@vger.kernel.org # v5.2+
Suggested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Acked-by: Wolfram Sang <wsa@kernel.org>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Tested-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Benjamin Bara <benjamin.bara@skidata.com>
Link: https://lore.kernel.org/r/20230327-tegra-pmic-reboot-v7-2-18699d5dcd76@skidata.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-11-28 16:50:19 +00:00
arch parisc/pdc: Add width field to struct pdc_model 2023-11-28 16:50:19 +00:00
block block/partition: fix signedness issue for Amiga partitions 2023-07-27 08:37:29 +02:00
certs
crypto crypto: pcrypt - Fix hungtask for PADATA_RESET 2023-11-28 16:50:14 +00:00
Documentation firmware: ti_sci: Replace HTTP links with HTTPS ones 2023-11-20 10:30:12 +01:00
drivers i2c: core: Run atomic i2c xfer when !preemptible 2023-11-28 16:50:19 +00:00
fs quota: explicitly forbid quota files from being encrypted 2023-11-28 16:50:19 +00:00
include net/mlx5_core: Clean driver version and name 2023-11-28 16:50:17 +00:00
init x86/mm: Initialize text poking earlier 2023-08-08 19:56:36 +02:00
ipc
kernel kernel/reboot: emergency_restart: Set correct system_state 2023-11-28 16:50:19 +00:00
lib kobject: Fix slab-out-of-bounds in fill_kobj_path() 2023-11-08 11:23:38 +01:00
LICENSES
mm vfs: fix readahead(2) on block devices 2023-11-20 10:30:08 +01:00
net netfilter: nf_conntrack_bridge: initialize err to 0 2023-11-28 16:50:17 +00:00
samples samples/bpf: Fix buffer overflow in tcp_basertt 2023-07-27 08:37:07 +02:00
scripts randstruct: Fix gcc-plugin performance mode to stay in group 2023-11-28 16:50:17 +00:00
security ima: rework CONFIG_IMA dependency block 2023-10-10 21:46:46 +02:00
sound ASoC: ti: omap-mcbsp: Fix runtime PM underflow warnings 2023-11-28 16:50:16 +00:00
tools tools/power/turbostat: Fix a knl bug 2023-11-28 16:50:17 +00:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS iio: stx104: Move to addac subdirectory 2023-08-30 16:27:12 +02:00
Makefile Linux 5.4.261 2023-11-20 10:30: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.