v5.16.2-rt19
Subsystems (33)
Dear RT folks!
I'm pleased to announce the v5.16.2-rt19 patch set.
Changes since v5.16.2-rt18:
- Update the printk series. Patches by John Ogness.
- Redo the i2c patches introduced in the previous release to address other driver which look also broken.
Known issues
- netconsole triggers WARN.
- Valentin Schneider reported a few splats on ARM64, see
https://lkml.kernel.org/r/[email protected]
The delta patch against v5.16.2-rt18 is appended below and can be found here:
https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.16/incr/patch-5.16.2-rt18-rt19.patch.xz
You can get this release via the git tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git v5.16.2-rt19
The RT patch against v5.16.2 can be found here:
https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.16/older/patch-5.16.2-rt19.patch.xz
The split quilt queue is available at:
https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.16/older/patches-5.16.2-rt19.tar.xz
Sebastian
arch/arm/kernel/smp.c +2 -0
@@ -676,7 +676,9 @@ static void do_handle_IPI(int ipinr)break ;case IPI_CPU_BACKTRACE : +printk_deferred_enter ();nmi_cpu_backtrace (get_irq_regs ()); +printk_deferred_exit ();break ;default :
arch/powerpc/include/asm/smp.h +0 -1
@@ -62,7 +62,6 @@ struct smp_ops_t {extern int smp_send_nmi_ipi (int cpu,void (*fn)(struct pt_regs *),u64 delay_us);extern int smp_send_safe_nmi_ipi (int cpu,void (*fn)(struct pt_regs *),u64 delay_us); -extern void smp_send_debugger_break_cpu (unsigned int cpu);extern void smp_send_debugger_break (void );extern void start_secondary_resume (void );extern void smp_generic_give_timebase (void );
arch/powerpc/kernel/kgdb.c +1 -9
@@ -120,19 +120,11 @@ int kgdb_skipexception(int exception, struct pt_regs *regs)static int kgdb_debugger_ipi (struct pt_regs *regs) { -int cpu =raw_smp_processor_id (); - -if (!kgdb_roundup_delay (cpu)) -kgdb_nmicallback (cpu, regs); +kgdb_nmicallback (raw_smp_processor_id (), regs);return 0 ; }#ifdef CONFIG_SMP -void kgdb_roundup_cpu (unsigned int cpu) -{ -smp_send_debugger_break_cpu (cpu); -} -void kgdb_roundup_cpus (void ) {smp_send_debugger_break ();
arch/powerpc/kernel/smp.c +0 -5
@@ -589,11 +589,6 @@ static void debugger_ipi_callback(struct pt_regs *regs)debugger_ipi (regs); } -void smp_send_debugger_break_cpu (unsigned int cpu) -{ -smp_send_nmi_ipi (cpu, debugger_ipi_callback,1000000 ); -} -void smp_send_debugger_break (void ) {smp_send_nmi_ipi (NMI_IPI_ALL_OTHERS , debugger_ipi_callback,1000000 );
arch/powerpc/kexec/crash.c +3 -0
@@ -312,6 +312,9 @@ void default_machine_crash_shutdown(struct pt_regs *regs)unsigned int i;int (*old_handler)(struct pt_regs *regs); +/* Avoid hardlocking with irresponsive CPU holding logbuf_lock */ +printk_deferred_enter (); +/* * This function is only called after the system * has panicked or is otherwise in a critical state.
arch/x86/kernel/dumpstack_32.c +1 -1
@@ -141,7 +141,7 @@ int get_stack_info(unsigned long *stack, struct task_struct *task,*/ if (visit_mask) {if (*visit_mask & (1UL << info->type)) { -pr_warn_once ("WARNING: stack recursion on stack type %d\n" , info->type); +printk_deferred_once (KERN_WARNING "WARNING: stack recursion on stack type %d\n" , info->type); goto unknown; } *visit_mask |=1UL << info->type;
arch/x86/kernel/dumpstack_64.c +1 -2
@@ -207,8 +207,7 @@ int get_stack_info(unsigned long *stack, struct task_struct *task,if (visit_mask) {if (*visit_mask & (1UL << info->type)) {if (task == current) -pr_warn_once ("WARNING: stack recursion on stack type %d\n" , - info->type); +printk_deferred_once (KERN_WARNING "WARNING: stack recursion on stack type %d\n" , info->type); goto unknown; } *visit_mask |=1UL << info->type;
arch/x86/kernel/i8259.c +2 -1
@@ -207,7 +207,8 @@ static void mask_and_ack_8259A(struct irq_data *data)* lets ACK and report it. [once per IRQ] */ if (!(spurious_irq_mask & irqmask)) { -printk (KERN_DEBUG "spurious 8259A interrupt: IRQ%d.\n" , irq); +printk_deferred (KERN_DEBUG +"spurious 8259A interrupt: IRQ%d.\n" , irq); spurious_irq_mask |= irqmask; }atomic_inc (&irq_err_count);
arch/x86/kernel/kgdb.c +3 -6
@@ -502,12 +502,9 @@ static int kgdb_nmi_handler(unsigned int cmd, struct pt_regs *regs)if (atomic_read (&kgdb_active) !=-1 ) {/* KGDB CPU roundup */ cpu =raw_smp_processor_id (); - -if (!kgdb_roundup_delay (cpu)) { -kgdb_nmicallback (cpu, regs); -set_bit (cpu, was_in_debug_nmi); -touch_nmi_watchdog (); - } +kgdb_nmicallback (cpu, regs); +set_bit (cpu, was_in_debug_nmi); +touch_nmi_watchdog ();return NMI_HANDLED ; }
arch/x86/kernel/unwind_frame.c +9 -7
@@ -41,9 +41,9 @@ static void unwind_dump(struct unwind_state *state) dumped_before = true; -printk ("unwind stack type:%d next_sp:%p mask:0x%lx graph_idx:%d\n" , - state->stack_info.type, state->stack_info.next_sp, - state->stack_mask, state->graph_idx); +printk_deferred ("unwind stack type:%d next_sp:%p mask:0x%lx graph_idx:%d\n" , + state->stack_info.type, state->stack_info.next_sp, + state->stack_mask, state->graph_idx);for (sp =PTR_ALIGN (state->orig_sp,sizeof (long )); sp; sp =PTR_ALIGN (stack_info.next_sp,sizeof (long ))) {
@@ -59,11 +59,13 @@ static void unwind_dump(struct unwind_state *state)if (zero) {if (!prev_zero) -printk ("%p: %0*x ...\n" , sp,BITS_PER_LONG /4 ,0 ); +printk_deferred ("%p: %0*x ...\n" , + sp,BITS_PER_LONG /4 ,0 );continue ; } -printk ("%p: %0*lx (%pB)\n" , sp,BITS_PER_LONG /4 , word, (void *)word); +printk_deferred ("%p: %0*lx (%pB)\n" , + sp,BITS_PER_LONG /4 , word, (void *)word); } } }
@@ -339,13 +341,13 @@ bool unwind_next_frame(struct unwind_state *state) goto the_end;if (state->regs) { -pr_warn_once ( +printk_deferred_once (KERN_WARNING "WARNING: kernel stack regs at %p in %s:%d has bad 'bp' value %p\n" , state->regs, state->task->comm, state->task->pid, next_bp);unwind_dump (state); }else { -pr_warn_once ( +printk_deferred_once (KERN_WARNING "WARNING: kernel stack frame pointer at %p in %s:%d has bad value %p\n" , state->bp, state->task->comm, state->task->pid, next_bp);
arch/x86/kernel/unwind_orc.c +1 -1
@@ -9,7 +9,7 @@#include <asm/orc_lookup.h> #define orc_warn (fmt, ...) \ - pr_warn_once("WARNING: " fmt, ##__VA_ARGS__) + printk_deferred_once(KERN_WARNING "WARNING: " fmt, ##__VA_ARGS__) #define orc_warn_current(args...) \ ({ \
drivers/char/random.c +3 -2
@@ -1566,8 +1566,9 @@ static void _warn_unseeded_randomness(const char *func_name, void *caller, print_once = true;#endif if (__ratelimit (&unseeded_warning)) -pr_notice ("random: %s called from %pS with crng_init=%d\n" , - func_name, caller, crng_init); +printk_deferred (KERN_NOTICE "random: %s called from %pS " +"with crng_init=%d\n" , func_name, caller, + crng_init); }/*
drivers/i2c/busses/i2c-cht-wc.c +2 -9
@@ -99,15 +99,8 @@ static irqreturn_t cht_wc_i2c_adap_thread_handler(int id, void *data)* interrupt handler as well, so running the client irq handler from * this thread will cause things to lock up. */ -if (reg &CHT_WC_EXTCHGRIRQ_CLIENT_IRQ ) { -/* -* generic_handle_irq expects local IRQs to be disabled -* as normally it is called from interrupt context. -*/ -local_irq_disable (); -generic_handle_irq (adap->client_irq); -local_irq_enable (); - } +if (reg &CHT_WC_EXTCHGRIRQ_CLIENT_IRQ ) +generic_handle_irq_safe (adap->client_irq);return IRQ_HANDLED ; }
drivers/i2c/busses/i2c-rcar.c +3 -1
@@ -1025,6 +1025,7 @@ static int rcar_i2c_probe(struct platform_device *pdev)struct rcar_i2c_priv *priv;struct i2c_adapter *adap;struct device *dev = &pdev->dev; +unsigned long irqflags =0 ;irqreturn_t (*irqhandler)(int irq,void *ptr) = rcar_i2c_gen3_irq;int ret;
@@ -1075,6 +1076,7 @@ static int rcar_i2c_probe(struct platform_device *pdev)rcar_i2c_write (priv,ICSAR ,0 );/* Gen2: must be 0 if not using slave */ if (priv->devtype <I2C_RCAR_GEN3 ) { + irqflags |=IRQF_NO_THREAD ; irqhandler = rcar_i2c_gen2_irq; }
@@ -1100,7 +1102,7 @@ static int rcar_i2c_probe(struct platform_device *pdev)if (ret <0 ) goto out_pm_disable; priv->irq = ret; - ret =devm_request_irq (dev, priv->irq, irqhandler,0 ,dev_name (dev), priv); + ret =devm_request_irq (dev, priv->irq, irqhandler, irqflags,dev_name (dev), priv);if (ret <0 ) {dev_err (dev,"cannot get irq %d\n" , priv->irq); goto out_pm_disable;
drivers/i2c/i2c-core-base.c +1 -4
@@ -1423,10 +1423,7 @@ int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr)if (irq <=0 )return -ENXIO ; -if (!IS_ENABLED (CONFIG_PREEMPT_RT )) -generic_handle_irq (irq); -else -handle_nested_irq (irq); +generic_handle_irq_safe (irq);return 0 ; }
drivers/mfd/ezx-pcap.c +1 -3
@@ -193,13 +193,11 @@ static void pcap_isr_work(struct work_struct *work)ezx_pcap_write (pcap,PCAP_REG_MSR , isr | msr);ezx_pcap_write (pcap,PCAP_REG_ISR , isr); -local_irq_disable (); service = isr & ~msr;for (irq = pcap->irq_base; service; service >>=1 , irq++) {if (service &1 ) -generic_handle_irq (irq); +generic_handle_irq_safe (irq); } -local_irq_enable ();ezx_pcap_write (pcap,PCAP_REG_MSR , pcap->msr); }while (gpio_get_value (pdata->gpio)); }
drivers/misc/hi6421v600-irq.c +3 -3
@@ -117,8 +117,8 @@ static irqreturn_t hi6421v600_irq_handler(int irq, void *__priv)* If both powerkey down and up IRQs are received, * handle them at the right order */ -generic_handle_irq (priv->irqs[POWERKEY_DOWN ]); -generic_handle_irq (priv->irqs[POWERKEY_UP ]); +generic_handle_irq_safe (priv->irqs[POWERKEY_DOWN ]); +generic_handle_irq_safe (priv->irqs[POWERKEY_UP ]); pending &= ~HISI_IRQ_POWERKEY_UP_DOWN ; }
@@ -126,7 +126,7 @@ static irqreturn_t hi6421v600_irq_handler(int irq, void *__priv)continue ;for_each_set_bit (offset, &pending,BITS_PER_BYTE ) { -generic_handle_irq (priv->irqs[offset + i *BITS_PER_BYTE ]); +generic_handle_irq_safe (priv->irqs[offset + i *BITS_PER_BYTE ]); } }
drivers/net/usb/lan78xx.c +2 -5
@@ -1367,11 +1367,8 @@ static void lan78xx_status(struct lan78xx_net *dev, struct urb *urb)netif_dbg (dev, link, dev->net,"PHY INTR: 0x%08x\n" , intdata);lan78xx_defer_kevent (dev,EVENT_LINK_RESET ); -if (dev->domain_data.phyirq >0 ) { -local_irq_disable (); -generic_handle_irq (dev->domain_data.phyirq); -local_irq_enable (); - } +if (dev->domain_data.phyirq >0 ) +generic_handle_irq_safe (dev->domain_data.phyirq); }else {netdev_warn (dev->net,"unexpected interrupt: 0x%08x\n" , intdata);
drivers/staging/greybus/gpio.c +1 -4
@@ -391,10 +391,7 @@ static int gb_gpio_request_handler(struct gb_operation *op)return -EINVAL ; } -local_irq_disable (); - ret =generic_handle_irq (irq); -local_irq_enable (); - + ret =generic_handle_irq_safe (irq);if (ret)dev_err (dev,"failed to invoke irq handler\n" );
drivers/tty/serial/8250/8250.h +4 -4
@@ -142,12 +142,12 @@ static inline void serial8250_set_IER(struct uart_8250_port *up, is_console =uart_console (port);if (is_console) -console_atomic_lock (flags); +printk_cpu_sync_get_irqsave (flags);serial_out (up,UART_IER , ier);if (is_console) -console_atomic_unlock (flags); +printk_cpu_sync_put_irqrestore (flags); }static inline unsigned char serial8250_clear_IER (struct uart_8250_port *up)
@@ -164,13 +164,13 @@ static inline unsigned char serial8250_clear_IER(struct uart_8250_port *up) clearval =UART_IER_UUE ;if (is_console) -console_atomic_lock (flags); +printk_cpu_sync_get_irqsave (flags); prior =serial_port_in (port,UART_IER );serial_port_out (port,UART_IER , clearval);if (is_console) -console_atomic_unlock (flags); +printk_cpu_sync_put_irqrestore (flags);return prior; }
drivers/tty/serial/8250/8250_fsl.c +2 -2
@@ -63,10 +63,10 @@ int fsl8250_handle_irq(struct uart_port *port) is_console =uart_console (port);if (is_console) -console_atomic_lock (flags); +printk_cpu_sync_get_irqsave (flags); up->ier = port->serial_in (port,UART_IER );if (is_console) -console_atomic_unlock (flags); +printk_cpu_sync_put_irqrestore (flags);if (up->ier & (UART_IER_RLSI |UART_IER_RDI )) { port->ops->stop_rx (port);
drivers/tty/serial/8250/8250_ingenic.c +2 -2
@@ -171,10 +171,10 @@ static void ingenic_uart_serial_out(struct uart_port *p, int offset, int value)*/ is_console =uart_console (p);if (is_console) -console_atomic_lock (flags); +printk_cpu_sync_get_irqsave (flags); ier = p->serial_in (p,UART_IER );if (is_console) -console_atomic_unlock (flags); +printk_cpu_sync_put_irqrestore (flags);if (ier &UART_IER_MSI ) value |=UART_MCR_MDCE |UART_MCR_FCM ;
drivers/tty/serial/8250/8250_mtk.c +4 -4
@@ -226,13 +226,13 @@ static void mtk8250_disable_intrs(struct uart_8250_port *up, int mask) is_console =uart_console (port);if (is_console) -console_atomic_lock (flags); +printk_cpu_sync_get_irqsave (flags); ier =serial_in (up,UART_IER );serial_out (up,UART_IER , ier & (~mask));if (is_console) -console_atomic_unlock (flags); +printk_cpu_sync_put_irqrestore (flags); }static void mtk8250_enable_intrs (struct uart_8250_port *up,int mask)
@@ -242,13 +242,13 @@ static void mtk8250_enable_intrs(struct uart_8250_port *up, int mask)unsigned int ier;if (uart_console (port)) -console_atomic_lock (flags); +printk_cpu_sync_get_irqsave (flags); ier =serial_in (up,UART_IER );serial_out (up,UART_IER , ier | mask);if (uart_console (port)) -console_atomic_unlock (flags); +printk_cpu_sync_put_irqrestore (flags); }static void mtk8250_set_flow_ctrl (struct uart_8250_port *up,int mode)
drivers/tty/serial/8250/8250_port.c +4 -4
@@ -3304,9 +3304,9 @@ static void serial8250_console_putchar(struct uart_port *port, int ch)wait_for_xmitr (up,UART_LSR_THRE ); -console_atomic_lock (flags); +printk_cpu_sync_get_irqsave (flags);serial8250_console_putchar_locked (port, ch); -console_atomic_unlock (flags); +printk_cpu_sync_put_irqrestore (flags); }/*
@@ -3337,7 +3337,7 @@ void serial8250_console_write_atomic(struct uart_8250_port *up,unsigned long flags;unsigned int ier; -console_atomic_lock (flags); +printk_cpu_sync_get_irqsave (flags);touch_nmi_watchdog ();
@@ -3353,7 +3353,7 @@ void serial8250_console_write_atomic(struct uart_8250_port *up,wait_for_xmitr (up,BOTH_EMPTY );serial8250_set_IER (up, ier); -console_atomic_unlock (flags); +printk_cpu_sync_put_irqrestore (flags); }/*
drivers/tty/serial/8250/Kconfig +1 -0
@@ -9,6 +9,7 @@ config SERIAL_8250 depends on !S390 select SERIAL_CORE select SERIAL_MCTRL_GPIO if GPIOLIB + select HAVE_ATOMIC_CONSOLE help This selects whether you want to include the driver for the standard serial ports. The standard answer is Y. People who might say N
drivers/tty/vt/vt.c +1 -1
@@ -3161,7 +3161,7 @@ static struct console vt_console_driver = { .write = vt_console_print, .device = vt_console_device, .unblank = unblank_screen, - .flags = CON_PRINTBUFFER, + .flags = CON_PRINTBUFFER|CON_MIGHT_SLEEP, .index = -1, };#endif
include/linux/console.h +34 -18
85 lines not on this page · raw message
include/linux/irqdesc.h +1 -0
@@ -160,6 +160,7 @@ static inline void generic_handle_irq_desc(struct irq_desc *desc)int handle_irq_desc (struct irq_desc *desc);int generic_handle_irq (unsigned int irq); +int generic_handle_irq_safe (unsigned int irq);#ifdef CONFIG_IRQ_DOMAIN /*
include/linux/kgdb.h +0 -3
@@ -212,8 +212,6 @@ extern void kgdb_call_nmi_hook(void *ignored);*/ extern void kgdb_roundup_cpus (void ); -extern void kgdb_roundup_cpu (unsigned int cpu); -/** * kgdb_arch_set_pc - Generic call back to the program counter * @regs: Current &struct pt_regs.
@@ -367,6 +365,5 @@ extern void kgdb_free_init_mem(void);#define dbg_late_init ()static inline void kgdb_panic (const char *msg) {}static inline void kgdb_free_init_mem (void ) { } -static inline void kgdb_roundup_cpu (unsigned int cpu) {}#endif /* ! CONFIG_KGDB */ #endif /* _KGDB_H_ */
include/linux/printk.h +56 -49
163 lines not on this page · raw message
include/linux/suspend.h +8 -2
@@ -550,17 +550,23 @@ static inline void unlock_system_sleep(void) {}#ifdef CONFIG_PM_SLEEP_DEBUG extern bool pm_print_times_enabled;extern bool pm_debug_messages_on; -extern __printf(1, 2) void pm_pr_dbg(const char *fmt, ...); +extern __printf(2, 3) void __pm_pr_dbg(bool defer, const char *fmt, ...); #else #define pm_print_times_enabled (false) #define pm_debug_messages_on (false)#include <linux/printk.h> -#define pm_pr_dbg (fmt, ...) \ +#define __pm_pr_dbg (defer, fmt, ...) \ no_printk(KERN_DEBUG fmt, ##__VA_ARGS__)#endif +#define pm_pr_dbg (fmt, ...) \ + __pm_pr_dbg(false, fmt, ##__VA_ARGS__) + +#define pm_deferred_pr_dbg (fmt, ...) \ + __pm_pr_dbg(true, fmt, ##__VA_ARGS__) +#ifdef CONFIG_PM_AUTOSLEEP /* kernel/power/autosleep.c */
init/Kconfig +4 -0
@@ -1542,6 +1542,10 @@ config PRINTK very difficult to diagnose system problems, saying N here is strongly discouraged. +config HAVE_ATOMIC_CONSOLE + bool + default n + config BUG bool "BUG() support" if EXPERT default y
kernel/debug/debug_core.c +19 -26
61 lines not on this page · raw message
kernel/debug/kdb/kdb_io.c +12 -6
@@ -559,17 +559,23 @@ static void kdb_msg_write(const char *msg, int msg_len) cp++; } -/* mirror output on atomic consoles */ for_each_console (c) {if (!(c->flags &CON_ENABLED ))continue ;if (c == dbg_io_ops->cons)continue ; - -if (!c->write_atomic) -continue ; - c->write_atomic (c, msg, msg_len); - +/* +* Set oops_in_progress to encourage the console drivers to +* disregard their internal spin locks: in the current calling +* context the risk of deadlock is a bigger problem than risks +* due to re-entering the console driver. We operate directly on +* oops_in_progress rather than using bust_spinlocks() because +* the calls bust_spinlocks() makes on exit are not appropriate +* for this calling context. +*/ + ++oops_in_progress; + c->write (c, msg, msg_len); + --oops_in_progress;touch_nmi_watchdog (); } }
kernel/irq/irqdesc.c +21 -0
@@ -662,6 +662,27 @@ int generic_handle_irq(unsigned int irq) }EXPORT_SYMBOL_GPL (generic_handle_irq); +/** +* generic_handle_irq_safe - Invoke the handler for a particular irq +* @irq: The irq number to handle +* +* Returns: 0 on success, or -EINVAL if conversion has failed +* +* This function must be called either from an IRQ context with irq regs +* initialized or with care from any context. +*/ +int generic_handle_irq_safe (unsigned int irq) +{ +unsigned long flags; +int ret; + +local_irq_save (flags); + ret =handle_irq_desc (irq_to_desc (irq)); +local_irq_restore (flags); +return ret; +} +EXPORT_SYMBOL_GPL (generic_handle_irq_safe); +#ifdef CONFIG_IRQ_DOMAIN /** * generic_handle_domain_irq - Invoke the handler for a HW irq belonging
kernel/panic.c +16 -18
@@ -178,28 +178,12 @@ static void panic_print_sys_info(void)void panic (const char *fmt, ...) {static char buf[1024 ]; -va_list args2;va_list args;long i, i_next =0 , len;int state =0 ;int old_cpu, this_cpu;bool _crash_kexec_post_notifiers = crash_kexec_post_notifiers; -console_verbose (); -pr_emerg ("Kernel panic - not syncing:\n" ); -va_start (args2, fmt); -va_copy (args, args2); -vprintk (fmt, args2); -va_end (args2); -#ifdef CONFIG_DEBUG_BUGVERBOSE -/* -* Avoid nested stack-dumping if a panic occurs during oops processing -*/ -if (!test_taint (TAINT_DIE ) && oops_in_progress <=1 ) -dump_stack (); -#endif -pr_flush (1000 , true); -/* * Disable local interrupts. This will prevent panic_smp_self_stop * from deadlocking the first cpu that invokes the panic, since
@@ -230,13 +214,23 @@ void panic(const char *fmt, ...)if (old_cpu !=PANIC_CPU_INVALID && old_cpu != this_cpu)panic_smp_self_stop (); -bust_spinlocks (1 ); +console_verbose (); +va_start (args, fmt); len =vscnprintf (buf,sizeof (buf), fmt, args);va_end (args);if (len && buf[len -1 ] =='\n' ) buf[len -1 ] ='\0' ; +pr_emerg ("Kernel panic - not syncing: %s\n" , buf); +#ifdef CONFIG_DEBUG_BUGVERBOSE +/* +* Avoid nested stack-dumping if a panic occurs during oops processing +*/ +if (!test_taint (TAINT_DIE ) && oops_in_progress <=1 ) +dump_stack (); +#endif +/* * If kgdb is enabled, give it a chance to run before we stop all * the other CPUs or else we won't be able to debug processes left
@@ -244,6 +238,11 @@ void panic(const char *fmt, ...)*/ kgdb_panic (buf); +/* Use atomic consoles to dump the kernel log. */ +console_flush_on_panic (CONSOLE_ATOMIC_FLUSH_PENDING ); + +bust_spinlocks (1 ); +/* * If we have crashed and we have a crash kernel loaded let it handle * everything else.
@@ -541,7 +540,6 @@ void oops_enter(void)static void print_oops_end_marker (void ) {pr_warn ("---[ end trace %016llx ]---\n" ,0ULL ); -pr_flush (1000 , true); }/*
kernel/power/main.c +7 -3
@@ -543,13 +543,14 @@ static int __init pm_debug_messages_setup(char *str)__setup ("pm_debug_messages" , pm_debug_messages_setup);/** -* pm_pr_dbg - Print a suspend debug message to the kernel log. +* __pm_pr_dbg - Print a suspend debug message to the kernel log. +* @defer: Whether or not to use printk_deferred() to print the message. * @fmt: Message format. * * The message will be emitted if enabled through the pm_debug_messages * sysfs attribute. */ -void pm_pr_dbg (const char *fmt, ...) +void __pm_pr_dbg (bool defer,const char *fmt, ...) {struct va_format vaf;va_list args;
@@ -562,7 +563,10 @@ void pm_pr_dbg(const char *fmt, ...) vaf.fmt = fmt; vaf.va = &args; -printk (KERN_DEBUG "PM: %pV" , &vaf); +if (defer) +printk_deferred (KERN_DEBUG "PM: %pV" , &vaf); +else +printk (KERN_DEBUG "PM: %pV" , &vaf);va_end (args); }
kernel/printk/Makefile +1 -0
@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only obj-y = printk.o +obj-$(CONFIG_PRINTK) += printk_safe.o obj-$(CONFIG_A11Y_BRAILLE_CONSOLE) += braille.o obj-$(CONFIG_PRINTK) += printk_ringbuffer.o obj-$(CONFIG_PRINTK_INDEX) += index.o
kernel/printk/internal.h +36 -0
@@ -2,6 +2,7 @@/* * internal.h - printk internal definitions */ +#include <linux/percpu.h> #ifdef CONFIG_PRINTK
@@ -11,6 +12,41 @@ enum printk_info_flags {LOG_CONT =8 ,/* text is a fragment of a continuation line */ }; +__printf(4, 0) +int vprintk_store (int facility,int level, +const struct dev_printk_info *dev_info, +const char *fmt,va_list args); + +__printf(1, 0) int vprintk_default(const char *fmt, va_list args); +__printf(1, 0) int vprintk_deferred(const char *fmt, va_list args); + +bool printk_percpu_data_ready (void ); + +#define printk_safe_enter_irqsave (flags) \ + do { \ + local_irq_save(flags); \ + __printk_safe_enter(); \ + } while (0) + +#define printk_safe_exit_irqrestore (flags) \ + do { \ + __printk_safe_exit(); \ + local_irq_restore(flags); \ + } while (0) + +void defer_console_output (void ); +u16 printk_parse_prefix (const char *text,int *level,enum printk_info_flags *flags); +#else + +/* +* In !PRINTK builds we still export console_sem +* semaphore and some of console functions (console_unlock()/etc.), so +* printk-safe must preserve the existing local IRQ guarantees. +*/ +#define printk_safe_enter_irqsave (flags) local_irq_save(flags) +#define printk_safe_exit_irqrestore (flags) local_irq_restore(flags) + +static inline bool printk_percpu_data_ready (void ) {return false; }#endif /* CONFIG_PRINTK */
kernel/printk/printk.c +1144 -539
2,039 lines not on this page · raw message
kernel/printk/printk_safe.c new file +52 -0
52 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.
Quoted 14 lines · To Thomas Gleixner
Dear RT folks!
I'm pleased to announce the v5.16.2-rt19 patch set.
Changes since v5.16.2-rt18:
- Update the printk series. Patches by John Ogness.
- Redo the i2c patches introduced in the previous release to address other driver which look also broken.
Known issues
- netconsole triggers WARN.
Quoted 6 lines
- Valentin Schneider reported a few splats on ARM64, see
https://lkml.kernel.org/r/[email protected]The delta patch against v5.16.2-rt18 is appended below and can be found here:
https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.16/incr/patch-5.16.2-rt18-rt19.patch.xz
The diff got too big and and the announcement didn't make it to the list. Here is the mail without the incremental diff which can been viewed at
https://git.kernel.org/rt/linux-rt-devel/d/v5.16.2-rt19/v5.16.2-rt18
Quoted 11 lines
You can get this release via the git tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git v5.16.2-rt19The RT patch against v5.16.2 can be found here:
https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.16/older/patch-5.16.2-rt19.patch.xzThe split quilt queue is available at:
https://cdn.kernel.org/pub/linux/kernel/projects/rt/5.16/older/patches-5.16.2-rt19.tar.xz
Sebastian