In v5.4.37, upstream ab6f762f0f5 ("printk: queue wake_up_klogd
irq_work only if per-CPU areas are ready") was backported.However, in preempt-rt content we have: 0011-printk_safe-remove-printk-safe-code.patch 0025-printk-remove-unused-code.patch The v5.6-rt already has a backport of ab6f762f0f5 present, and has simply expanded the above removals to account for the backport, so we do the same thing here for v5.4-rt Signed-off-by: Paul Gortmaker <[email protected]> diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 0c693e7d7d5e..0605a74ad76b 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -392,26 +392,6 @@ static u64 clear_seq; #define LOG_LEVEL(v) ((v) & 0x07) #define LOG_FACILITY(v) ((v) >> 3 & 0xff) -/* record buffer */ -#define LOG_ALIGN __alignof__(struct printk_log) -#define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT) -#define LOG_BUF_LEN_MAX (u32)(1 << 31) -static char __log_buf[__LOG_BUF_LEN] __aligned(LOG_ALIGN); -static char *log_buf = __log_buf; -static u32 log_buf_len = __LOG_BUF_LEN; - -/* - * We cannot access per-CPU data (e.g. per-CPU flush irq_work) before - * per_cpu_areas are initialised. This variable is set to true when - * it's safe to access per-CPU data. - */ -static bool __printk_percpu_data_ready __read_mostly; - -bool printk_percpu_data_ready(void) -{ - return __printk_percpu_data_ready; -} - /* Return log buffer address */ char *log_buf_addr_get(void) { @@ -1031,14 +1011,6 @@ static inline void log_buf_add_cpu(void) {} #endif /* CONFIG_SMP */ #endif /* 0 */ -static void __init set_percpu_data_ready(void) -{ - printk_safe_init(); - /* Make sure we set this flag only after printk_safe() init is done */ - barrier(); - __printk_percpu_data_ready = true; -} - void __init setup_log_buf(int early) { /* FIXME: no support for buffer resizing */ @@ -1047,14 +1019,6 @@ void __init setup_log_buf(int early) char *new_log_buf; unsigned int free; - /* - * Some archs call setup_log_buf() multiple times - first is very - * early, e.g. from setup_arch(), and second - when percpu_areas - * are initialised. - */ - if (!early) - set_percpu_data_ready(); - if (log_buf != __log_buf) return; @@ -2779,17 +2743,6 @@ static int __init init_printk_kthread(void) } late_initcall(init_printk_kthread); -void defer_console_output(void) -{ - if (!printk_percpu_data_ready()) - return; - - preempt_disable(); - __this_cpu_or(printk_pending, PRINTK_PENDING_OUTPUT); - irq_work_queue(this_cpu_ptr(&wake_up_klogd_work)); - preempt_enable(); -} - static int vprintk_deferred(const char *fmt, va_list args) { return vprintk_emit(0, LOGLEVEL_DEFAULT, NULL, 0, fmt, args); -- 2.7.4
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#8633): https://lists.yoctoproject.org/g/linux-yocto/message/8633 Mute This Topic: https://lists.yoctoproject.org/mt/74002022/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/leave/6687884/624485779/xyzzy [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
