OpenCloudOS-Kernel/drivers
John Ogness 40ddbbac7f mtd: mtdoops: synchronize kmsg_dumper
The kmsg_dumper can be called from any context and CPU, possibly
from multiple CPUs simultaneously. Since the writing of the buffer
can occur from a later scheduled work queue, the oops buffer must
be protected against simultaneous dumping.

Use an atomic bit to mark when the buffer is protected. Release the
protection in between setting the buffer and the actual writing in
order for a possible panic (immediate write) to be written during
the scheduling of a previous oops (delayed write).

An atomic bit (rather than a spinlock) was chosen so that no
scheduling or preemption side-effects would be introduced. The MTD
kmsg_dumper may dump directly or it may be delayed (via scheduled
work). Depending on the context, different MTD callbacks are used.
For example, mtd_write() expects to be called in a non-atomic
context and may take a mutex.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20210303101528.29901-3-john.ogness@linutronix.de
2021-03-08 11:42:46 +01:00
..
accessibility
acpi - Use the newly introduced 'hot' and 'critical' ops for the acpi 2021-02-22 09:39:11 -08:00
amba
android
ata
atm atm: idt77252: fix build broken on amd64 2021-02-15 12:36:27 -08:00
auxdisplay
base Devicetree updates for v5.12: 2021-02-22 10:05:12 -08:00
bcma
block xen: branch for v5.12-rc1 2021-02-21 13:06:08 -08:00
bluetooth TTY/Serial driver changes for 5.12-rc1 2021-02-20 21:28:04 -08:00
bus ARM: SoC drivers for v5.12 2021-02-20 18:42:28 -08:00
cdrom
char Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2021-02-21 17:23:56 -08:00
clk This is all driver updates, the majority of which is a bunch of new Qualcomm 2021-02-22 09:45:23 -08:00
clocksource hyperv-next for 5.12 2021-02-21 13:24:39 -08:00
connector
counter
cpufreq Merge branch 'pm-opp' into pm 2021-02-15 17:01:46 +01:00
cpuidle
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2021-02-21 17:23:56 -08:00
dax
dca
devfreq Merge branches 'pm-devfreq' and 'pm-tools' 2021-02-15 17:02:04 +01:00
dio
dma dmaengine dw: Revert "dmaengine: dw: Enable runtime PM" 2021-02-08 17:36:12 +05:30
dma-buf dma-buf: Avoid comma separated statements 2021-02-09 17:14:11 +01:00
edac Merge branch 'edac-misc' into edac-updates-for-v5.12 2021-02-15 10:06:58 +01:00
eisa
extcon
firewire
firmware MMC core: 2021-02-22 09:05:28 -08:00
fpga
fsi
gnss
gpio gpio updates for v5.12 2021-02-22 10:00:46 -08:00
gpu platform-drivers-x86 for v5.12-1 2021-02-22 08:50:01 -08:00
greybus
hid Staging/IIO driver patches for 5.12-rc1 2021-02-20 21:36:51 -08:00
hsi
hv Revert "Drivers: hv: vmbus: Copy packets sent by Hyper-V out of the ring buffer" 2021-02-15 10:49:11 +00:00
hwmon Devicetree updates for v5.12: 2021-02-22 10:05:12 -08:00
hwspinlock
hwtracing
i2c Merge branch 'i2c/for-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2021-02-22 09:02:24 -08:00
i3c I3C for 5.12 2021-02-22 09:52:55 -08:00
ide
idle
iio - Use the newly introduced 'hot' and 'critical' ops for the acpi 2021-02-22 09:39:11 -08:00
infiniband Linux 5.11 2021-02-18 11:19:29 -04:00
input sound updates for 5.12 2021-02-21 14:21:35 -08:00
interconnect
iommu IOMMU Updates for Linux v5.12 2021-02-22 10:31:29 -08:00
ipack
irqchip irqchip updates for Linux 5.12: 2021-02-15 15:41:56 +01:00
isdn
leds TTY/Serial driver changes for 5.12-rc1 2021-02-20 21:28:04 -08:00
lightnvm lightnvm: pblk: Replace guid_copy() with export_guid()/import_guid() 2021-02-14 21:27:24 -07:00
macintosh
mailbox
mcb
md - Fix DM integrity's HMAC support to provide enhanced security of 2021-02-22 10:22:54 -08:00
media Devicetree updates for v5.12: 2021-02-22 10:05:12 -08:00
memory IOMMU Updates for Linux v5.12 2021-02-22 10:31:29 -08:00
memstick
message
mfd - Core Frameworks 2021-02-22 09:29:42 -08:00
misc
mmc MMC core: 2021-02-22 09:05:28 -08:00
most
mtd mtd: mtdoops: synchronize kmsg_dumper 2021-03-08 11:42:46 +01:00
mux
net RDMA 5.12 merge window pull request 2021-02-22 10:27:48 -08:00
nfc nfc: st-nci: Remove unnecessary variable 2021-02-08 14:56:20 -08:00
ntb
nubus
nvdimm for-5.12/block-2021-02-17 2021-02-21 11:02:48 -08:00
nvme for-5.12/drivers-2021-02-17 2021-02-21 11:06:54 -08:00
nvmem
of Devicetree updates for v5.12: 2021-02-22 10:05:12 -08:00
opp
parisc
parport
pci drm pull for 5.12-rc1 2021-02-21 14:44:44 -08:00
pcmcia
perf IOMMU Updates for Linux v5.12 2021-02-22 10:31:29 -08:00
phy
pinctrl gpio: visconti: Add Toshiba Visconti GPIO support 2021-02-15 11:43:26 +01:00
platform - Use the newly introduced 'hot' and 'critical' ops for the acpi 2021-02-22 09:39:11 -08:00
pnp
power
powercap powercap: intel_rapl: Use topology interface in rapl_init_domains() 2021-02-12 16:53:01 +01:00
pps
ps3
ptp ptp: ptp_clockmatrix: clean-up - parenthesis around a == b are unnecessary 2021-02-17 13:49:26 -08:00
pwm
rapidio
ras
regulator - Core Frameworks 2021-02-22 09:29:42 -08:00
remoteproc
reset ARM: SoC drivers for v5.12 2021-02-20 18:42:28 -08:00
rpmsg
rtc RTC for 5.12 2021-02-22 09:54:19 -08:00
s390 SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
sbus
scsi SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
sfi
sh
siox
slimbus
soc This is all driver updates, the majority of which is a bunch of new Qualcomm 2021-02-22 09:45:23 -08:00
soundwire
spi spi: Updates for v5.12 2021-02-22 09:19:08 -08:00
spmi
ssb
staging media updates for v5.12-rc1 2021-02-21 14:10:36 -08:00
target SCSI misc on 20210219 2021-02-22 10:24:58 -08:00
tc
tee Simplify i2c acess in OP-TEE driver 2021-02-09 16:10:49 +01:00
thermal - Use the newly introduced 'hot' and 'critical' ops for the acpi 2021-02-22 09:39:11 -08:00
thunderbolt thunderbolt: Changes for v5.12 merge window 2021-02-09 13:00:07 +01:00
tty Devicetree updates for v5.12: 2021-02-22 10:05:12 -08:00
uio
usb Devicetree updates for v5.12: 2021-02-22 10:05:12 -08:00
vdpa
vfio
vhost
video - New Functionality 2021-02-22 09:27:18 -08:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog linux-watchdog 5.12-rc1 tag 2021-02-22 09:07:51 -08:00
xen xen: branch for v5.12-rc1 2021-02-21 13:06:08 -08:00
zorro
Kconfig
Makefile