diff --git a/0001-raspberrypi-kernel-RT.patch b/0001-raspberrypi-kernel-RT.patch index fa1cffa7e5e318e6f312794d06320fd2a41a21e9..f2c5a9a86480fd3c2f1e1fac73d1146b6aab3556 100644 --- a/0001-raspberrypi-kernel-RT.patch +++ b/0001-raspberrypi-kernel-RT.patch @@ -1,7 +1,7 @@ -From 1dd24e3cb6227ce71015d651d5eff0ea7a38b79f Mon Sep 17 00:00:00 2001 -From: zhangyu -Date: Tue, 12 Nov 2024 16:08:21 +0800 -Subject: [PATCH] rpi-rt1 +From 00e5853d7b96eb930d9b646d424f3abfe82e8603 Mon Sep 17 00:00:00 2001 +From: wuyaowei +Date: Thu, 4 Dec 2025 16:09:15 +0800 +Subject: [PATCH 1/2] rt1 --- arch/arm/Kconfig | 6 +- @@ -50,11 +50,10 @@ Subject: [PATCH] rpi-rt1 drivers/tty/serial/8250/8250_mtk.c | 8 +- drivers/tty/serial/8250/8250_omap.c | 52 +- drivers/tty/serial/8250/8250_pci1xxxx.c | 8 +- - drivers/tty/serial/8250/8250_port.c | 259 ++- + drivers/tty/serial/8250/8250_port.c | 260 ++- drivers/tty/serial/altera_jtaguart.c | 28 +- drivers/tty/serial/altera_uart.c | 20 +- drivers/tty/serial/amba-pl010.c | 20 +- - drivers/tty/serial/amba-pl011.c | 78 +- drivers/tty/serial/apbuart.c | 8 +- drivers/tty/serial/ar933x_uart.c | 26 +- drivers/tty/serial/arc_uart.c | 16 +- @@ -113,7 +112,7 @@ Subject: [PATCH] rpi-rt1 drivers/tty/serial/uartlite.c | 18 +- drivers/tty/serial/ucc_uart.c | 4 +- drivers/tty/serial/vt8500_serial.c | 8 +- - drivers/tty/serial/xilinx_uartps.c | 56 +- + drivers/tty/serial/xilinx_uartps.c | 52 +- drivers/tty/tty_io.c | 11 +- fs/proc/consoles.c | 14 +- include/linux/bottom_half.h | 2 + @@ -168,7 +167,7 @@ Subject: [PATCH] rpi-rt1 kernel/trace/trace_output.c | 16 +- net/core/dev.c | 39 +- net/core/skbuff.c | 7 +- - 164 files changed, 5045 insertions(+), 1540 deletions(-) + 163 files changed, 5006 insertions(+), 1498 deletions(-) create mode 100644 kernel/printk/nbcon.c diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig @@ -210,10 +209,10 @@ index 749935e2e..46910150c 100644 select HAVE_REGS_AND_STACK_ACCESS_API select HAVE_RSEQ diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c -index fef62e4a9..622a30243 100644 +index ed1a25f45..90c9ecd71 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c -@@ -404,6 +404,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, +@@ -411,6 +411,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, if (addr < TASK_SIZE) return do_page_fault(addr, fsr, regs); @@ -223,7 +222,7 @@ index fef62e4a9..622a30243 100644 if (user_mode(regs)) goto bad_area; -@@ -474,6 +477,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, +@@ -481,6 +484,9 @@ do_translation_fault(unsigned long addr, unsigned int fsr, static int do_sect_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs) { @@ -433,19 +432,19 @@ index a1ff693e4..adcc34042 100644 EXPORT_SYMBOL(kernel_neon_end); diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig -index 21ae67351..f45c46671 100644 +index e93bd6476..93920b57f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig -@@ -99,6 +99,7 @@ config ARM64 - select ARCH_SUPPORTS_NUMA_BALANCING +@@ -110,6 +110,7 @@ config ARM64 select ARCH_SUPPORTS_PAGE_TABLE_CHECK select ARCH_SUPPORTS_PER_VMA_LOCK + select ARCH_SUPPORTS_HUGE_PFNMAP if TRANSPARENT_HUGEPAGE + select ARCH_SUPPORTS_RT select ARCH_WANT_BATCHED_UNMAP_TLB_FLUSH select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT select ARCH_WANT_DEFAULT_BPF_JIT diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig -index 37fbb5fc3..9a7d3d054 100644 +index 2979c9f96..57f52ef31 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -166,6 +166,7 @@ config PPC @@ -531,7 +530,7 @@ index 4ebf2ef28..381c3be3b 100644 select MPIC select OF_DYNAMIC diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c -index b1e6d275c..9a8d3970d 100644 +index a74f31362..178bdf3d8 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c @@ -25,6 +25,7 @@ @@ -657,10 +656,10 @@ index d0345bd65..23fed53b8 100644 - #endif diff --git a/arch/riscv/include/asm/thread_info.h b/arch/riscv/include/asm/thread_info.h -index 4fb84c2e9..61d990f69 100644 +index 8c72d1bcd..c59ad9b7a 100644 --- a/arch/riscv/include/asm/thread_info.h +++ b/arch/riscv/include/asm/thread_info.h -@@ -87,6 +87,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); +@@ -86,6 +86,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); * - pending work-to-be-done flags are in lowest half-word * - other flags in upper half-word(s) */ @@ -668,7 +667,7 @@ index 4fb84c2e9..61d990f69 100644 #define TIF_NOTIFY_RESUME 1 /* callback before returning to user */ #define TIF_SIGPENDING 2 /* signal pending */ #define TIF_NEED_RESCHED 3 /* rescheduling necessary */ -@@ -101,6 +102,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); +@@ -100,6 +101,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) #define _TIF_NOTIFY_SIGNAL (1 << TIF_NOTIFY_SIGNAL) #define _TIF_UPROBE (1 << TIF_UPROBE) @@ -677,7 +676,7 @@ index 4fb84c2e9..61d990f69 100644 #define _TIF_WORK_MASK \ (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING | _TIF_NEED_RESCHED | \ diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c -index e39a905ac..dd118773e 100644 +index bb5fb2b82..25b6819b6 100644 --- a/arch/riscv/kernel/cpufeature.c +++ b/arch/riscv/kernel/cpufeature.c @@ -8,6 +8,7 @@ @@ -696,7 +695,7 @@ index e39a905ac..dd118773e 100644 #define MISALIGNED_COPY_SIZE ((MISALIGNED_BUFFER_SIZE / 2) - 0x80) unsigned long elf_hwcap __read_mostly; -@@ -571,14 +573,15 @@ unsigned long riscv_get_elf_hwcap(void) +@@ -575,14 +577,15 @@ unsigned long riscv_get_elf_hwcap(void) return hwcap; } @@ -714,7 +713,7 @@ index e39a905ac..dd118773e 100644 void *dst; void *src; long speed = RISCV_HWPROBE_MISALIGNED_SLOW; -@@ -587,12 +590,6 @@ void check_unaligned_access(int cpu) +@@ -591,12 +594,6 @@ void check_unaligned_access(int cpu) if (per_cpu(misaligned_access_speed, cpu) != RISCV_HWPROBE_MISALIGNED_UNKNOWN) return; @@ -727,7 +726,7 @@ index e39a905ac..dd118773e 100644 /* Make an unaligned destination buffer. */ dst = (void *)((unsigned long)page_address(page) | 0x1); /* Unalign src as well, but differently (off by 1 + 2 = 3). */ -@@ -645,7 +642,7 @@ void check_unaligned_access(int cpu) +@@ -649,7 +646,7 @@ void check_unaligned_access(int cpu) pr_warn("cpu%d: rdtime lacks granularity needed to measure unaligned access speed\n", cpu); @@ -736,7 +735,7 @@ index e39a905ac..dd118773e 100644 } if (word_cycles < byte_cycles) -@@ -659,18 +656,83 @@ void check_unaligned_access(int cpu) +@@ -663,18 +660,83 @@ void check_unaligned_access(int cpu) (speed == RISCV_HWPROBE_MISALIGNED_FAST) ? "fast" : "slow"); per_cpu(misaligned_access_speed, cpu) = speed; @@ -838,10 +837,10 @@ index 1b8da4e40..2cb5e6514 100644 if (has_vector()) { if (riscv_v_setup_vsize()) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig -index 958a491fb..acb9d6f2a 100644 +index eb3551d42..552965f5e 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig -@@ -122,6 +122,7 @@ config X86 +@@ -123,6 +123,7 @@ config X86 select ARCH_USES_CFI_TRAPS if X86_64 && CFI_CLANG select ARCH_SUPPORTS_LTO_CLANG select ARCH_SUPPORTS_LTO_CLANG_THIN @@ -849,7 +848,7 @@ index 958a491fb..acb9d6f2a 100644 select ARCH_USE_BUILTIN_BSWAP select ARCH_USE_MEMTEST select ARCH_USE_QUEUED_RWLOCKS -@@ -278,6 +279,7 @@ config X86 +@@ -280,6 +281,7 @@ config X86 select HAVE_STATIC_CALL select HAVE_STATIC_CALL_INLINE if HAVE_OBJTOOL select HAVE_PREEMPT_DYNAMIC_CALL @@ -858,7 +857,7 @@ index 958a491fb..acb9d6f2a 100644 select HAVE_RUST if X86_64 select HAVE_SYSCALL_TRACEPOINTS diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h -index 971a05326..d176fa5d0 100644 +index 76e13733b..6c62c6852 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -85,8 +85,9 @@ struct thread_info { @@ -873,7 +872,7 @@ index 971a05326..d176fa5d0 100644 #define TIF_SPEC_IB 9 /* Indirect branch speculation mitigation */ #define TIF_SPEC_L1D_FLUSH 10 /* Flush L1D on mm switches (processes) */ #define TIF_USER_RETURN_NOTIFY 11 /* notify kernel of userspace return */ -@@ -108,6 +109,7 @@ struct thread_info { +@@ -109,6 +110,7 @@ struct thread_info { #define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME) #define _TIF_SIGPENDING (1 << TIF_SIGPENDING) #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED) @@ -882,7 +881,7 @@ index 971a05326..d176fa5d0 100644 #define _TIF_SSBD (1 << TIF_SSBD) #define _TIF_SPEC_IB (1 << TIF_SPEC_IB) diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c -index 831fa4a12..5af3ebec0 100644 +index ad3de5200..dce9898ee 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c @@ -107,7 +107,7 @@ static const struct dmi_system_id processor_power_dmi_table[] = { @@ -895,7 +894,7 @@ index 831fa4a12..5af3ebec0 100644 raw_local_irq_disable(); } diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c -index 1ffc53ff5..2594265e0 100644 +index 8a26614c0..687ec6d8e 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -57,6 +57,41 @@ static void zram_free_page(struct zram *zram, size_t index); @@ -948,7 +947,7 @@ index 1ffc53ff5..2594265e0 100644 static inline bool init_done(struct zram *zram) { -@@ -1242,6 +1278,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize) +@@ -1253,6 +1289,7 @@ static bool zram_meta_alloc(struct zram *zram, u64 disksize) if (!huge_class_size) huge_class_size = zs_huge_class_size(zram->mem_pool); @@ -1073,10 +1072,10 @@ index 172aa10a8..4ae472053 100644 + preempt_enable(); } diff --git a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c -index 94bf438c7..ef401cc81 100644 +index e0daa4e05..fdbb57fcb 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c -@@ -2141,9 +2141,17 @@ bool dcn20_validate_bandwidth(struct dc *dc, struct dc_state *context, +@@ -2142,9 +2142,17 @@ bool dcn20_validate_bandwidth(struct dc *dc, struct dc_state *context, bool fast_validate) { bool voltage_supported; @@ -1096,10 +1095,10 @@ index 94bf438c7..ef401cc81 100644 } diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c -index d1a25fe6c..5674c3450 100644 +index 24105a5b9..349c22dac 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c -@@ -953,9 +953,17 @@ static bool dcn21_validate_bandwidth(struct dc *dc, struct dc_state *context, +@@ -954,9 +954,17 @@ static bool dcn21_validate_bandwidth(struct dc *dc, struct dc_state *context, bool fast_validate) { bool voltage_supported; @@ -1712,7 +1711,7 @@ index 9afd5979c..db23b3a02 100644 return 0; diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c -index e561f21cd..594201fbc 100644 +index 679a74d9f..f2bda37e7 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -271,7 +271,7 @@ static void serial8250_backup_timeout(struct timer_list *t) @@ -1815,7 +1814,7 @@ index e561f21cd..594201fbc 100644 } /** -@@ -1209,9 +1249,9 @@ void serial8250_unregister_port(int line) +@@ -1212,9 +1252,9 @@ void serial8250_unregister_port(int line) if (uart->em485) { unsigned long flags; @@ -1828,7 +1827,7 @@ index e561f21cd..594201fbc 100644 uart_remove_one_port(&serial8250_reg, &uart->port); diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c -index 7fa665017..8b30ca8fd 100644 +index 62492cf10..fb85ef075 100644 --- a/drivers/tty/serial/8250/8250_dma.c +++ b/drivers/tty/serial/8250/8250_dma.c @@ -22,7 +22,7 @@ static void __dma_tx_complete(void *param) @@ -1868,7 +1867,7 @@ index 7fa665017..8b30ca8fd 100644 int serial8250_tx_dma(struct uart_8250_port *p) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c -index a1f2259cc..53c284bb2 100644 +index 72f9aab75..b8426ac63 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -263,20 +263,20 @@ static int dw8250_handle_irq(struct uart_port *p) @@ -1980,7 +1979,7 @@ index 28f9a2679..33699e86e 100644 if (tty_termios_baud_rate(termios)) tty_termios_encode_baud_rate(termios, baud, baud); diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c -index 4caecc352..d732ad6a7 100644 +index 9ed62bc7c..e687cd0da 100644 --- a/drivers/tty/serial/8250/8250_omap.c +++ b/drivers/tty/serial/8250/8250_omap.c @@ -405,7 +405,7 @@ static void omap_8250_set_termios(struct uart_port *port, @@ -2210,7 +2209,7 @@ index a3b25779d..53e238c8c 100644 mutex_unlock(&tport->mutex); } diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c -index 8099e6a26..510bb858f 100644 +index 350f8d1e6..5974e1198 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -557,6 +557,11 @@ static int serial8250_em485_init(struct uart_8250_port *p) @@ -2452,7 +2451,7 @@ index 8099e6a26..510bb858f 100644 serial8250_rpm_put(up); } -@@ -2214,7 +2231,7 @@ int serial8250_do_startup(struct uart_port *port) +@@ -2215,7 +2232,7 @@ int serial8250_do_startup(struct uart_port *port) * * Synchronize UART_IER access against the console. */ @@ -2461,7 +2460,7 @@ index 8099e6a26..510bb858f 100644 up->acr = 0; serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B); serial_port_out(port, UART_EFR, UART_EFR_ECB); -@@ -2224,7 +2241,7 @@ int serial8250_do_startup(struct uart_port *port) +@@ -2225,7 +2242,7 @@ int serial8250_do_startup(struct uart_port *port) serial_port_out(port, UART_LCR, UART_LCR_CONF_MODE_B); serial_port_out(port, UART_EFR, UART_EFR_ECB); serial_port_out(port, UART_LCR, 0); @@ -2470,7 +2469,7 @@ index 8099e6a26..510bb858f 100644 } if (port->type == PORT_DA830) { -@@ -2233,10 +2250,10 @@ int serial8250_do_startup(struct uart_port *port) +@@ -2234,10 +2251,10 @@ int serial8250_do_startup(struct uart_port *port) * * Synchronize UART_IER access against the console. */ @@ -2483,7 +2482,7 @@ index 8099e6a26..510bb858f 100644 mdelay(10); /* Enable Tx, Rx and free run mode */ -@@ -2350,7 +2367,7 @@ int serial8250_do_startup(struct uart_port *port) +@@ -2351,7 +2368,7 @@ int serial8250_do_startup(struct uart_port *port) * * Synchronize UART_IER access against the console. */ @@ -2492,7 +2491,7 @@ index 8099e6a26..510bb858f 100644 wait_for_xmitr(up, UART_LSR_THRE); serial_port_out_sync(port, UART_IER, UART_IER_THRI); -@@ -2362,7 +2379,7 @@ int serial8250_do_startup(struct uart_port *port) +@@ -2363,7 +2380,7 @@ int serial8250_do_startup(struct uart_port *port) iir = serial_port_in(port, UART_IIR); serial_port_out(port, UART_IER, 0); @@ -2501,15 +2500,15 @@ index 8099e6a26..510bb858f 100644 if (port->irqflags & IRQF_SHARED) enable_irq(port->irq); -@@ -2385,7 +2402,7 @@ int serial8250_do_startup(struct uart_port *port) +@@ -2384,7 +2401,7 @@ int serial8250_do_startup(struct uart_port *port) + /* + * Now, initialize the UART */ - serial_port_out(port, UART_LCR, UART_LCR_WLEN8); - - spin_lock_irqsave(&port->lock, flags); + uart_port_lock_irqsave(port, &flags); + serial_port_out(port, UART_LCR, UART_LCR_WLEN8); if (up->port.flags & UPF_FOURPORT) { if (!up->port.irq) - up->port.mctrl |= TIOCM_OUT1; @@ -2431,7 +2448,7 @@ int serial8250_do_startup(struct uart_port *port) } @@ -2549,7 +2548,7 @@ index 8099e6a26..510bb858f 100644 /* * Disable break condition and FIFOs -@@ -2757,14 +2774,14 @@ void serial8250_update_uartclk(struct uart_port *port, unsigned int uartclk) +@@ -2765,14 +2782,14 @@ void serial8250_update_uartclk(struct uart_port *port, unsigned int uartclk) quot = serial8250_get_divisor(port, baud, &frac); serial8250_rpm_get(up); @@ -2566,7 +2565,7 @@ index 8099e6a26..510bb858f 100644 serial8250_rpm_put(up); out_unlock: -@@ -2801,7 +2818,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2809,7 +2826,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, * Synchronize UART_IER access against the console. */ serial8250_rpm_get(up); @@ -2575,7 +2574,7 @@ index 8099e6a26..510bb858f 100644 up->lcr = cval; /* Save computed LCR */ -@@ -2904,7 +2921,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2912,7 +2929,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, serial_port_out(port, UART_FCR, up->fcr); /* set fcr */ } serial8250_set_mctrl(port, port->mctrl); @@ -2584,7 +2583,7 @@ index 8099e6a26..510bb858f 100644 serial8250_rpm_put(up); /* Don't rewrite B0 */ -@@ -2927,15 +2944,15 @@ void serial8250_do_set_ldisc(struct uart_port *port, struct ktermios *termios) +@@ -2935,15 +2952,15 @@ void serial8250_do_set_ldisc(struct uart_port *port, struct ktermios *termios) { if (termios->c_line == N_PPS) { port->flags |= UPF_HARDPPS_CD; @@ -2604,7 +2603,7 @@ index 8099e6a26..510bb858f 100644 } } } -@@ -3331,6 +3348,11 @@ static void serial8250_console_putchar(struct uart_port *port, unsigned char ch) +@@ -3340,6 +3357,11 @@ static void serial8250_console_putchar(struct uart_port *port, unsigned char ch) wait_for_xmitr(up, UART_LSR_THRE); serial_port_out(port, UART_TX, ch); @@ -2616,15 +2615,16 @@ index 8099e6a26..510bb858f 100644 } /* -@@ -3359,6 +3381,7 @@ static void serial8250_console_restore(struct uart_8250_port *up) - serial8250_out_MCR(up, up->mcr | UART_MCR_DTR | UART_MCR_RTS); +@@ -3377,7 +3399,7 @@ static void fifo_wait_for_lsr(struct uart_8250_port *up, unsigned int count) + return; + } } - +- +#ifdef CONFIG_SERIAL_8250_LEGACY_CONSOLE /* * Print a string to the serial port using the device FIFO * -@@ -3409,15 +3432,15 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, +@@ -3437,15 +3459,15 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, touch_nmi_watchdog(); if (oops_in_progress) @@ -2643,13 +2643,13 @@ index 8099e6a26..510bb858f 100644 /* check scratch reg to see if port powered off during system sleep */ if (up->canary && (up->canary != serial_port_in(port, UART_SCR))) { -@@ -3481,8 +3504,137 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, +@@ -3509,9 +3531,138 @@ void serial8250_console_write(struct uart_8250_port *up, const char *s, serial8250_modem_status(up); if (locked) - spin_unlock_irqrestore(&port->lock, flags); + uart_port_unlock_irqrestore(port, flags); - } ++} +#else +bool serial8250_console_write_thread(struct uart_8250_port *up, + struct nbcon_write_context *wctxt) @@ -2736,8 +2736,8 @@ index 8099e6a26..510bb858f 100644 + + /* Success if no handover/takeover and message fully printed. */ + return (nbcon_exit_unsafe(wctxt) && done); -+} -+ + } + +bool serial8250_console_write_atomic(struct uart_8250_port *up, + struct nbcon_write_context *wctxt) +{ @@ -2779,10 +2779,11 @@ index 8099e6a26..510bb858f 100644 + return nbcon_exit_unsafe(wctxt); +} +#endif /* CONFIG_SERIAL_8250_LEGACY_CONSOLE */ - ++ static unsigned int probe_baud(struct uart_port *port) { -@@ -3501,6 +3653,7 @@ static unsigned int probe_baud(struct uart_port *port) + unsigned char lcr, dll, dlm; +@@ -3529,6 +3680,7 @@ static unsigned int probe_baud(struct uart_port *port) int serial8250_console_setup(struct uart_port *port, char *options, bool probe) { @@ -2790,7 +2791,7 @@ index 8099e6a26..510bb858f 100644 int baud = 9600; int bits = 8; int parity = 'n'; -@@ -3510,6 +3663,8 @@ int serial8250_console_setup(struct uart_port *port, char *options, bool probe) +@@ -3538,6 +3690,8 @@ int serial8250_console_setup(struct uart_port *port, char *options, bool probe) if (!port->iobase && !port->membase) return -ENODEV; @@ -3052,303 +3053,6 @@ index b5a7404cb..eabbf8afc 100644 } } } -diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c -index 39fd89e8e..80ed063bd 100644 ---- a/drivers/tty/serial/amba-pl011.c -+++ b/drivers/tty/serial/amba-pl011.c -@@ -361,9 +361,9 @@ static int pl011_fifo_to_tty(struct uart_amba_port *uap) - flag = TTY_FRAME; - } - -- spin_unlock(&uap->port.lock); -+ uart_port_unlock(&uap->port); - sysrq = uart_handle_sysrq_char(&uap->port, ch & 255); -- spin_lock(&uap->port.lock); -+ uart_port_lock(&uap->port); - - if (!sysrq) - uart_insert_char(&uap->port, ch, UART011_DR_OE, ch, flag); -@@ -564,7 +564,7 @@ static void pl011_dma_tx_callback(void *data) - unsigned long flags; - u16 dmacr; - -- spin_lock_irqsave(&uap->port.lock, flags); -+ uart_port_lock_irqsave(&uap->port, &flags); - if (uap->dmatx.queued) - dma_unmap_single(dmatx->chan->device->dev, dmatx->dma, - dmatx->len, DMA_TO_DEVICE); -@@ -585,7 +585,7 @@ static void pl011_dma_tx_callback(void *data) - if (!(dmacr & UART011_TXDMAE) || uart_tx_stopped(&uap->port) || - uart_circ_empty(&uap->port.state->xmit)) { - uap->dmatx.queued = false; -- spin_unlock_irqrestore(&uap->port.lock, flags); -+ uart_port_unlock_irqrestore(&uap->port, flags); - return; - } - -@@ -596,7 +596,7 @@ static void pl011_dma_tx_callback(void *data) - */ - pl011_start_tx_pio(uap); - -- spin_unlock_irqrestore(&uap->port.lock, flags); -+ uart_port_unlock_irqrestore(&uap->port, flags); - } - - /* -@@ -1024,7 +1024,7 @@ static void pl011_dma_rx_callback(void *data) - * routine to flush out the secondary DMA buffer while - * we immediately trigger the next DMA job. - */ -- spin_lock_irq(&uap->port.lock); -+ uart_port_lock_irq(&uap->port); - /* - * Rx data can be taken by the UART interrupts during - * the DMA irq handler. So we check the residue here. -@@ -1040,7 +1040,7 @@ static void pl011_dma_rx_callback(void *data) - ret = pl011_dma_rx_trigger_dma(uap); - - pl011_dma_rx_chars(uap, pending, lastbuf, false); -- spin_unlock_irq(&uap->port.lock); -+ uart_port_unlock_irq(&uap->port); - /* - * Do this check after we picked the DMA chars so we don't - * get some IRQ immediately from RX. -@@ -1106,11 +1106,11 @@ static void pl011_dma_rx_poll(struct timer_list *t) - if (jiffies_to_msecs(jiffies - dmarx->last_jiffies) - > uap->dmarx.poll_timeout) { - -- spin_lock_irqsave(&uap->port.lock, flags); -+ uart_port_lock_irqsave(&uap->port, &flags); - pl011_dma_rx_stop(uap); - uap->im |= UART011_RXIM; - pl011_write(uap->im, uap, REG_IMSC); -- spin_unlock_irqrestore(&uap->port.lock, flags); -+ uart_port_unlock_irqrestore(&uap->port, flags); - - uap->dmarx.running = false; - dmaengine_terminate_all(rxchan); -@@ -1206,10 +1206,10 @@ static void pl011_dma_shutdown(struct uart_amba_port *uap) - while (pl011_read(uap, REG_FR) & uap->vendor->fr_busy) - cpu_relax(); - -- spin_lock_irq(&uap->port.lock); -+ uart_port_lock_irq(&uap->port); - uap->dmacr &= ~(UART011_DMAONERR | UART011_RXDMAE | UART011_TXDMAE); - pl011_write(uap->dmacr, uap, REG_DMACR); -- spin_unlock_irq(&uap->port.lock); -+ uart_port_unlock_irq(&uap->port); - - if (uap->using_tx_dma) { - /* In theory, this should already be done by pl011_dma_flush_buffer */ -@@ -1420,9 +1420,9 @@ static void pl011_throttle_rx(struct uart_port *port) - { - unsigned long flags; - -- spin_lock_irqsave(&port->lock, flags); -+ uart_port_lock_irqsave(port, &flags); - pl011_stop_rx(port); -- spin_unlock_irqrestore(&port->lock, flags); -+ uart_port_unlock_irqrestore(port, flags); - } - - static void pl011_enable_ms(struct uart_port *port) -@@ -1440,7 +1440,7 @@ __acquires(&uap->port.lock) - { - pl011_fifo_to_tty(uap); - -- spin_unlock(&uap->port.lock); -+ uart_port_unlock(&uap->port); - tty_flip_buffer_push(&uap->port.state->port); - /* - * If we were temporarily out of DMA mode for a while, -@@ -1465,7 +1465,7 @@ __acquires(&uap->port.lock) - #endif - } - } -- spin_lock(&uap->port.lock); -+ uart_port_lock(&uap->port); - } - - static bool pl011_tx_char(struct uart_amba_port *uap, unsigned char c, -@@ -1576,7 +1576,7 @@ static irqreturn_t pl011_int(int irq, void *dev_id) - unsigned int status, pass_counter = AMBA_ISR_PASS_LIMIT; - int handled = 0; - -- spin_lock_irqsave(&uap->port.lock, flags); -+ uart_port_lock_irqsave(&uap->port, &flags); - status = pl011_read(uap, REG_RIS) & uap->im; - if (status) { - do { -@@ -1606,7 +1606,7 @@ static irqreturn_t pl011_int(int irq, void *dev_id) - handled = 1; - } - -- spin_unlock_irqrestore(&uap->port.lock, flags); -+ uart_port_unlock_irqrestore(&uap->port, flags); - - return IRQ_RETVAL(handled); - } -@@ -1678,14 +1678,14 @@ static void pl011_break_ctl(struct uart_port *port, int break_state) - unsigned long flags; - unsigned int lcr_h; - -- spin_lock_irqsave(&uap->port.lock, flags); -+ uart_port_lock_irqsave(&uap->port, &flags); - lcr_h = pl011_read(uap, REG_LCRH_TX); - if (break_state == -1) - lcr_h |= UART01x_LCRH_BRK; - else - lcr_h &= ~UART01x_LCRH_BRK; - pl011_write(lcr_h, uap, REG_LCRH_TX); -- spin_unlock_irqrestore(&uap->port.lock, flags); -+ uart_port_unlock_irqrestore(&uap->port, flags); - } - - #ifdef CONFIG_CONSOLE_POLL -@@ -1824,7 +1824,7 @@ static void pl011_enable_interrupts(struct uart_amba_port *uap) - unsigned long flags; - unsigned int i; - -- spin_lock_irqsave(&uap->port.lock, flags); -+ uart_port_lock_irqsave(&uap->port, &flags); - - /* Clear out any spuriously appearing RX interrupts */ - pl011_write(UART011_RTIS | UART011_RXIS, uap, REG_ICR); -@@ -1846,7 +1846,7 @@ static void pl011_enable_interrupts(struct uart_amba_port *uap) - if (!pl011_dma_rx_running(uap)) - uap->im |= UART011_RXIM; - pl011_write(uap->im, uap, REG_IMSC); -- spin_unlock_irqrestore(&uap->port.lock, flags); -+ uart_port_unlock_irqrestore(&uap->port, flags); - } - - static void pl011_unthrottle_rx(struct uart_port *port) -@@ -1854,7 +1854,7 @@ static void pl011_unthrottle_rx(struct uart_port *port) - struct uart_amba_port *uap = container_of(port, struct uart_amba_port, port); - unsigned long flags; - -- spin_lock_irqsave(&uap->port.lock, flags); -+ uart_port_lock_irqsave(&uap->port, &flags); - - uap->im = UART011_RTIM; - if (!pl011_dma_rx_running(uap)) -@@ -1862,7 +1862,7 @@ static void pl011_unthrottle_rx(struct uart_port *port) - - pl011_write(uap->im, uap, REG_IMSC); - -- spin_unlock_irqrestore(&uap->port.lock, flags); -+ uart_port_unlock_irqrestore(&uap->port, flags); - } - - static int pl011_startup(struct uart_port *port) -@@ -1882,7 +1882,7 @@ static int pl011_startup(struct uart_port *port) - - pl011_write(uap->vendor->ifls, uap, REG_IFLS); - -- spin_lock_irq(&uap->port.lock); -+ uart_port_lock_irq(&uap->port); - - cr = pl011_read(uap, REG_CR); - cr &= UART011_CR_RTS | UART011_CR_DTR; -@@ -1893,7 +1893,7 @@ static int pl011_startup(struct uart_port *port) - - pl011_write(cr, uap, REG_CR); - -- spin_unlock_irq(&uap->port.lock); -+ uart_port_unlock_irq(&uap->port); - - /* - * initialise the old status of the modem signals -@@ -1954,12 +1954,12 @@ static void pl011_disable_uart(struct uart_amba_port *uap) - unsigned int cr; - - uap->port.status &= ~(UPSTAT_AUTOCTS | UPSTAT_AUTORTS); -- spin_lock_irq(&uap->port.lock); -+ uart_port_lock_irq(&uap->port); - cr = pl011_read(uap, REG_CR); - cr &= UART011_CR_RTS | UART011_CR_DTR; - cr |= UART01x_CR_UARTEN | UART011_CR_TXE; - pl011_write(cr, uap, REG_CR); -- spin_unlock_irq(&uap->port.lock); -+ uart_port_unlock_irq(&uap->port); - - /* - * disable break condition and fifos -@@ -1971,14 +1971,14 @@ static void pl011_disable_uart(struct uart_amba_port *uap) - - static void pl011_disable_interrupts(struct uart_amba_port *uap) - { -- spin_lock_irq(&uap->port.lock); -+ uart_port_lock_irq(&uap->port); - - /* mask all interrupts and clear all pending ones */ - uap->im = 0; - pl011_write(uap->im, uap, REG_IMSC); - pl011_write(0xffff, uap, REG_ICR); - -- spin_unlock_irq(&uap->port.lock); -+ uart_port_unlock_irq(&uap->port); - } - - static void pl011_shutdown(struct uart_port *port) -@@ -2123,7 +2123,7 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, - - bits = tty_get_frame_size(termios->c_cflag); - -- spin_lock_irqsave(&port->lock, flags); -+ uart_port_lock_irqsave(port, &flags); - - /* - * Update the per-port timeout. -@@ -2197,7 +2197,7 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios, - old_cr |= UART011_CR_RXE; - pl011_write(old_cr, uap, REG_CR); - -- spin_unlock_irqrestore(&port->lock, flags); -+ uart_port_unlock_irqrestore(port, flags); - } - - static void -@@ -2215,10 +2215,10 @@ sbsa_uart_set_termios(struct uart_port *port, struct ktermios *termios, - termios->c_cflag &= ~(CMSPAR | CRTSCTS); - termios->c_cflag |= CS8 | CLOCAL; - -- spin_lock_irqsave(&port->lock, flags); -+ uart_port_lock_irqsave(port, &flags); - uart_update_timeout(port, CS8, uap->fixed_baud); - pl011_setup_status_masks(port, termios); -- spin_unlock_irqrestore(&port->lock, flags); -+ uart_port_unlock_irqrestore(port, flags); - } - - static const char *pl011_type(struct uart_port *port) -@@ -2353,13 +2353,10 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) - - clk_enable(uap->clk); - -- local_irq_save(flags); -- if (uap->port.sysrq) -- locked = 0; -- else if (oops_in_progress) -- locked = spin_trylock(&uap->port.lock); -+ if (uap->port.sysrq || oops_in_progress) -+ locked = uart_port_trylock_irqsave(&uap->port, &flags); - else -- spin_lock(&uap->port.lock); -+ uart_port_lock_irqsave(&uap->port, &flags); - - /* - * First save the CR then disable the interrupts -@@ -2385,8 +2382,7 @@ pl011_console_write(struct console *co, const char *s, unsigned int count) - pl011_write(old_cr, uap, REG_CR); - - if (locked) -- spin_unlock(&uap->port.lock); -- local_irq_restore(flags); -+ uart_port_unlock_irqrestore(&uap->port, flags); - - clk_disable(uap->clk); - } diff --git a/drivers/tty/serial/apbuart.c b/drivers/tty/serial/apbuart.c index d3cb341f2..364599f25 100644 --- a/drivers/tty/serial/apbuart.c @@ -3559,7 +3263,7 @@ index ad4ae19b6..1aa5b2b49 100644 static struct console arc_console = { diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c -index bcca5627a..5a3f2fc47 100644 +index 85559d9b3..32954d797 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -861,7 +861,7 @@ static void atmel_complete_tx_dma(void *arg) @@ -4075,7 +3779,7 @@ index 249cb380c..7fa809a40 100644 /* diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c -index 8bd0f8e45..58c2c460c 100644 +index 70fa1e6ae..686bfb2cf 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -532,9 +532,9 @@ static void lpuart_dma_tx_complete(void *arg) @@ -4228,7 +3932,7 @@ index 8bd0f8e45..58c2c460c 100644 } } -@@ -1802,14 +1802,14 @@ static void lpuart_hw_setup(struct lpuart_port *sport) +@@ -1819,14 +1819,14 @@ static void lpuart_hw_setup(struct lpuart_port *sport) { unsigned long flags; @@ -4245,7 +3949,7 @@ index 8bd0f8e45..58c2c460c 100644 } static int lpuart_startup(struct uart_port *port) -@@ -1859,7 +1859,7 @@ static void lpuart32_hw_setup(struct lpuart_port *sport) +@@ -1876,7 +1876,7 @@ static void lpuart32_hw_setup(struct lpuart_port *sport) { unsigned long flags; @@ -4254,7 +3958,7 @@ index 8bd0f8e45..58c2c460c 100644 lpuart32_hw_disable(sport); -@@ -1869,7 +1869,7 @@ static void lpuart32_hw_setup(struct lpuart_port *sport) +@@ -1886,7 +1886,7 @@ static void lpuart32_hw_setup(struct lpuart_port *sport) lpuart32_setup_watermark_enable(sport); lpuart32_configure(sport); @@ -4263,7 +3967,7 @@ index 8bd0f8e45..58c2c460c 100644 } static int lpuart32_startup(struct uart_port *port) -@@ -1932,7 +1932,7 @@ static void lpuart_shutdown(struct uart_port *port) +@@ -1949,7 +1949,7 @@ static void lpuart_shutdown(struct uart_port *port) unsigned char temp; unsigned long flags; @@ -4272,7 +3976,7 @@ index 8bd0f8e45..58c2c460c 100644 /* disable Rx/Tx and interrupts */ temp = readb(port->membase + UARTCR2); -@@ -1940,7 +1940,7 @@ static void lpuart_shutdown(struct uart_port *port) +@@ -1957,7 +1957,7 @@ static void lpuart_shutdown(struct uart_port *port) UARTCR2_TIE | UARTCR2_TCIE | UARTCR2_RIE); writeb(temp, port->membase + UARTCR2); @@ -4281,7 +3985,7 @@ index 8bd0f8e45..58c2c460c 100644 lpuart_dma_shutdown(sport); } -@@ -1952,7 +1952,7 @@ static void lpuart32_shutdown(struct uart_port *port) +@@ -1969,7 +1969,7 @@ static void lpuart32_shutdown(struct uart_port *port) unsigned long temp; unsigned long flags; @@ -4290,7 +3994,7 @@ index 8bd0f8e45..58c2c460c 100644 /* clear status */ temp = lpuart32_read(&sport->port, UARTSTAT); -@@ -1969,7 +1969,7 @@ static void lpuart32_shutdown(struct uart_port *port) +@@ -1986,7 +1986,7 @@ static void lpuart32_shutdown(struct uart_port *port) UARTCTRL_TIE | UARTCTRL_TCIE | UARTCTRL_RIE | UARTCTRL_SBK); lpuart32_write(port, temp, UARTCTRL); @@ -4299,7 +4003,7 @@ index 8bd0f8e45..58c2c460c 100644 lpuart_dma_shutdown(sport); } -@@ -2069,7 +2069,7 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2086,7 +2086,7 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, if (old && sport->lpuart_dma_rx_use) lpuart_dma_rx_free(&sport->port); @@ -4308,7 +4012,7 @@ index 8bd0f8e45..58c2c460c 100644 sport->port.read_status_mask = 0; if (termios->c_iflag & INPCK) -@@ -2124,7 +2124,7 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2141,7 +2141,7 @@ lpuart_set_termios(struct uart_port *port, struct ktermios *termios, sport->lpuart_dma_rx_use = false; } @@ -4317,7 +4021,7 @@ index 8bd0f8e45..58c2c460c 100644 } static void __lpuart32_serial_setbrg(struct uart_port *port, -@@ -2304,7 +2304,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2321,7 +2321,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, if (old && sport->lpuart_dma_rx_use) lpuart_dma_rx_free(&sport->port); @@ -4326,7 +4030,7 @@ index 8bd0f8e45..58c2c460c 100644 sport->port.read_status_mask = 0; if (termios->c_iflag & INPCK) -@@ -2362,7 +2362,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2379,7 +2379,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, sport->lpuart_dma_rx_use = false; } @@ -4335,7 +4039,7 @@ index 8bd0f8e45..58c2c460c 100644 } static const char *lpuart_type(struct uart_port *port) -@@ -2480,9 +2480,9 @@ lpuart_console_write(struct console *co, const char *s, unsigned int count) +@@ -2497,9 +2497,9 @@ lpuart_console_write(struct console *co, const char *s, unsigned int count) int locked = 1; if (oops_in_progress) @@ -4347,7 +4051,7 @@ index 8bd0f8e45..58c2c460c 100644 /* first save CR2 and then disable interrupts */ cr2 = old_cr2 = readb(sport->port.membase + UARTCR2); -@@ -2498,7 +2498,7 @@ lpuart_console_write(struct console *co, const char *s, unsigned int count) +@@ -2515,7 +2515,7 @@ lpuart_console_write(struct console *co, const char *s, unsigned int count) writeb(old_cr2, sport->port.membase + UARTCR2); if (locked) @@ -4356,7 +4060,7 @@ index 8bd0f8e45..58c2c460c 100644 } static void -@@ -2510,9 +2510,9 @@ lpuart32_console_write(struct console *co, const char *s, unsigned int count) +@@ -2527,9 +2527,9 @@ lpuart32_console_write(struct console *co, const char *s, unsigned int count) int locked = 1; if (oops_in_progress) @@ -4368,7 +4072,7 @@ index 8bd0f8e45..58c2c460c 100644 /* first save CR2 and then disable interrupts */ cr = old_cr = lpuart32_read(&sport->port, UARTCTRL); -@@ -2528,7 +2528,7 @@ lpuart32_console_write(struct console *co, const char *s, unsigned int count) +@@ -2545,7 +2545,7 @@ lpuart32_console_write(struct console *co, const char *s, unsigned int count) lpuart32_write(&sport->port, old_cr, UARTCTRL); if (locked) @@ -4377,7 +4081,7 @@ index 8bd0f8e45..58c2c460c 100644 } /* -@@ -3093,7 +3093,7 @@ static int lpuart_suspend(struct device *dev) +@@ -3110,7 +3110,7 @@ static int lpuart_suspend(struct device *dev) uart_suspend_port(&lpuart_reg, &sport->port); if (lpuart_uport_is_active(sport)) { @@ -4386,7 +4090,7 @@ index 8bd0f8e45..58c2c460c 100644 if (lpuart_is_32(sport)) { /* disable Rx/Tx and interrupts */ temp = lpuart32_read(&sport->port, UARTCTRL); -@@ -3105,7 +3105,7 @@ static int lpuart_suspend(struct device *dev) +@@ -3122,7 +3122,7 @@ static int lpuart_suspend(struct device *dev) temp &= ~(UARTCR2_TE | UARTCR2_TIE | UARTCR2_TCIE); writeb(temp, sport->port.membase + UARTCR2); } @@ -4395,7 +4099,7 @@ index 8bd0f8e45..58c2c460c 100644 if (sport->lpuart_dma_rx_use) { /* -@@ -3118,7 +3118,7 @@ static int lpuart_suspend(struct device *dev) +@@ -3135,7 +3135,7 @@ static int lpuart_suspend(struct device *dev) lpuart_dma_rx_free(&sport->port); /* Disable Rx DMA to use UART port as wakeup source */ @@ -4404,7 +4108,7 @@ index 8bd0f8e45..58c2c460c 100644 if (lpuart_is_32(sport)) { temp = lpuart32_read(&sport->port, UARTBAUD); lpuart32_write(&sport->port, temp & ~UARTBAUD_RDMAE, -@@ -3127,11 +3127,11 @@ static int lpuart_suspend(struct device *dev) +@@ -3144,11 +3144,11 @@ static int lpuart_suspend(struct device *dev) writeb(readb(sport->port.membase + UARTCR5) & ~UARTCR5_RDMAS, sport->port.membase + UARTCR5); } @@ -4418,7 +4122,7 @@ index 8bd0f8e45..58c2c460c 100644 if (lpuart_is_32(sport)) { temp = lpuart32_read(&sport->port, UARTBAUD); temp &= ~UARTBAUD_TDMAE; -@@ -3141,7 +3141,7 @@ static int lpuart_suspend(struct device *dev) +@@ -3158,7 +3158,7 @@ static int lpuart_suspend(struct device *dev) temp &= ~UARTCR5_TDMAS; writeb(temp, sport->port.membase + UARTCR5); } @@ -4543,7 +4247,7 @@ index 819f957b6..a75eafbcb 100644 static const char *icom_type(struct uart_port *port) diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c -index a5d0df2ba..267c9af4b 100644 +index 04809b781..1a906c2f2 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -586,7 +586,7 @@ static void imx_uart_dma_tx_callback(void *data) @@ -4564,7 +4268,7 @@ index a5d0df2ba..267c9af4b 100644 } /* called with port.lock taken and irqs off */ -@@ -782,11 +782,11 @@ static irqreturn_t imx_uart_rtsint(int irq, void *dev_id) +@@ -797,11 +797,11 @@ static irqreturn_t imx_uart_rtsint(int irq, void *dev_id) struct imx_port *sport = dev_id; irqreturn_t ret; @@ -4578,7 +4282,7 @@ index a5d0df2ba..267c9af4b 100644 return ret; } -@@ -795,9 +795,9 @@ static irqreturn_t imx_uart_txint(int irq, void *dev_id) +@@ -810,9 +810,9 @@ static irqreturn_t imx_uart_txint(int irq, void *dev_id) { struct imx_port *sport = dev_id; @@ -4590,7 +4294,7 @@ index a5d0df2ba..267c9af4b 100644 return IRQ_HANDLED; } -@@ -911,11 +911,11 @@ static irqreturn_t imx_uart_rxint(int irq, void *dev_id) +@@ -926,11 +926,11 @@ static irqreturn_t imx_uart_rxint(int irq, void *dev_id) struct imx_port *sport = dev_id; irqreturn_t ret; @@ -4604,7 +4308,7 @@ index a5d0df2ba..267c9af4b 100644 return ret; } -@@ -978,7 +978,7 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id) +@@ -993,7 +993,7 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id) unsigned int usr1, usr2, ucr1, ucr2, ucr3, ucr4; irqreturn_t ret = IRQ_NONE; @@ -4613,7 +4317,7 @@ index a5d0df2ba..267c9af4b 100644 usr1 = imx_uart_readl(sport, USR1); usr2 = imx_uart_readl(sport, USR2); -@@ -1048,7 +1048,7 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id) +@@ -1063,7 +1063,7 @@ static irqreturn_t imx_uart_int(int irq, void *dev_id) ret = IRQ_HANDLED; } @@ -4622,7 +4326,7 @@ index a5d0df2ba..267c9af4b 100644 return ret; } -@@ -1131,7 +1131,7 @@ static void imx_uart_break_ctl(struct uart_port *port, int break_state) +@@ -1146,7 +1146,7 @@ static void imx_uart_break_ctl(struct uart_port *port, int break_state) unsigned long flags; u32 ucr1; @@ -4631,7 +4335,7 @@ index a5d0df2ba..267c9af4b 100644 ucr1 = imx_uart_readl(sport, UCR1) & ~UCR1_SNDBRK; -@@ -1140,7 +1140,7 @@ static void imx_uart_break_ctl(struct uart_port *port, int break_state) +@@ -1155,7 +1155,7 @@ static void imx_uart_break_ctl(struct uart_port *port, int break_state) imx_uart_writel(sport, ucr1, UCR1); @@ -4640,7 +4344,7 @@ index a5d0df2ba..267c9af4b 100644 } /* -@@ -1153,9 +1153,9 @@ static void imx_uart_timeout(struct timer_list *t) +@@ -1168,9 +1168,9 @@ static void imx_uart_timeout(struct timer_list *t) unsigned long flags; if (sport->port.state) { @@ -4652,7 +4356,7 @@ index a5d0df2ba..267c9af4b 100644 mod_timer(&sport->timer, jiffies + MCTRL_TIMEOUT); } -@@ -1185,9 +1185,9 @@ static void imx_uart_dma_rx_callback(void *data) +@@ -1200,9 +1200,9 @@ static void imx_uart_dma_rx_callback(void *data) status = dmaengine_tx_status(chan, sport->rx_cookie, &state); if (status == DMA_ERROR) { @@ -4664,7 +4368,7 @@ index a5d0df2ba..267c9af4b 100644 return; } -@@ -1216,9 +1216,9 @@ static void imx_uart_dma_rx_callback(void *data) +@@ -1231,9 +1231,9 @@ static void imx_uart_dma_rx_callback(void *data) r_bytes = rx_ring->head - rx_ring->tail; /* If we received something, check for 0xff flood */ @@ -4676,7 +4380,7 @@ index a5d0df2ba..267c9af4b 100644 if (!(sport->port.ignore_status_mask & URXD_DUMMY_READ)) { -@@ -1476,7 +1476,7 @@ static int imx_uart_startup(struct uart_port *port) +@@ -1491,7 +1491,7 @@ static int imx_uart_startup(struct uart_port *port) if (!uart_console(port) && imx_uart_dma_init(sport) == 0) dma_is_inited = 1; @@ -4685,7 +4389,7 @@ index a5d0df2ba..267c9af4b 100644 /* Reset fifo's and state machines */ imx_uart_soft_reset(sport); -@@ -1549,7 +1549,7 @@ static int imx_uart_startup(struct uart_port *port) +@@ -1564,7 +1564,7 @@ static int imx_uart_startup(struct uart_port *port) imx_uart_disable_loopback_rs485(sport); @@ -4694,7 +4398,7 @@ index a5d0df2ba..267c9af4b 100644 return 0; } -@@ -1574,21 +1574,21 @@ static void imx_uart_shutdown(struct uart_port *port) +@@ -1589,21 +1589,21 @@ static void imx_uart_shutdown(struct uart_port *port) sport->dma_is_rxing = 0; } @@ -4708,7 +4412,7 @@ index a5d0df2ba..267c9af4b 100644 imx_uart_dma_exit(sport); } - mctrl_gpio_disable_ms(sport->gpios); + mctrl_gpio_disable_ms_sync(sport->gpios); - spin_lock_irqsave(&sport->port.lock, flags); + uart_port_lock_irqsave(&sport->port, &flags); @@ -4720,7 +4424,7 @@ index a5d0df2ba..267c9af4b 100644 /* * Stop our timer. -@@ -1599,7 +1599,7 @@ static void imx_uart_shutdown(struct uart_port *port) +@@ -1614,7 +1614,7 @@ static void imx_uart_shutdown(struct uart_port *port) * Disable all interrupts, port and break condition. */ @@ -4729,7 +4433,7 @@ index a5d0df2ba..267c9af4b 100644 ucr1 = imx_uart_readl(sport, UCR1); ucr1 &= ~(UCR1_TRDYEN | UCR1_RRDYEN | UCR1_RTSDEN | UCR1_RXDMAEN | -@@ -1621,7 +1621,7 @@ static void imx_uart_shutdown(struct uart_port *port) +@@ -1636,7 +1636,7 @@ static void imx_uart_shutdown(struct uart_port *port) ucr4 &= ~UCR4_TCEN; imx_uart_writel(sport, ucr4, UCR4); @@ -4738,7 +4442,7 @@ index a5d0df2ba..267c9af4b 100644 clk_disable_unprepare(sport->clk_per); clk_disable_unprepare(sport->clk_ipg); -@@ -1684,7 +1684,7 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -1699,7 +1699,7 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios, baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 16); quot = uart_get_divisor(port, baud); @@ -4747,7 +4451,7 @@ index a5d0df2ba..267c9af4b 100644 /* * Read current UCR2 and save it for future use, then clear all the bits -@@ -1812,7 +1812,7 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -1827,7 +1827,7 @@ imx_uart_set_termios(struct uart_port *port, struct ktermios *termios, if (UART_ENABLE_MS(&sport->port, termios->c_cflag)) imx_uart_enable_ms(&sport->port); @@ -4756,7 +4460,7 @@ index a5d0df2ba..267c9af4b 100644 } static const char *imx_uart_type(struct uart_port *port) -@@ -1874,7 +1874,7 @@ static int imx_uart_poll_init(struct uart_port *port) +@@ -1889,7 +1889,7 @@ static int imx_uart_poll_init(struct uart_port *port) imx_uart_setup_ufcr(sport, TXTL_DEFAULT, RXTL_DEFAULT); @@ -4765,7 +4469,7 @@ index a5d0df2ba..267c9af4b 100644 /* * Be careful about the order of enabling bits here. First enable the -@@ -1902,7 +1902,7 @@ static int imx_uart_poll_init(struct uart_port *port) +@@ -1917,7 +1917,7 @@ static int imx_uart_poll_init(struct uart_port *port) imx_uart_writel(sport, ucr1 | UCR1_RRDYEN, UCR1); imx_uart_writel(sport, ucr2 | UCR2_ATEN, UCR2); @@ -4774,7 +4478,7 @@ index a5d0df2ba..267c9af4b 100644 return 0; } -@@ -2022,9 +2022,9 @@ imx_uart_console_write(struct console *co, const char *s, unsigned int count) +@@ -2037,9 +2037,9 @@ imx_uart_console_write(struct console *co, const char *s, unsigned int count) if (sport->port.sysrq) locked = 0; else if (oops_in_progress) @@ -4786,7 +4490,7 @@ index a5d0df2ba..267c9af4b 100644 /* * First, save UCR1/2/3 and then disable interrupts -@@ -2052,7 +2052,7 @@ imx_uart_console_write(struct console *co, const char *s, unsigned int count) +@@ -2067,7 +2067,7 @@ imx_uart_console_write(struct console *co, const char *s, unsigned int count) imx_uart_ucrs_restore(sport, &old_ucr); if (locked) @@ -4795,7 +4499,7 @@ index a5d0df2ba..267c9af4b 100644 } /* -@@ -2210,10 +2210,10 @@ static enum hrtimer_restart imx_trigger_start_tx(struct hrtimer *t) +@@ -2225,10 +2225,10 @@ static enum hrtimer_restart imx_trigger_start_tx(struct hrtimer *t) struct imx_port *sport = container_of(t, struct imx_port, trigger_start_tx); unsigned long flags; @@ -4808,7 +4512,7 @@ index a5d0df2ba..267c9af4b 100644 return HRTIMER_NORESTART; } -@@ -2223,10 +2223,10 @@ static enum hrtimer_restart imx_trigger_stop_tx(struct hrtimer *t) +@@ -2238,10 +2238,10 @@ static enum hrtimer_restart imx_trigger_stop_tx(struct hrtimer *t) struct imx_port *sport = container_of(t, struct imx_port, trigger_stop_tx); unsigned long flags; @@ -4821,7 +4525,7 @@ index a5d0df2ba..267c9af4b 100644 return HRTIMER_NORESTART; } -@@ -2493,9 +2493,9 @@ static void imx_uart_restore_context(struct imx_port *sport) +@@ -2508,9 +2508,9 @@ static void imx_uart_restore_context(struct imx_port *sport) { unsigned long flags; @@ -4833,7 +4537,7 @@ index a5d0df2ba..267c9af4b 100644 return; } -@@ -2510,7 +2510,7 @@ static void imx_uart_restore_context(struct imx_port *sport) +@@ -2525,7 +2525,7 @@ static void imx_uart_restore_context(struct imx_port *sport) imx_uart_writel(sport, sport->saved_reg[2], UCR3); imx_uart_writel(sport, sport->saved_reg[3], UCR4); sport->context_saved = false; @@ -4842,7 +4546,7 @@ index a5d0df2ba..267c9af4b 100644 } static void imx_uart_save_context(struct imx_port *sport) -@@ -2518,7 +2518,7 @@ static void imx_uart_save_context(struct imx_port *sport) +@@ -2533,7 +2533,7 @@ static void imx_uart_save_context(struct imx_port *sport) unsigned long flags; /* Save necessary regs */ @@ -4851,7 +4555,7 @@ index a5d0df2ba..267c9af4b 100644 sport->saved_reg[0] = imx_uart_readl(sport, UCR1); sport->saved_reg[1] = imx_uart_readl(sport, UCR2); sport->saved_reg[2] = imx_uart_readl(sport, UCR3); -@@ -2530,7 +2530,7 @@ static void imx_uart_save_context(struct imx_port *sport) +@@ -2545,7 +2545,7 @@ static void imx_uart_save_context(struct imx_port *sport) sport->saved_reg[8] = imx_uart_readl(sport, UBMR); sport->saved_reg[9] = imx_uart_readl(sport, IMX21_UTS); sport->context_saved = true; @@ -5026,7 +4730,7 @@ index 0c78f6627..2bd640428 100644 } diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c -index 222afc270..ce0fef7e2 100644 +index 1bee624bd..be2f13069 100644 --- a/drivers/tty/serial/jsm/jsm_tty.c +++ b/drivers/tty/serial/jsm/jsm_tty.c @@ -152,14 +152,14 @@ static void jsm_tty_send_xchar(struct uart_port *port, char ch) @@ -5627,7 +5331,7 @@ index 9388b9dde..4c1d2089a 100644 } diff --git a/drivers/tty/serial/milbeaut_usio.c b/drivers/tty/serial/milbeaut_usio.c -index 70a910085..db3b81f2a 100644 +index 9de3883a4..cd789c99e 100644 --- a/drivers/tty/serial/milbeaut_usio.c +++ b/drivers/tty/serial/milbeaut_usio.c @@ -207,9 +207,9 @@ static irqreturn_t mlb_usio_rx_irq(int irq, void *dev_id) @@ -5812,7 +5516,7 @@ index ea5a7911c..2a4c09f3a 100644 if (tty_termios_baud_rate(termios)) tty_termios_encode_baud_rate(termios, baud, baud); diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c -index 90953e679..597264b54 100644 +index 76b6429fb..2dfc7bc80 100644 --- a/drivers/tty/serial/msm_serial.c +++ b/drivers/tty/serial/msm_serial.c @@ -444,7 +444,7 @@ static void msm_complete_tx_dma(void *args) @@ -6729,10 +6433,10 @@ index 73c60f5ea..46e70e155 100644 clk_disable(up->clk); diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c -index f798ef3c4..b808c1768 100644 +index f820a09cb..a7db08431 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c -@@ -473,9 +473,9 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s, +@@ -492,9 +492,9 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s, uport = &port->uport; if (oops_in_progress) @@ -6744,7 +6448,7 @@ index f798ef3c4..b808c1768 100644 geni_status = readl(uport->membase + SE_GENI_STATUS); -@@ -511,7 +511,7 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s, +@@ -530,7 +530,7 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s, qcom_geni_serial_setup_tx(uport, port->tx_remaining); if (locked) @@ -6753,7 +6457,7 @@ index f798ef3c4..b808c1768 100644 } static void handle_rx_console(struct uart_port *uport, u32 bytes, bool drop) -@@ -963,7 +963,7 @@ static irqreturn_t qcom_geni_serial_isr(int isr, void *dev) +@@ -992,7 +992,7 @@ static irqreturn_t qcom_geni_serial_isr(int isr, void *dev) if (uport->suspended) return IRQ_NONE; @@ -7321,7 +7025,7 @@ index f3cd69346..dbec29d9a 100644 static int __init sbd_console_setup(struct console *co, char *options) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c -index df6023dda..1468c35bd 100644 +index 2879b764e..cc89c7bc9 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -812,6 +812,7 @@ static void sc16is7xx_tx_proc(struct kthread_work *ws) @@ -7484,7 +7188,7 @@ index d4ec943cb..6d4006b41 100644 static const char *tegra_uart_type(struct uart_port *u) diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c -index 8ff0efac6..398104760 100644 +index 77ff27268..8c0b29ff9 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -79,7 +79,7 @@ static inline void uart_port_deref(struct uart_port *uport) @@ -7799,7 +7503,7 @@ index 8ff0efac6..398104760 100644 uart_rs485_config(port); diff --git a/drivers/tty/serial/serial_mctrl_gpio.c b/drivers/tty/serial/serial_mctrl_gpio.c -index 7d5aaa8d4..e51ca593a 100644 +index d5fb293dd..e9e166045 100644 --- a/drivers/tty/serial/serial_mctrl_gpio.c +++ b/drivers/tty/serial/serial_mctrl_gpio.c @@ -184,7 +184,7 @@ static irqreturn_t mctrl_gpio_irq_handle(int irq, void *context) @@ -7940,10 +7644,10 @@ index be08fb6f7..eaa980722 100644 static void diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c -index f793624fd..2559c9781 100644 +index 2434eb6e6..4f8f7235d 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c -@@ -1205,7 +1205,7 @@ static void sci_dma_tx_complete(void *arg) +@@ -1206,7 +1206,7 @@ static void sci_dma_tx_complete(void *arg) dev_dbg(port->dev, "%s(%d)\n", __func__, port->line); @@ -7952,7 +7656,7 @@ index f793624fd..2559c9781 100644 uart_xmit_advance(port, s->tx_dma_len); -@@ -1229,7 +1229,7 @@ static void sci_dma_tx_complete(void *arg) +@@ -1230,7 +1230,7 @@ static void sci_dma_tx_complete(void *arg) } } @@ -7961,7 +7665,7 @@ index f793624fd..2559c9781 100644 } /* Locking: called with port lock held */ -@@ -1325,7 +1325,7 @@ static void sci_dma_rx_complete(void *arg) +@@ -1326,7 +1326,7 @@ static void sci_dma_rx_complete(void *arg) dev_dbg(port->dev, "%s(%d) active cookie %d\n", __func__, port->line, s->active_rx); @@ -7970,7 +7674,7 @@ index f793624fd..2559c9781 100644 active = sci_dma_rx_find_active(s); if (active >= 0) -@@ -1352,20 +1352,20 @@ static void sci_dma_rx_complete(void *arg) +@@ -1353,20 +1353,20 @@ static void sci_dma_rx_complete(void *arg) dma_async_issue_pending(chan); @@ -7995,7 +7699,7 @@ index f793624fd..2559c9781 100644 } static void sci_dma_tx_release(struct sci_port *s) -@@ -1414,13 +1414,13 @@ static int sci_dma_rx_submit(struct sci_port *s, bool port_lock_held) +@@ -1415,13 +1415,13 @@ static int sci_dma_rx_submit(struct sci_port *s, bool port_lock_held) fail: /* Switch to PIO */ if (!port_lock_held) @@ -8011,7 +7715,7 @@ index f793624fd..2559c9781 100644 return -EAGAIN; } -@@ -1442,14 +1442,14 @@ static void sci_dma_tx_work_fn(struct work_struct *work) +@@ -1443,14 +1443,14 @@ static void sci_dma_tx_work_fn(struct work_struct *work) * transmit till the end, and then the rest. Take the port lock to get a * consistent xmit buffer state. */ @@ -8028,7 +7732,7 @@ index f793624fd..2559c9781 100644 return; } -@@ -1457,7 +1457,7 @@ static void sci_dma_tx_work_fn(struct work_struct *work) +@@ -1458,7 +1458,7 @@ static void sci_dma_tx_work_fn(struct work_struct *work) DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); if (!desc) { @@ -8037,7 +7741,7 @@ index f793624fd..2559c9781 100644 dev_warn(port->dev, "Failed preparing Tx DMA descriptor\n"); goto switch_to_pio; } -@@ -1469,12 +1469,12 @@ static void sci_dma_tx_work_fn(struct work_struct *work) +@@ -1470,12 +1470,12 @@ static void sci_dma_tx_work_fn(struct work_struct *work) desc->callback_param = s; s->cookie_tx = dmaengine_submit(desc); if (dma_submit_error(s->cookie_tx)) { @@ -8052,7 +7756,7 @@ index f793624fd..2559c9781 100644 dev_dbg(port->dev, "%s: %p: %d...%d, cookie %d\n", __func__, xmit->buf, tail, head, s->cookie_tx); -@@ -1482,10 +1482,10 @@ static void sci_dma_tx_work_fn(struct work_struct *work) +@@ -1483,10 +1483,10 @@ static void sci_dma_tx_work_fn(struct work_struct *work) return; switch_to_pio: @@ -8065,7 +7769,7 @@ index f793624fd..2559c9781 100644 return; } -@@ -1502,17 +1502,17 @@ static enum hrtimer_restart sci_dma_rx_timer_fn(struct hrtimer *t) +@@ -1503,17 +1503,17 @@ static enum hrtimer_restart sci_dma_rx_timer_fn(struct hrtimer *t) dev_dbg(port->dev, "DMA Rx timed out\n"); @@ -8086,7 +7790,7 @@ index f793624fd..2559c9781 100644 dev_dbg(port->dev, "Cookie %d #%d has already completed\n", s->active_rx, active); -@@ -1530,7 +1530,7 @@ static enum hrtimer_restart sci_dma_rx_timer_fn(struct hrtimer *t) +@@ -1531,7 +1531,7 @@ static enum hrtimer_restart sci_dma_rx_timer_fn(struct hrtimer *t) */ status = dmaengine_tx_status(s->chan_rx, s->active_rx, &state); if (status == DMA_COMPLETE) { @@ -8095,7 +7799,7 @@ index f793624fd..2559c9781 100644 dev_dbg(port->dev, "Transaction complete after DMA engine was stopped"); return HRTIMER_NORESTART; } -@@ -1551,7 +1551,7 @@ static enum hrtimer_restart sci_dma_rx_timer_fn(struct hrtimer *t) +@@ -1552,7 +1552,7 @@ static enum hrtimer_restart sci_dma_rx_timer_fn(struct hrtimer *t) sci_dma_rx_reenable_irq(s); @@ -8104,7 +7808,7 @@ index f793624fd..2559c9781 100644 return HRTIMER_NORESTART; } -@@ -1775,9 +1775,9 @@ static irqreturn_t sci_tx_interrupt(int irq, void *ptr) +@@ -1776,9 +1776,9 @@ static irqreturn_t sci_tx_interrupt(int irq, void *ptr) struct uart_port *port = ptr; unsigned long flags; @@ -8116,7 +7820,7 @@ index f793624fd..2559c9781 100644 return IRQ_HANDLED; } -@@ -1791,11 +1791,11 @@ static irqreturn_t sci_tx_end_interrupt(int irq, void *ptr) +@@ -1792,11 +1792,11 @@ static irqreturn_t sci_tx_end_interrupt(int irq, void *ptr) if (port->type != PORT_SCI) return sci_tx_interrupt(irq, ptr); @@ -8130,7 +7834,7 @@ index f793624fd..2559c9781 100644 return IRQ_HANDLED; } -@@ -2192,7 +2192,7 @@ static void sci_break_ctl(struct uart_port *port, int break_state) +@@ -2193,7 +2193,7 @@ static void sci_break_ctl(struct uart_port *port, int break_state) return; } @@ -8139,7 +7843,7 @@ index f793624fd..2559c9781 100644 scsptr = serial_port_in(port, SCSPTR); scscr = serial_port_in(port, SCSCR); -@@ -2206,7 +2206,7 @@ static void sci_break_ctl(struct uart_port *port, int break_state) +@@ -2207,7 +2207,7 @@ static void sci_break_ctl(struct uart_port *port, int break_state) serial_port_out(port, SCSPTR, scsptr); serial_port_out(port, SCSCR, scscr); @@ -8148,16 +7852,16 @@ index f793624fd..2559c9781 100644 } static int sci_startup(struct uart_port *port) -@@ -2238,7 +2238,7 @@ static void sci_shutdown(struct uart_port *port) +@@ -2239,7 +2239,7 @@ static void sci_shutdown(struct uart_port *port) s->autorts = false; - mctrl_gpio_disable_ms(to_sci_port(port)->gpios); + mctrl_gpio_disable_ms_sync(to_sci_port(port)->gpios); - spin_lock_irqsave(&port->lock, flags); + uart_port_lock_irqsave(port, &flags); sci_stop_rx(port); sci_stop_tx(port); /* -@@ -2248,7 +2248,7 @@ static void sci_shutdown(struct uart_port *port) +@@ -2249,7 +2249,7 @@ static void sci_shutdown(struct uart_port *port) scr = serial_port_in(port, SCSCR); serial_port_out(port, SCSCR, scr & (SCSCR_CKE1 | SCSCR_CKE0 | s->hscif_tot)); @@ -8166,7 +7870,7 @@ index f793624fd..2559c9781 100644 #ifdef CONFIG_SERIAL_SH_SCI_DMA if (s->chan_rx_saved) { -@@ -2550,7 +2550,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2551,7 +2551,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, serial_port_out(port, SCCKS, sccks); } @@ -8175,7 +7879,7 @@ index f793624fd..2559c9781 100644 sci_reset(port); -@@ -2672,7 +2672,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, +@@ -2673,7 +2673,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios, if ((termios->c_cflag & CREAD) != 0) sci_start_rx(port); @@ -8184,7 +7888,7 @@ index f793624fd..2559c9781 100644 sci_port_disable(s); -@@ -3057,9 +3057,9 @@ static void serial_console_write(struct console *co, const char *s, +@@ -3058,9 +3058,9 @@ static void serial_console_write(struct console *co, const char *s, if (port->sysrq) locked = 0; else if (oops_in_progress) @@ -8196,7 +7900,7 @@ index f793624fd..2559c9781 100644 /* first save SCSCR then disable interrupts, keep clock source */ ctrl = serial_port_in(port, SCSCR); -@@ -3079,7 +3079,7 @@ static void serial_console_write(struct console *co, const char *s, +@@ -3080,7 +3080,7 @@ static void serial_console_write(struct console *co, const char *s, serial_port_out(port, SCSCR, ctrl); if (locked) @@ -8206,7 +7910,7 @@ index f793624fd..2559c9781 100644 static int serial_console_setup(struct console *co, char *options) diff --git a/drivers/tty/serial/sifive.c b/drivers/tty/serial/sifive.c -index d195c5de5..b296e57a9 100644 +index e86b00873..fea6b999b 100644 --- a/drivers/tty/serial/sifive.c +++ b/drivers/tty/serial/sifive.c @@ -521,11 +521,11 @@ static irqreturn_t sifive_serial_irq(int irq, void *dev_id) @@ -8232,7 +7936,7 @@ index d195c5de5..b296e57a9 100644 return IRQ_HANDLED; } -@@ -653,7 +653,7 @@ static void sifive_serial_set_termios(struct uart_port *port, +@@ -659,7 +659,7 @@ static void sifive_serial_set_termios(struct uart_port *port, ssp->port.uartclk / 16); __ssp_update_baud_rate(ssp, rate); @@ -8241,7 +7945,7 @@ index d195c5de5..b296e57a9 100644 /* Update the per-port timeout */ uart_update_timeout(port, termios->c_cflag, rate); -@@ -670,7 +670,7 @@ static void sifive_serial_set_termios(struct uart_port *port, +@@ -676,7 +676,7 @@ static void sifive_serial_set_termios(struct uart_port *port, if (v != old_v) __ssp_writel(v, SIFIVE_SERIAL_RXCTRL_OFFS, ssp); @@ -8250,7 +7954,7 @@ index d195c5de5..b296e57a9 100644 } static void sifive_serial_release_port(struct uart_port *port) -@@ -795,9 +795,9 @@ static void sifive_serial_console_write(struct console *co, const char *s, +@@ -801,9 +801,9 @@ static void sifive_serial_console_write(struct console *co, const char *s, if (ssp->port.sysrq) locked = 0; else if (oops_in_progress) @@ -8262,7 +7966,7 @@ index d195c5de5..b296e57a9 100644 ier = __ssp_readl(ssp, SIFIVE_SERIAL_IE_OFFS); __ssp_writel(0, SIFIVE_SERIAL_IE_OFFS, ssp); -@@ -807,7 +807,7 @@ static void sifive_serial_console_write(struct console *co, const char *s, +@@ -813,7 +813,7 @@ static void sifive_serial_console_write(struct console *co, const char *s, __ssp_writel(ier, SIFIVE_SERIAL_IE_OFFS, ssp); if (locked) @@ -8472,7 +8176,7 @@ index 92b9f6894..a821f5d76 100644 static int asc_console_setup(struct console *co, char *options) diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c -index 9ef90bb30..b963f9ccb 100644 +index b58422ae1..0eebd06fa 100644 --- a/drivers/tty/serial/stm32-usart.c +++ b/drivers/tty/serial/stm32-usart.c @@ -535,7 +535,7 @@ static void stm32_usart_rx_dma_complete(void *arg) @@ -9377,7 +9081,7 @@ index 0859394a7..0cc6524f5 100644 static const char *timbuart_type(struct uart_port *port) diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c -index b225a78f6..404c14aca 100644 +index 9f39bafa7..9ffe82235 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -216,11 +216,11 @@ static irqreturn_t ulite_isr(int irq, void *dev_id) @@ -9508,7 +9212,7 @@ index c5d5c2765..78a1c1eea 100644 static const char *vt8500_type(struct uart_port *port) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c -index 2e5e86a00..9c13dac1d 100644 +index 7f83d2780..84652f530 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -346,7 +346,7 @@ static irqreturn_t cdns_uart_isr(int irq, void *dev_id) @@ -9520,15 +9224,6 @@ index 2e5e86a00..9c13dac1d 100644 /* Read the interrupt status register to determine which * interrupt(s) is/are active and clear them. -@@ -369,7 +369,7 @@ static irqreturn_t cdns_uart_isr(int irq, void *dev_id) - !(readl(port->membase + CDNS_UART_CR) & CDNS_UART_CR_RX_DIS)) - cdns_uart_handle_rx(dev_id, isrstatus); - -- spin_unlock(&port->lock); -+ uart_port_unlock(port); - return IRQ_HANDLED; - } - @@ -506,14 +506,14 @@ static int cdns_uart_clk_notifier_cb(struct notifier_block *nb, return NOTIFY_BAD; } @@ -9681,19 +9376,16 @@ index 2e5e86a00..9c13dac1d 100644 } #endif -@@ -1232,9 +1232,9 @@ static void cdns_uart_console_write(struct console *co, const char *s, - if (port->sysrq) - locked = 0; - else if (oops_in_progress) -- locked = spin_trylock_irqsave(&port->lock, flags); -+ locked = uart_port_trylock_irqsave(port, &flags); +@@ -1232,7 +1232,7 @@ static void cdns_uart_console_write(struct console *co, const char *s, + if (oops_in_progress) + locked = uart_port_trylock_irqsave(port, &flags); else - spin_lock_irqsave(&port->lock, flags); + uart_port_lock_irqsave(port, &flags); /* save and disable interrupt */ imr = readl(port->membase + CDNS_UART_IMR); -@@ -1257,7 +1257,7 @@ static void cdns_uart_console_write(struct console *co, const char *s, +@@ -1255,7 +1255,7 @@ static void cdns_uart_console_write(struct console *co, const char *s, writel(imr, port->membase + CDNS_UART_IER); if (locked) @@ -9702,7 +9394,7 @@ index 2e5e86a00..9c13dac1d 100644 } /** -@@ -1325,7 +1325,7 @@ static int cdns_uart_suspend(struct device *device) +@@ -1323,7 +1323,7 @@ static int cdns_uart_suspend(struct device *device) if (console_suspend_enabled && uart_console(port) && may_wake) { unsigned long flags; @@ -9711,7 +9403,7 @@ index 2e5e86a00..9c13dac1d 100644 /* Empty the receive FIFO 1st before making changes */ while (!(readl(port->membase + CDNS_UART_SR) & CDNS_UART_SR_RXEMPTY)) -@@ -1334,7 +1334,7 @@ static int cdns_uart_suspend(struct device *device) +@@ -1332,7 +1332,7 @@ static int cdns_uart_suspend(struct device *device) writel(1, port->membase + CDNS_UART_RXWM); /* disable RX timeout interrups */ writel(CDNS_UART_IXR_TOUT, port->membase + CDNS_UART_IDR); @@ -9720,7 +9412,7 @@ index 2e5e86a00..9c13dac1d 100644 } /* -@@ -1372,7 +1372,7 @@ static int cdns_uart_resume(struct device *device) +@@ -1370,7 +1370,7 @@ static int cdns_uart_resume(struct device *device) return ret; } @@ -9729,7 +9421,7 @@ index 2e5e86a00..9c13dac1d 100644 /* Set TX/RX Reset */ ctrl_reg = readl(port->membase + CDNS_UART_CR); -@@ -1392,14 +1392,14 @@ static int cdns_uart_resume(struct device *device) +@@ -1390,14 +1390,14 @@ static int cdns_uart_resume(struct device *device) clk_disable(cdns_uart->uartclk); clk_disable(cdns_uart->pclk); @@ -9748,7 +9440,7 @@ index 2e5e86a00..9c13dac1d 100644 return uart_resume_port(cdns_uart->cdns_uart_driver, port); diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c -index 493fc4742..afa52883c 100644 +index 117abcf36..03e2eaf24 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -3543,8 +3543,15 @@ static ssize_t show_cons_active(struct device *dev, @@ -10046,7 +9738,7 @@ index 6813171af..674a622c9 100644 struct kvm_vcpu; diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h -index 9aac2ab15..6b9c8a16e 100644 +index a83fd31cc..c4d4c1f49 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h @@ -613,6 +613,35 @@ extern void __raise_softirq_irqoff(unsigned int nr); @@ -10086,10 +9778,10 @@ index 9aac2ab15..6b9c8a16e 100644 static inline struct task_struct *this_cpu_ksoftirqd(void) diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h -index 98b58ae88..974816e66 100644 +index a8f0fba3e..7e9443764 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h -@@ -3300,7 +3300,11 @@ struct softnet_data { +@@ -3308,7 +3308,11 @@ struct softnet_data { int defer_count; int defer_ipi_scheduled; struct sk_buff *defer_list; @@ -10169,10 +9861,10 @@ index e4878bb58..ebebc32e7 100644 #ifdef CONFIG_SMP diff --git a/include/linux/sched.h b/include/linux/sched.h -index b8be76b0c..c4fe6d06d 100644 +index e0afdc2da..e737b0edc 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h -@@ -946,6 +946,9 @@ struct task_struct { +@@ -951,6 +951,9 @@ struct task_struct { * ->sched_remote_wakeup gets used, so it can be in this word. */ unsigned sched_remote_wakeup:1; @@ -10182,7 +9874,7 @@ index b8be76b0c..c4fe6d06d 100644 /* Bit to tell LSMs we're in execve(): */ unsigned in_execve:1; -@@ -1989,6 +1992,7 @@ static inline int dl_task_check_affinity(struct task_struct *p, const struct cpu +@@ -2002,6 +2005,7 @@ static inline int dl_task_check_affinity(struct task_struct *p, const struct cpu } #endif @@ -10190,7 +9882,7 @@ index b8be76b0c..c4fe6d06d 100644 extern int yield_to(struct task_struct *p, bool preempt); extern void set_user_nice(struct task_struct *p, long nice); extern int task_prio(const struct task_struct *p); -@@ -2140,17 +2144,17 @@ static inline void update_tsk_thread_flag(struct task_struct *tsk, int flag, +@@ -2153,17 +2157,17 @@ static inline void update_tsk_thread_flag(struct task_struct *tsk, int flag, update_ti_thread_flag(task_thread_info(tsk), flag, value); } @@ -10211,7 +9903,7 @@ index b8be76b0c..c4fe6d06d 100644 { return test_ti_thread_flag(task_thread_info(tsk), flag); } -@@ -2163,9 +2167,11 @@ static inline void set_tsk_need_resched(struct task_struct *tsk) +@@ -2176,9 +2180,11 @@ static inline void set_tsk_need_resched(struct task_struct *tsk) static inline void clear_tsk_need_resched(struct task_struct *tsk) { clear_tsk_thread_flag(tsk,TIF_NEED_RESCHED); @@ -10224,7 +9916,7 @@ index b8be76b0c..c4fe6d06d 100644 { return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); } -@@ -2346,7 +2352,7 @@ static inline int rwlock_needbreak(rwlock_t *lock) +@@ -2359,7 +2365,7 @@ static inline int rwlock_needbreak(rwlock_t *lock) static __always_inline bool need_resched(void) { @@ -10505,10 +10197,10 @@ index 74d9fe360..0be63993d 100644 #ifndef CONFIG_HAVE_ARCH_WITHIN_STACK_FRAMES diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h -index 54ade3cea..c67dd30bc 100644 +index 6d91ba4eb..c337945b1 100644 --- a/include/linux/trace_events.h +++ b/include/linux/trace_events.h -@@ -179,8 +179,8 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status); +@@ -183,8 +183,8 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status); enum trace_flag_type { TRACE_FLAG_IRQS_OFF = 0x01, @@ -10519,7 +10211,7 @@ index 54ade3cea..c67dd30bc 100644 TRACE_FLAG_HARDIRQ = 0x08, TRACE_FLAG_SOFTIRQ = 0x10, TRACE_FLAG_PREEMPT_RESCHED = 0x20, -@@ -206,11 +206,11 @@ static inline unsigned int tracing_gen_ctx(void) +@@ -210,11 +210,11 @@ static inline unsigned int tracing_gen_ctx(void) static inline unsigned int tracing_gen_ctx_flags(unsigned long irqflags) { @@ -10778,10 +10470,10 @@ index ce2889f12..d636a1bbd 100644 * We have no kernel internal state, i.e. no waiters in the * kernel. Waiters which are about to queue themselves are stuck diff --git a/kernel/futex/requeue.c b/kernel/futex/requeue.c -index cba8b1a6a..4c73e0b81 100644 +index 7e43839ca..83cc6f7f2 100644 --- a/kernel/futex/requeue.c +++ b/kernel/futex/requeue.c -@@ -850,11 +850,13 @@ int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, +@@ -852,11 +852,13 @@ int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags, pi_mutex = &q.pi_state->pi_mutex; ret = rt_mutex_wait_proxy_lock(pi_mutex, to, &rt_waiter); @@ -10798,7 +10490,7 @@ index cba8b1a6a..4c73e0b81 100644 /* * Fixup the pi_state owner and possibly acquire the lock if we diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c -index 1d4bc493b..486c68c11 100644 +index 347beb763..9dd0bbeb0 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c @@ -179,6 +179,15 @@ KERNEL_ATTR_RO(crash_elfcorehdr_size); @@ -10828,7 +10520,7 @@ index 1d4bc493b..486c68c11 100644 NULL }; diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c -index 3468d8230..6eef8527e 100644 +index 9419a79e8..897b03afb 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -56,6 +56,7 @@ @@ -11061,10 +10753,10 @@ index d1473c624..c7196de83 100644 ww_mutex_set_context_fastpath(lock, ww_ctx); return 0; diff --git a/kernel/panic.c b/kernel/panic.c -index ef9f9a4e9..9215df21d 100644 +index 7be1971d8..3f5fc08bf 100644 --- a/kernel/panic.c +++ b/kernel/panic.c -@@ -366,6 +366,8 @@ void panic(const char *fmt, ...) +@@ -372,6 +372,8 @@ void panic(const char *fmt, ...) */ atomic_notifier_call_chain(&panic_notifier_list, 0, buf); @@ -11073,7 +10765,7 @@ index ef9f9a4e9..9215df21d 100644 panic_print_sys_info(false); kmsg_dump(KMSG_DUMP_PANIC); -@@ -449,6 +451,7 @@ void panic(const char *fmt, ...) +@@ -455,6 +457,7 @@ void panic(const char *fmt, ...) * Explicitly flush the kernel log buffer one last time. */ console_flush_on_panic(CONSOLE_FLUSH_PENDING); @@ -11081,7 +10773,7 @@ index ef9f9a4e9..9215df21d 100644 local_irq_enable(); for (i = 0; ; i += PANIC_TIMER_STEP) { -@@ -627,6 +630,7 @@ bool oops_may_print(void) +@@ -634,6 +637,7 @@ bool oops_may_print(void) */ void oops_enter(void) { @@ -11089,7 +10781,7 @@ index ef9f9a4e9..9215df21d 100644 tracing_off(); /* can't trust the integrity of the kernel anymore: */ debug_locks_off(); -@@ -649,6 +653,7 @@ void oops_exit(void) +@@ -656,6 +660,7 @@ void oops_exit(void) { do_oops_enter_exit(); print_oops_end_marker(); @@ -11097,7 +10789,7 @@ index ef9f9a4e9..9215df21d 100644 kmsg_dump(KMSG_DUMP_OOPS); } -@@ -660,6 +665,8 @@ struct warn_args { +@@ -667,6 +672,8 @@ struct warn_args { void __warn(const char *file, int line, void *caller, unsigned taint, struct pt_regs *regs, struct warn_args *args) { @@ -11106,7 +10798,7 @@ index ef9f9a4e9..9215df21d 100644 disable_trace_on_warning(); if (file) -@@ -690,6 +697,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint, +@@ -697,6 +704,8 @@ void __warn(const char *file, int line, void *caller, unsigned taint, /* Just a warning, don't kill lockdep. */ add_taint(taint, LOCKDEP_STILL_OK); @@ -12970,7 +12662,7 @@ index 000000000..b53d93585 +} +device_initcall(printk_init_ops); diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c -index b4e390e0b..615a2d094 100644 +index 3fdf3cb3b..96e6418ee 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -102,12 +102,6 @@ DEFINE_STATIC_SRCU(console_srcu); @@ -13103,7 +12795,7 @@ index b4e390e0b..615a2d094 100644 { int waiter; -@@ -2305,54 +2346,123 @@ int vprintk_store(int facility, int level, +@@ -2313,54 +2354,123 @@ int vprintk_store(int facility, int level, return ret; } @@ -13241,7 +12933,7 @@ index b4e390e0b..615a2d094 100644 return printed_len; } -@@ -2380,6 +2490,14 @@ EXPORT_SYMBOL(_printk); +@@ -2388,6 +2498,14 @@ EXPORT_SYMBOL(_printk); static bool pr_flush(int timeout_ms, bool reset_on_progress); static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress); @@ -13256,7 +12948,7 @@ index b4e390e0b..615a2d094 100644 #else /* CONFIG_PRINTK */ #define printk_time false -@@ -2390,25 +2508,11 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre +@@ -2398,25 +2516,11 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre static u64 syslog_seq; @@ -13284,7 +12976,7 @@ index b4e390e0b..615a2d094 100644 #endif /* CONFIG_PRINTK */ #ifdef CONFIG_EARLY_PRINTK -@@ -2616,6 +2720,8 @@ void suspend_console(void) +@@ -2624,6 +2728,8 @@ void suspend_console(void) void resume_console(void) { struct console *con; @@ -13293,7 +12985,7 @@ index b4e390e0b..615a2d094 100644 if (!console_suspend_enabled) return; -@@ -2632,6 +2738,20 @@ void resume_console(void) +@@ -2640,6 +2746,20 @@ void resume_console(void) */ synchronize_srcu(&console_srcu); @@ -13314,7 +13006,7 @@ index b4e390e0b..615a2d094 100644 pr_flush(1000, true); } -@@ -2646,7 +2766,8 @@ void resume_console(void) +@@ -2654,7 +2774,8 @@ void resume_console(void) */ static int console_cpu_notify(unsigned int cpu) { @@ -13324,7 +13016,7 @@ index b4e390e0b..615a2d094 100644 /* If trylock fails, someone else is doing the printing */ if (console_trylock()) console_unlock(); -@@ -2654,26 +2775,6 @@ static int console_cpu_notify(unsigned int cpu) +@@ -2662,26 +2783,6 @@ static int console_cpu_notify(unsigned int cpu) return 0; } @@ -13351,7 +13043,7 @@ index b4e390e0b..615a2d094 100644 /** * console_lock - block the console subsystem from printing * -@@ -2723,42 +2824,16 @@ int is_console_locked(void) +@@ -2731,42 +2832,16 @@ int is_console_locked(void) } EXPORT_SYMBOL(is_console_locked); @@ -13398,7 +13090,7 @@ index b4e390e0b..615a2d094 100644 /* * Prepend the message in @pmsg->pbufs->outbuf with a "dropped message". This * is achieved by shifting the existing message over and inserting the dropped -@@ -2773,8 +2848,7 @@ static void __console_unlock(void) +@@ -2781,8 +2856,7 @@ static void __console_unlock(void) * * If @pmsg->pbufs->outbuf is modified, @pmsg->outbuf_len is updated. */ @@ -13408,7 +13100,7 @@ index b4e390e0b..615a2d094 100644 { struct printk_buffers *pbufs = pmsg->pbufs; const size_t scratchbuf_sz = sizeof(pbufs->scratchbuf); -@@ -2805,9 +2879,6 @@ static void console_prepend_dropped(struct printk_message *pmsg, unsigned long d +@@ -2813,9 +2887,6 @@ static void console_prepend_dropped(struct printk_message *pmsg, unsigned long d memcpy(outbuf, scratchbuf, len); pmsg->outbuf_len += len; } @@ -13418,7 +13110,7 @@ index b4e390e0b..615a2d094 100644 /* * Read and format the specified record (or a later record if the specified -@@ -2828,11 +2899,9 @@ static void console_prepend_dropped(struct printk_message *pmsg, unsigned long d +@@ -2836,11 +2907,9 @@ static void console_prepend_dropped(struct printk_message *pmsg, unsigned long d * of @pmsg are valid. (See the documentation of struct printk_message * for information about the @pmsg fields.) */ @@ -13432,7 +13124,7 @@ index b4e390e0b..615a2d094 100644 struct printk_buffers *pbufs = pmsg->pbufs; const size_t scratchbuf_sz = sizeof(pbufs->scratchbuf); const size_t outbuf_sz = sizeof(pbufs->outbuf); -@@ -2860,17 +2929,6 @@ static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, +@@ -2868,17 +2937,6 @@ static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, pmsg->seq = r.info->seq; pmsg->dropped = r.info->seq - seq; @@ -13450,7 +13142,7 @@ index b4e390e0b..615a2d094 100644 /* Skip record that has level above the console loglevel. */ if (may_suppress && suppress_message_printing(r.info->level)) goto out; -@@ -2887,6 +2945,13 @@ static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, +@@ -2895,6 +2953,13 @@ static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, return true; } @@ -13464,7 +13156,7 @@ index b4e390e0b..615a2d094 100644 /* * Print one record for the given console. The record printed is whatever * record is the next available record for the given console. -@@ -2904,12 +2969,10 @@ static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, +@@ -2912,12 +2977,10 @@ static bool printk_get_next_message(struct printk_message *pmsg, u64 seq, */ static bool console_emit_next_record(struct console *con, bool *handover, int cookie) { @@ -13479,7 +13171,7 @@ index b4e390e0b..615a2d094 100644 }; unsigned long flags; -@@ -2931,35 +2994,59 @@ static bool console_emit_next_record(struct console *con, bool *handover, int co +@@ -2939,35 +3002,59 @@ static bool console_emit_next_record(struct console *con, bool *handover, int co con->dropped = 0; } @@ -13559,7 +13251,7 @@ index b4e390e0b..615a2d094 100644 /* * Print out all remaining records to all consoles. * -@@ -2998,13 +3085,33 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove +@@ -3006,13 +3093,33 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove cookie = console_srcu_read_lock(); for_each_console_srcu(con) { @@ -13595,7 +13287,7 @@ index b4e390e0b..615a2d094 100644 /* * If a handover has occurred, the SRCU read lock -@@ -3014,8 +3121,8 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove +@@ -3022,8 +3129,8 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove return false; /* Track the next of the highest seq flushed. */ @@ -13606,7 +13298,7 @@ index b4e390e0b..615a2d094 100644 if (!progress) continue; -@@ -3038,19 +3145,7 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove +@@ -3046,19 +3153,7 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove return false; } @@ -13627,7 +13319,7 @@ index b4e390e0b..615a2d094 100644 { bool do_cond_resched; bool handover; -@@ -3094,6 +3189,32 @@ void console_unlock(void) +@@ -3102,6 +3197,32 @@ void console_unlock(void) */ } while (prb_read_valid(prb, next_seq, NULL) && console_trylock()); } @@ -13660,7 +13352,7 @@ index b4e390e0b..615a2d094 100644 EXPORT_SYMBOL(console_unlock); /** -@@ -3204,6 +3325,7 @@ void console_flush_on_panic(enum con_flush_mode mode) +@@ -3212,6 +3333,7 @@ void console_flush_on_panic(enum con_flush_mode mode) if (mode == CONSOLE_REPLAY_ALL) { struct console *c; @@ -13668,7 +13360,7 @@ index b4e390e0b..615a2d094 100644 int cookie; u64 seq; -@@ -3211,16 +3333,25 @@ void console_flush_on_panic(enum con_flush_mode mode) +@@ -3219,16 +3341,25 @@ void console_flush_on_panic(enum con_flush_mode mode) cookie = console_srcu_read_lock(); for_each_console_srcu(c) { @@ -13700,7 +13392,7 @@ index b4e390e0b..615a2d094 100644 } /* -@@ -3277,13 +3408,122 @@ EXPORT_SYMBOL(console_stop); +@@ -3285,13 +3416,122 @@ EXPORT_SYMBOL(console_stop); void console_start(struct console *console) { @@ -13823,7 +13515,7 @@ index b4e390e0b..615a2d094 100644 static int __read_mostly keep_bootcon; static int __init keep_bootcon_setup(char *str) -@@ -3382,11 +3622,6 @@ static void try_enable_default_console(struct console *newcon) +@@ -3390,11 +3630,6 @@ static void try_enable_default_console(struct console *newcon) newcon->flags |= CON_CONSDEV; } @@ -13835,7 +13527,7 @@ index b4e390e0b..615a2d094 100644 static void console_init_seq(struct console *newcon, bool bootcon_registered) { struct console *con; -@@ -3435,11 +3670,20 @@ static void console_init_seq(struct console *newcon, bool bootcon_registered) +@@ -3443,11 +3678,20 @@ static void console_init_seq(struct console *newcon, bool bootcon_registered) newcon->seq = prb_next_seq(prb); for_each_console(con) { @@ -13860,7 +13552,7 @@ index b4e390e0b..615a2d094 100644 } } -@@ -3500,6 +3744,15 @@ void register_console(struct console *newcon) +@@ -3508,6 +3752,15 @@ void register_console(struct console *newcon) goto unlock; } @@ -13876,7 +13568,7 @@ index b4e390e0b..615a2d094 100644 /* * See if we want to enable this console driver by default. * -@@ -3527,8 +3780,11 @@ void register_console(struct console *newcon) +@@ -3535,8 +3788,11 @@ void register_console(struct console *newcon) err = try_enable_preferred_console(newcon, false); /* printk() messages are not printed to the Braille console. */ @@ -13889,7 +13581,7 @@ index b4e390e0b..615a2d094 100644 /* * If we have a bootconsole, and are switching to a real console, -@@ -3544,6 +3800,17 @@ void register_console(struct console *newcon) +@@ -3552,6 +3808,17 @@ void register_console(struct console *newcon) newcon->dropped = 0; console_init_seq(newcon, bootcon_registered); @@ -13907,7 +13599,7 @@ index b4e390e0b..615a2d094 100644 /* * Put this console in the list - keep the * preferred driver at the head of the list. -@@ -3596,6 +3863,11 @@ EXPORT_SYMBOL(register_console); +@@ -3604,6 +3871,11 @@ EXPORT_SYMBOL(register_console); /* Must be called under console_list_lock(). */ static int unregister_console_locked(struct console *console) { @@ -13919,7 +13611,7 @@ index b4e390e0b..615a2d094 100644 int res; lockdep_assert_console_list_lock_held(); -@@ -3635,11 +3907,50 @@ static int unregister_console_locked(struct console *console) +@@ -3643,11 +3915,50 @@ static int unregister_console_locked(struct console *console) */ synchronize_srcu(&console_srcu); @@ -13970,7 +13662,7 @@ index b4e390e0b..615a2d094 100644 return res; } -@@ -3784,69 +4095,94 @@ late_initcall(printk_late_init); +@@ -3792,69 +4103,94 @@ late_initcall(printk_late_init); /* If @con is specified, only wait for that console. Otherwise wait for all. */ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progress) { @@ -14092,7 +13784,7 @@ index b4e390e0b..615a2d094 100644 last_diff = diff; } -@@ -3887,9 +4223,16 @@ static void wake_up_klogd_work_func(struct irq_work *irq_work) +@@ -3895,9 +4231,16 @@ static void wake_up_klogd_work_func(struct irq_work *irq_work) int pending = this_cpu_xchg(printk_pending, 0); if (pending & PRINTK_PENDING_OUTPUT) { @@ -14112,7 +13804,7 @@ index b4e390e0b..615a2d094 100644 } if (pending & PRINTK_PENDING_WAKEUP) -@@ -3957,11 +4300,16 @@ void defer_console_output(void) +@@ -3965,11 +4308,16 @@ void defer_console_output(void) * New messages may have been added directly to the ringbuffer * using vprintk_store(), so wake any waiters as well. */ @@ -14807,10 +14499,10 @@ index 11a1fac3a..6f085a159 100644 static void print_cpu_stall(unsigned long gps) diff --git a/kernel/sched/core.c b/kernel/sched/core.c -index 7a9aff1db..dcf660b79 100644 +index d9afdd7e5..14cf15784 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c -@@ -901,14 +901,15 @@ static inline void hrtick_rq_init(struct rq *rq) +@@ -910,14 +910,15 @@ static inline void hrtick_rq_init(struct rq *rq) #if defined(CONFIG_SMP) && defined(TIF_POLLING_NRFLAG) /* @@ -14829,7 +14521,7 @@ index 7a9aff1db..dcf660b79 100644 } /* -@@ -925,7 +926,7 @@ static bool set_nr_if_polling(struct task_struct *p) +@@ -934,7 +935,7 @@ static bool set_nr_if_polling(struct task_struct *p) for (;;) { if (!(val & _TIF_POLLING_NRFLAG)) return false; @@ -14838,7 +14530,7 @@ index 7a9aff1db..dcf660b79 100644 return true; if (try_cmpxchg(&ti->flags, &val, val | _TIF_NEED_RESCHED)) break; -@@ -934,9 +935,9 @@ static bool set_nr_if_polling(struct task_struct *p) +@@ -943,9 +944,9 @@ static bool set_nr_if_polling(struct task_struct *p) } #else @@ -14850,7 +14542,7 @@ index 7a9aff1db..dcf660b79 100644 return true; } -@@ -1041,28 +1042,47 @@ void wake_up_q(struct wake_q_head *head) +@@ -1051,28 +1052,47 @@ void wake_up_q(struct wake_q_head *head) * might also involve a cross-CPU call to trigger the scheduler on * the target CPU. */ @@ -14906,7 +14598,7 @@ index 7a9aff1db..dcf660b79 100644 } void resched_cpu(int cpu) -@@ -1135,7 +1155,7 @@ static void wake_up_idle_cpu(int cpu) +@@ -1145,7 +1165,7 @@ static void wake_up_idle_cpu(int cpu) if (cpu == smp_processor_id()) return; @@ -14915,7 +14607,7 @@ index 7a9aff1db..dcf660b79 100644 smp_send_reschedule(cpu); else trace_sched_wake_idle_without_ipi(cpu); -@@ -6775,10 +6795,14 @@ void __noreturn do_task_dead(void) +@@ -6805,10 +6825,14 @@ void __noreturn do_task_dead(void) static inline void sched_submit_work(struct task_struct *tsk) { @@ -14932,7 +14624,7 @@ index 7a9aff1db..dcf660b79 100644 task_flags = tsk->flags; /* -@@ -6804,6 +6828,8 @@ static inline void sched_submit_work(struct task_struct *tsk) +@@ -6834,6 +6858,8 @@ static inline void sched_submit_work(struct task_struct *tsk) * make sure to submit it to avoid deadlocks. */ blk_flush_plug(tsk->plug, true); @@ -14941,7 +14633,7 @@ index 7a9aff1db..dcf660b79 100644 } static void sched_update_worker(struct task_struct *tsk) -@@ -6816,16 +6842,26 @@ static void sched_update_worker(struct task_struct *tsk) +@@ -6848,16 +6874,26 @@ static void sched_update_worker(struct task_struct *tsk) } } @@ -14973,7 +14665,7 @@ index 7a9aff1db..dcf660b79 100644 sched_update_worker(tsk); } EXPORT_SYMBOL(schedule); -@@ -6889,11 +6925,7 @@ void __sched schedule_preempt_disabled(void) +@@ -6921,11 +6957,7 @@ void __sched schedule_preempt_disabled(void) #ifdef CONFIG_PREEMPT_RT void __sched notrace schedule_rtlock(void) { @@ -14986,7 +14678,7 @@ index 7a9aff1db..dcf660b79 100644 } NOKPROBE_SYMBOL(schedule_rtlock); #endif -@@ -7089,6 +7121,32 @@ static void __setscheduler_prio(struct task_struct *p, int prio) +@@ -7121,6 +7153,32 @@ static void __setscheduler_prio(struct task_struct *p, int prio) #ifdef CONFIG_RT_MUTEXES @@ -15019,7 +14711,7 @@ index 7a9aff1db..dcf660b79 100644 static inline int __rt_effective_prio(struct task_struct *pi_task, int prio) { if (pi_task) -@@ -8951,6 +9009,21 @@ static inline void preempt_dynamic_init(void) { } +@@ -8991,6 +9049,21 @@ static inline void preempt_dynamic_init(void) { } #endif /* #ifdef CONFIG_PREEMPT_DYNAMIC */ @@ -15042,10 +14734,10 @@ index 7a9aff1db..dcf660b79 100644 * yield - yield the current processor to other threads. * diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c -index 8b3063398..76530c8b3 100644 +index 10a19e51e..2ff75a19b 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c -@@ -333,6 +333,23 @@ static const struct file_operations sched_debug_fops = { +@@ -376,6 +376,23 @@ static const struct file_operations sched_debug_fops = { .release = seq_release, }; @@ -15069,7 +14761,7 @@ index 8b3063398..76530c8b3 100644 static struct dentry *debugfs_sched; static __init int sched_init_debug(void) -@@ -374,6 +391,8 @@ static __init int sched_init_debug(void) +@@ -417,6 +434,8 @@ static __init int sched_init_debug(void) debugfs_create_file("debug", 0444, debugfs_sched, NULL, &sched_debug_fops); @@ -15079,10 +14771,10 @@ index 8b3063398..76530c8b3 100644 } late_initcall(sched_init_debug); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c -index d5ae744de..51cc50a7e 100644 +index 6b30b3811..21b653852 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c -@@ -1154,8 +1154,10 @@ static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se); +@@ -1208,8 +1208,10 @@ static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se); * XXX: strictly: vd_i += N*r_i/w_i such that: vd_i > ve_i * this is probably good enough. */ @@ -15094,7 +14786,7 @@ index d5ae744de..51cc50a7e 100644 if ((s64)(se->vruntime - se->deadline) < 0) return; -@@ -1174,10 +1176,19 @@ static void update_deadline(struct cfs_rq *cfs_rq, struct sched_entity *se) +@@ -1228,10 +1230,19 @@ static void update_deadline(struct cfs_rq *cfs_rq, struct sched_entity *se) /* * The task has consumed its request, reschedule. */ @@ -15117,7 +14809,7 @@ index d5ae744de..51cc50a7e 100644 } #include "pelt.h" -@@ -1285,7 +1296,7 @@ static void update_tg_load_avg(struct cfs_rq *cfs_rq) +@@ -1339,7 +1350,7 @@ static void update_tg_load_avg(struct cfs_rq *cfs_rq) /* * Update the current task's runtime statistics. */ @@ -15126,7 +14818,7 @@ index d5ae744de..51cc50a7e 100644 { struct sched_entity *curr = cfs_rq->curr; u64 now = rq_clock_task(rq_of(cfs_rq)); -@@ -1312,7 +1323,7 @@ static void update_curr(struct cfs_rq *cfs_rq) +@@ -1366,7 +1377,7 @@ static void update_curr(struct cfs_rq *cfs_rq) schedstat_add(cfs_rq->exec_clock, delta_exec); curr->vruntime += calc_delta_fair(delta_exec, curr); @@ -15135,7 +14827,7 @@ index d5ae744de..51cc50a7e 100644 update_min_vruntime(cfs_rq); if (entity_is_task(curr)) { -@@ -1326,6 +1337,11 @@ static void update_curr(struct cfs_rq *cfs_rq) +@@ -1380,6 +1391,11 @@ static void update_curr(struct cfs_rq *cfs_rq) account_cfs_rq_runtime(cfs_rq, delta_exec); } @@ -15147,7 +14839,7 @@ index d5ae744de..51cc50a7e 100644 static void update_curr_fair(struct rq *rq) { update_curr(cfs_rq_of(&rq->curr->se)); -@@ -5629,7 +5645,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) +@@ -5707,7 +5723,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) /* * Update run-time statistics of the 'current'. */ @@ -15156,7 +14848,7 @@ index d5ae744de..51cc50a7e 100644 /* * Ensure that runnable average is periodically updated. -@@ -5643,7 +5659,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) +@@ -5721,7 +5737,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) * validating it and just reschedule. */ if (queued) { @@ -15165,7 +14857,7 @@ index d5ae744de..51cc50a7e 100644 return; } /* -@@ -5789,7 +5805,7 @@ static void __account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec) +@@ -5867,7 +5883,7 @@ static void __account_cfs_rq_runtime(struct cfs_rq *cfs_rq, u64 delta_exec) * hierarchy can be throttled */ if (!assign_cfs_rq_runtime(cfs_rq) && likely(cfs_rq->curr)) @@ -15174,7 +14866,7 @@ index d5ae744de..51cc50a7e 100644 } static __always_inline -@@ -6088,7 +6104,7 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq) +@@ -6182,7 +6198,7 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq) /* Determine whether we need to wake up potentially idle CPU: */ if (rq->curr == rq->idle && rq->cfs.nr_running) @@ -15183,7 +14875,7 @@ index d5ae744de..51cc50a7e 100644 } #ifdef CONFIG_SMP -@@ -7333,7 +7349,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) +@@ -7462,7 +7478,7 @@ static void hrtick_start_fair(struct rq *rq, struct task_struct *p) if (delta < 0) { if (task_current(rq, p)) @@ -15192,7 +14884,7 @@ index d5ae744de..51cc50a7e 100644 return; } hrtick_start(rq, delta); -@@ -9314,7 +9330,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ +@@ -9557,7 +9573,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ * prevents us from potentially nominating it as a false LAST_BUDDY * below. */ @@ -15201,7 +14893,7 @@ index d5ae744de..51cc50a7e 100644 return; if (!sched_feat(WAKEUP_PREEMPTION)) -@@ -9356,7 +9372,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ +@@ -9605,7 +9621,7 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int wake_ return; preempt: @@ -15210,7 +14902,7 @@ index d5ae744de..51cc50a7e 100644 } #ifdef CONFIG_QOS_SCHED -@@ -9839,8 +9855,7 @@ static bool _qos_smt_check_need_resched(int this_cpu, struct rq *rq) +@@ -10094,8 +10110,7 @@ static bool _qos_smt_check_need_resched(int this_cpu, struct rq *rq) /* * There are two cases rely on the set need_resched to drive away @@ -15220,7 +14912,7 @@ index d5ae744de..51cc50a7e 100644 * b) The qos_smt_status of siblings cpu is offline, the task of curr cpu is idle, * and current cpu only has SCHED_IDLE tasks enqueued. */ -@@ -14214,7 +14229,7 @@ static inline void task_tick_core(struct rq *rq, struct task_struct *curr) +@@ -14478,7 +14493,7 @@ static inline void task_tick_core(struct rq *rq, struct task_struct *curr) */ if (rq->core->core_forceidle_count && rq->cfs.nr_running == 1 && __entity_slice_used(&curr->se, MIN_NR_TASKS_DURING_FORCEIDLE)) @@ -15229,7 +14921,7 @@ index d5ae744de..51cc50a7e 100644 } /* -@@ -14530,7 +14545,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) +@@ -14802,7 +14817,7 @@ prio_changed_fair(struct rq *rq, struct task_struct *p, int oldprio) */ if (task_current(rq, p)) { if (p->prio > oldprio) @@ -15239,23 +14931,23 @@ index d5ae744de..51cc50a7e 100644 check_preempt_curr(rq, p, 0); } diff --git a/kernel/sched/features.h b/kernel/sched/features.h -index 26b1a03bd..a08f2fcd7 100644 +index b95797360..3867e61e3 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h -@@ -98,7 +98,7 @@ SCHED_FEAT(UTIL_EST_FASTUP, true) - SCHED_FEAT(LATENCY_WARN, false) +@@ -103,7 +103,7 @@ SCHED_FEAT(LATENCY_WARN, false) SCHED_FEAT(HZ_BW, true) + SCHED_FEAT(IRQ_AVG, false) - +SCHED_FEAT(FORCE_NEED_RESCHED, false) #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY /* * Use util_avg of bottom-Level taskgroup diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c -index 5007b25c5..95e1b3df1 100644 +index 86618f719..d75731f45 100644 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c -@@ -57,8 +57,7 @@ static noinline int __cpuidle cpu_idle_poll(void) +@@ -61,8 +61,7 @@ static noinline int __cpuidle cpu_idle_poll(void) ct_cpuidle_enter(); raw_local_irq_enable(); @@ -15266,10 +14958,10 @@ index 5007b25c5..95e1b3df1 100644 raw_local_irq_disable(); diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c -index 77bb7ee8c..6dedad4f4 100644 +index 549b9ecfd..e8ee40b88 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c -@@ -2256,8 +2256,11 @@ static int rto_next_cpu(struct root_domain *rd) +@@ -2254,8 +2254,11 @@ static int rto_next_cpu(struct root_domain *rd) rd->rto_cpu = cpu; @@ -15283,10 +14975,10 @@ index 77bb7ee8c..6dedad4f4 100644 rd->rto_cpu = -1; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h -index 761870540..f9918a975 100644 +index 0e21ad151..981885836 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h -@@ -2601,6 +2601,7 @@ extern void init_sched_fair_class(void); +@@ -2641,6 +2641,7 @@ extern void init_sched_fair_class(void); extern void reweight_task(struct task_struct *p, const struct load_weight *lw); extern void resched_curr(struct rq *rq); @@ -15295,7 +14987,7 @@ index 761870540..f9918a975 100644 extern struct rt_bandwidth def_rt_bandwidth; diff --git a/kernel/signal.c b/kernel/signal.c -index f36c58ea7..0f2615143 100644 +index 50aa72d6f..8b26894c2 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -2332,15 +2332,35 @@ static int ptrace_stop(int exit_code, int why, unsigned long message, @@ -15340,7 +15032,7 @@ index f36c58ea7..0f2615143 100644 cgroup_leave_frozen(true); diff --git a/kernel/softirq.c b/kernel/softirq.c -index bd9716d7b..2fde8af88 100644 +index f8cf88cc4..13f919072 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c @@ -247,6 +247,19 @@ void __local_bh_enable_ip(unsigned long ip, unsigned int cnt) @@ -15363,7 +15055,7 @@ index bd9716d7b..2fde8af88 100644 /* * Invoked from ksoftirqd_run() outside of the interrupt disabled section * to acquire the per CPU local lock for reentrancy protection. -@@ -623,6 +636,24 @@ static inline void tick_irq_exit(void) +@@ -630,6 +643,24 @@ static inline void tick_irq_exit(void) #endif } @@ -15388,7 +15080,7 @@ index bd9716d7b..2fde8af88 100644 static inline void __irq_exit_rcu(void) { #ifndef __ARCH_IRQ_EXIT_IRQS_DISABLED -@@ -635,6 +666,10 @@ static inline void __irq_exit_rcu(void) +@@ -642,6 +673,10 @@ static inline void __irq_exit_rcu(void) if (!in_interrupt() && local_softirq_pending()) invoke_softirq(); @@ -15399,7 +15091,7 @@ index bd9716d7b..2fde8af88 100644 tick_irq_exit(); } -@@ -967,12 +1002,70 @@ static struct smp_hotplug_thread softirq_threads = { +@@ -1021,12 +1056,70 @@ static struct smp_hotplug_thread softirq_threads = { .thread_comm = "ksoftirqd/%u", }; @@ -15472,10 +15164,10 @@ index bd9716d7b..2fde8af88 100644 } early_initcall(spawn_ksoftirqd); diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c -index 57e5cb36f..c4ae45701 100644 +index 9200e13cf..9311259ed 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c -@@ -1812,7 +1812,7 @@ void hrtimer_interrupt(struct clock_event_device *dev) +@@ -1875,7 +1875,7 @@ void hrtimer_interrupt(struct clock_event_device *dev) if (!ktime_before(now, cpu_base->softirq_expires_next)) { cpu_base->softirq_expires_next = KTIME_MAX; cpu_base->softirq_activated = 1; @@ -15484,7 +15176,7 @@ index 57e5cb36f..c4ae45701 100644 } __hrtimer_run_queues(cpu_base, now, flags, HRTIMER_ACTIVE_HARD); -@@ -1925,7 +1925,7 @@ void hrtimer_run_queues(void) +@@ -1988,7 +1988,7 @@ void hrtimer_run_queues(void) if (!ktime_before(now, cpu_base->softirq_expires_next)) { cpu_base->softirq_expires_next = KTIME_MAX; cpu_base->softirq_activated = 1; @@ -15538,10 +15230,10 @@ index 63a8ce717..b3fbe97d1 100644 /* diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c -index 8f92edf15..b2bdd1863 100644 +index 645b52ede..1280415c7 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c -@@ -2708,6 +2708,8 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status) +@@ -2730,6 +2730,8 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status) if (tif_need_resched()) trace_flags |= TRACE_FLAG_NEED_RESCHED; @@ -15551,10 +15243,10 @@ index 8f92edf15..b2bdd1863 100644 trace_flags |= TRACE_FLAG_PREEMPT_RESCHED; return (trace_flags << 16) | (min_t(unsigned int, pc & 0xff, 0xf)) | diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c -index 3b7d3e9eb..5a4fefbc0 100644 +index 7a4c723a0..ffda814a7 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c -@@ -460,17 +460,29 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) +@@ -464,17 +464,29 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) (entry->flags & TRACE_FLAG_IRQS_OFF && bh_off) ? 'D' : (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' : bh_off ? 'b' : @@ -15587,10 +15279,10 @@ index 3b7d3e9eb..5a4fefbc0 100644 need_resched = 'p'; break; diff --git a/net/core/dev.c b/net/core/dev.c -index 540ab980e..8bbcd7283 100644 +index e2d61f786..f81f6efa5 100644 --- a/net/core/dev.c +++ b/net/core/dev.c -@@ -4715,15 +4715,6 @@ static void rps_trigger_softirq(void *data) +@@ -4766,15 +4766,6 @@ static void rps_trigger_softirq(void *data) #endif /* CONFIG_RPS */ @@ -15606,7 +15298,7 @@ index 540ab980e..8bbcd7283 100644 /* * After we queued a packet into sd->input_pkt_queue, * we need to make sure this queue is serviced soon. -@@ -6692,6 +6683,32 @@ static void skb_defer_free_flush(struct softnet_data *sd) +@@ -6834,6 +6825,32 @@ static void skb_defer_free_flush(struct softnet_data *sd) } } @@ -15639,7 +15331,7 @@ index 540ab980e..8bbcd7283 100644 static int napi_threaded_poll(void *data) { struct napi_struct *napi = data; -@@ -11629,7 +11646,11 @@ static int __init net_dev_init(void) +@@ -11778,7 +11795,11 @@ static int __init net_dev_init(void) INIT_CSD(&sd->csd, rps_trigger_softirq, sd); sd->cpu = i; #endif @@ -15652,10 +15344,10 @@ index 540ab980e..8bbcd7283 100644 init_gro_hash(&sd->backlog); diff --git a/net/core/skbuff.c b/net/core/skbuff.c -index f0a9ef1ae..682175af4 100644 +index ea5e9d46d..9cb4b7127 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c -@@ -6863,8 +6863,13 @@ nodefer: __kfree_skb(skb); +@@ -6871,8 +6871,13 @@ nodefer: __kfree_skb(skb); /* Make sure to trigger NET_RX_SOFTIRQ on the remote CPU * if we are unlucky enough (this seems very unlikely). */ @@ -15671,5 +15363,5 @@ index f0a9ef1ae..682175af4 100644 static void skb_splice_csum_page(struct sk_buff *skb, struct page *page, -- -2.41.0 +2.25.1 diff --git a/raspberrypi-kernel-rt.spec b/raspberrypi-kernel-rt.spec index e21e66f10895ba29760b1bf446405d5f1d854ee3..b3d432dfb70f0fc0ef1ececf57bae8eb96e4d384 100644 --- a/raspberrypi-kernel-rt.spec +++ b/raspberrypi-kernel-rt.spec @@ -2,13 +2,13 @@ %global KernelVer %{version}-%{release}.raspi.%{_target_cpu} -%global hulkrelease 62.0.0 +%global hulkrelease 124.0.0 %global debug_package %{nil} Name: raspberrypi-kernel-rt Version: 6.6.0 -Release: %{hulkrelease}.rt47.3 +Release: %{hulkrelease}.rt47.4 Summary: Linux Kernel License: GPLv2 URL: http://www.kernel.org/ @@ -265,6 +265,9 @@ fi %changelog +* Fri Dec 05 2025 zhangyu - 6.6.0.124.0.4 +- - update Rpi:preempt-RT to openEuler 6.6.0.124.4.0 + * Mon Dec 09 2024 zhangyu - 6.6.0.62.0.3 - - update Rpi:preempt-RT to openEuler 6.6.0.62.3.0