linux/drivers
Linus Torvalds c903327d32 printk changes for 6.12
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEESH4wyp42V4tXvYsjUqAMR0iAlPIFAmbi598ACgkQUqAMR0iA
 lPL3lw//WaRDKJ1Cb/bKAn3nRpjdqiNBI//K1gRJp0LgLE7qEudE25t4j3F9tvvP
 pc9AB81g1Au8Br6iOd+NiGXXW5KWJHaZ3rUAdeo6co4NQCbrY6qTA78ItZSQImBH
 A9fhWWr1TGRX8L/N/gR2eYBnpbDGIbRahUOQraUpBn4kEPyR47KEx7Njjo48GcmR
 Ye8dIYwUOWEgQeIuIxIAwNf6KyNjo5tQpgve+M8HGwy8mZqP9XV6UjXUACVwQNx6
 +CK+IGM+94tCq5KalOaJ5BtsXGKlabHIs7y9QpLS45M2QoHIlDIvpaxzLf0FTsPI
 CppqedAGN2jU0NyjfbFk1c+SNQfDZEAZVyF6vKFelP7t2jzAx301RyB2S+Cm7Hh+
 PajFty41UT0/y17V4sZawfMqpFyp7Wr6RKQYYKMBRdSQQkToh/dmebBvqPAHW9cJ
 LInQQf+XdzbonKa+CTmT/Tg+eM2R124FWeMVnEMdtyXpKUV9qdKWfngtzyRMQiYI
 q54ZwKd3VJ9kRIfb7Fp0TBr2NErdnEQE5hh9QhI8SAWENskw5+GmYaQit734U9wA
 SU7t9rir7NS4Rc1jHP9SQ9oWWI9HT4hthRGkLh2Knx0O2c6AwOuEI4wkjzSWI3GX
 /eeofnbZiUpi7fESf9qmTGtQZ4/9ogQ7fNaroWCSfQzq3+wl+2o=
 =28sV
 -----END PGP SIGNATURE-----

Merge tag 'printk-for-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux

Pull printk updates from Petr Mladek:
 "This is the "last" part of the support for the new nbcon consoles.
  Where "nbcon" stays for "No Big console lock CONsoles" aka not under
  the console_lock.

  New callbacks are added to struct console:

   - write_thread() for flushing nbcon consoles in task context.

   - write_atomic() for flushing nbcon consoles in atomic context,
     including NMI.

   - con->device_lock() and device_unlock() for taking the driver
     specific lock, for example, port->lock.

  New printk-specific kthreads are created:

   - per-console kthreads which get responsible for flushing normal
     priority messages on nbcon consoles.

   - thread which gets responsible for flushing normal priority messages
     on all consoles when CONFIG_RT enabled.

  The new callbacks are called under a special per-console lock which
  has already been added back in v6.7. It allows to distinguish three
  severities: normal, emergency, and panic. A context with a higher
  priority could take over the ownership when it is safe even in the
  middle of handling a record. The panic context could do it even when
  it is not safe. But it is allowed only for the final desperate flush
  before entering the infinite loop.

  The new lock helps to flush the messages directly in emergency and
  panic contexts. But it is not enough in all situations:

   - console_lock() is still need for synchronization against boot
     consoles.

   - con->device_lock() is need for synchronization against other
     operations on the same HW, e.g. serial port speed setting,
     non-printk related read/write.

  The dependency on con->device_lock() is mutual. Any code taking the
  driver specific lock has to acquire the related nbcon console context
  as well. For example, see the new uart_port_lock() API. It provides
  the necessary synchronization against emergency and panic contexts
  where the messages are flushed only under the new per-console lock.

  Maybe surprisingly, a quite tricky part is the decision how to flush
  the consoles in various situations. It has to take into account:

   - message priority:    normal, emergency, panic

   - scheduling context:  task, atomic, deferred_legacy

   - registered consoles: boot, legacy, nbcon

   - threads are running: early boot, suspend, shutdown, panic

   - caller:              printk(), pr_flush(), printk_flush_in_panic(),
                          console_unlock(), console_start(), ...

  The primary decision is made in printk_get_console_flush_type(). It
  creates a hint what the caller should do:

   - flush nbcon consoles directly or via the kthread

   - call the legacy loop (console_unlock()) directly or via irq_work

  The existing behavior is preserved for the legacy consoles. The only
  exception is that they are not longer flushed directly from printk()
  in panic() before CPUs are stopped. But this blocking happens only
  when at least one nbcon console is registered. The motivation is to
  increase a chance to produce the crash dump. They legacy consoles
  might create a deadlock in compare with nbcon consoles. The nbcon
  console should allow to see the messages even when the crash dump
  fails.

  There are three possible ways how nbcon consoles are flushed:

   - The per-nbcon-console kthread is responsible for flushing messages
     added with the normal priority. This is the default mode.

   - The legacy loop, aka console_unlock(), is used when there is still
     a boot console registered. There is no easy way how to match an
     early console driver with a nbcon console driver. And the
     console_lock() provides the only reliable serialization at the
     moment.

     The legacy loop uses either con->write_atomic() or
     con->write_thread() callbacks depending on whether it is allowed to
     schedule. The atomic variant has to be used from printk().

   - In other situations, the messages are flushed directly using
     write_atomic() which can be called in any context, including NMI.
     It is primary needed during early boot or shutdown, in emergency
     situations, and panic.

  The emergency priority is used by a code called within
  nbcon_cpu_emergency_enter()/exit(). At the moment, it is used in four
  situations: WARN(), Oops, lockdep, and RCU stall reports.

  Finally, there is no nbcon console at the moment. It means that the
  changes should _not_ modify the existing behavior. The only exception
  is CONFIG_RT which would force offloading the legacy loop, for normal
  priority context, into the dedicated kthread"

* tag 'printk-for-6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: (54 commits)
  printk: Avoid false positive lockdep report for legacy printing
  printk: nbcon: Assign nice -20 for printing threads
  printk: Implement legacy printer kthread for PREEMPT_RT
  tty: sysfs: Add nbcon support for 'active'
  proc: Add nbcon support for /proc/consoles
  proc: consoles: Add notation to c_start/c_stop
  printk: nbcon: Show replay message on takeover
  printk: Provide helper for message prepending
  printk: nbcon: Rely on kthreads for normal operation
  printk: nbcon: Use thread callback if in task context for legacy
  printk: nbcon: Relocate nbcon_atomic_emit_one()
  printk: nbcon: Introduce printer kthreads
  printk: nbcon: Init @nbcon_seq to highest possible
  printk: nbcon: Add context to usable() and emit()
  printk: Flush console on unregister_console()
  printk: Fail pr_flush() if before SYSTEM_SCHEDULING
  printk: nbcon: Add function for printers to reacquire ownership
  printk: nbcon: Use raw_cpu_ptr() instead of open coding
  printk: Use the BITS_PER_LONG macro
  lockdep: Mark emergency sections in lockdep splats
  ...
2024-09-17 08:52:28 +02:00
..
accel
accessibility treewide: remove unnecessary <linux/version.h> inclusion 2024-08-12 18:36:44 +09:00
acpi Thermal control updates for 6.12-rc1 2024-09-16 08:05:54 +02:00
amba ARM: 9416/1: amba: make amba_bustype constant 2024-09-04 15:01:17 +01:00
android binder: fix UAF caused by offsets overwrite 2024-09-03 12:18:46 +02:00
ata ata: libata: Fix memory leak for error path in ata_host_alloc() 2024-08-27 06:54:36 +09:00
atm atm: idt77252: prevent use after free in dequeue_rx() 2024-08-12 10:41:44 +01:00
auxdisplay
base
bcma
block for-6.12/block-20240913 2024-09-16 13:33:06 +02:00
bluetooth Bluetooth: btintel_pcie: Allocate memory for driver private data 2024-09-12 17:32:42 -04:00
bus bus: bt1-apb: change to use devm_clk_get_enabled() helper 2024-08-29 10:45:13 +02:00
cache
cdrom
cdx
char Updates for timers and timekeeping: 2024-09-17 07:25:37 +02:00
clk clk: qcom: clk-alpha-pll: Simplify the zonda_pll_adjust_l_val() 2024-09-09 14:06:07 -07:00
clocksource Updates for timers and timekeeping: 2024-09-17 07:25:37 +02:00
comedi
connector
counter
cpufreq second round of amd-pstate changes for 6.12 (second try): 2024-09-11 18:22:23 +02:00
cpuidle cpuidle: remove dead code from cpuidle_enter_state() 2024-08-22 21:03:52 +02:00
crypto crypto: n2 - Set err to EINVAL if snprintf fails for hmac 2024-09-13 18:26:53 +08:00
cxl cxl/pci: Get AER capability address from RCRB only for RCH dport 2024-08-09 15:13:07 -07:00
dax
dca
devfreq PM / devfreq: imx-bus: Use of_property_present() 2024-09-05 01:23:56 +09:00
dio
dma dmaengine: dw-edma: Do not enable watermark interrupts for HDMA 2024-08-28 18:40:17 +05:30
dma-buf Updates for timers and timekeeping: 2024-09-17 07:25:37 +02:00
dpll dpll: add Embedded SYNC feature for a pin 2024-08-26 19:21:14 -07:00
edac - Drop a now obsolete ppc4xx_edac driver 2024-09-16 06:36:37 +02:00
eisa
extcon extcon: axp288: Switch to new Intel CPU model defines 2024-09-04 17:58:43 +02:00
firewire
firmware arm64 updates for 6.12 2024-09-16 06:55:07 +02:00
fpga
fsi
gnss
gpio gpio: modepin: Enable module autoloading 2024-09-02 15:00:53 +02:00
gpu Updates for timers and timekeeping: 2024-09-17 07:25:37 +02:00
greybus
hid hid-for-linus-2024081901 2024-08-19 11:02:13 -07:00
hsi
hte
hv hyperv-fixes for 6.11-rc8 2024-09-09 09:31:55 -07:00
hwmon hwmon: (pmbus) Conditionally clear individual status bits for pmbus rev >= 1.2 2024-09-09 10:58:09 -07:00
hwspinlock
hwtracing
i2c i2c: tegra: Do not mark ACPI devices as irq safe 2024-08-15 00:22:28 +02:00
i3c
idle intel_idle: Disable promotion to C1E on Jasper Lake and Elkhart Lake 2024-08-20 21:27:43 +02:00
iio iio: imu: inv_mpu6050: fix interrupt status read for old buggy chips 2024-08-17 15:31:41 +01:00
infiniband
input vfs-6.12.file 2024-09-16 09:14:02 +02:00
interconnect
iommu ARM development updates for v6.12-rc1 2024-09-16 06:32:08 +02:00
ipack
irqchip Updates for the interrupt subsystem: 2024-09-17 07:09:17 +02:00
isdn treewide: Fix wrong singular form of jiffies in comments 2024-09-08 20:47:40 +02:00
leds
macintosh
mailbox
mcb
md lsm/stable-6.12 PR 20240911 2024-09-16 18:19:47 +02:00
media ARM development updates for v6.12-rc1 2024-09-16 06:32:08 +02:00
memory
memstick
message
mfd
misc VMCI: Fix use-after-free when removing resource in vmci_resource_remove() 2024-09-03 13:16:42 +02:00
mmc mmc: cqhci: Fix checking of CQHCI_HALT state 2024-09-03 14:20:51 +02:00
most
mtd
mux
net Updates for timers and timekeeping: 2024-09-17 07:25:37 +02:00
nfc Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-08-29 11:49:10 -07:00
ntb
nubus
nvdimm nvdimm/pmem: Set dax flag for all 'PFN_MAP' cases 2024-08-09 14:29:58 -05:00
nvme for-6.12/block-20240913 2024-09-16 13:33:06 +02:00
nvmem nvmem: Fix return type of devm_nvmem_device_get() in kerneldoc 2024-09-03 12:20:41 +02:00
of A revert for a previous TTM commit causing stuttering, 3 fixes for 2024-08-30 11:28:11 +10:00
opp Merge branches 'pm-sleep', 'pm-opp' and 'pm-tools' 2024-09-11 19:02:23 +02:00
parisc
parport
pci ACPI updates for 6.12-rc1 2024-09-16 07:41:48 +02:00
pcmcia
peci
perf arm64 updates for 6.12 2024-09-16 06:55:07 +02:00
phy phy: xilinx: phy-zynqmp: Fix SGMII linkup failure on resume 2024-08-05 21:46:58 +05:30
pinctrl pinctrl: pinctrl-cy8c95x0: Fix regcache 2024-09-13 13:14:18 +02:00
platform Updates for timers and timekeeping: 2024-09-17 07:25:37 +02:00
pmdomain pmdomain: imx: wait SSAR when i.MX93 power domain on 2024-08-15 12:47:09 +02:00
pnp
power power sequencing fixes for v6.11-rc6 2024-09-01 09:07:44 +12:00
powercap powercap: intel_rapl: Change an error pointer to NULL 2024-08-23 15:45:17 +02:00
pps
ps3
ptp ptp: ptp_ines: Remove setting of RX software timestamp 2024-09-09 17:44:42 -07:00
pwm pwm: stm32: Use the right CCxNP bit in stm32_pwm_enable() 2024-09-05 11:12:01 +02:00
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 vfs-6.12.file 2024-09-16 09:14:02 +02:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-09-05 20:37:20 -07:00
sh
siox
slimbus
soc Qualcomm driver fixes for v6.11 2024-08-28 20:27:39 +00:00
soundwire soundwire: stream: Revert "soundwire: stream: fix programming slave ports for non-continous port maps" 2024-09-11 13:05:43 +05:30
spi spi: nxp-fspi: fix the KASAN report out-of-bounds bug 2024-09-11 22:25:44 +01:00
spmi
ssb
staging Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-09-12 17:11:24 -07:00
target
tc
tee
thermal - Add power domain DT bindings for new Amlogic SoCs (Georges Stark) 2024-09-10 10:54:15 +02:00
thunderbolt thunderbolt: Mark XDomain as unplugged when router is removed 2024-08-06 08:01:10 +03:00
tty printk changes for 6.12 2024-09-17 08:52:28 +02:00
ufs scsi: ufs: ufs-mediatek: Add UFSHCD_QUIRK_BROKEN_LSDBS_CAP 2024-08-28 21:29:20 -04:00
uio Drivers: hv: vmbus: Fix rescind handling in uio_hv_generic 2024-09-03 12:37:38 +02:00
usb usb: typec: ucsi: Fix cable registration 2024-09-03 19:26:18 +02:00
vdpa
vfio
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-08-08 14:04:17 -07:00
video video/aperture: optionally match the device in sysfb_disable() 2024-08-26 19:14:48 -04:00
virt arm64 updates for 6.12 2024-09-16 06:55:07 +02:00
virtio virtio: allow driver to disable the configure change notification 2024-08-15 19:14:19 -07:00
w1
watchdog
xen
zorro
Kconfig
Makefile