[linux-rt-devel:linux-5.13.y-rt-rebase 9/222] kernel/printk/printk.c:2648:4: error: implicit declaration of function 'latched_seq_write'

From: kernel test robot
Date: Thu Jul 08 2021 - 10:31:03 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.13.y-rt-rebase
head: 7e175e6b59975c8901ad370f7818937f68de45c1
commit: 7995ace9ab04969b9d5577e5fd74d77765c7d917 [9/222] printk: use seqcount_latch for console_seq
config: powerpc64-randconfig-r003-20210708 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8d69635ed9ecf36fd0ca85906bfde17949671cbe)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc64 cross compiling tool for clang build
# apt-get install binutils-powerpc64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git/commit/?id=7995ace9ab04969b9d5577e5fd74d77765c7d917
git remote add linux-rt-devel https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git
git fetch --no-tags linux-rt-devel linux-5.13.y-rt-rebase
git checkout 7995ace9ab04969b9d5577e5fd74d77765c7d917
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

In file included from kernel/printk/printk.c:22:
In file included from include/linux/kernel.h:12:
In file included from include/linux/bitops.h:32:
In file included from arch/powerpc/include/asm/bitops.h:62:
arch/powerpc/include/asm/barrier.h:49:9: warning: '__lwsync' macro redefined [-Wmacro-redefined]
#define __lwsync() __asm__ __volatile__ (stringify_in_c(LWSYNC) : : :"memory")
^
<built-in>:310:9: note: previous definition is here
#define __lwsync __builtin_ppc_lwsync
^
kernel/printk/printk.c:176:5: warning: no previous prototype for function 'devkmsg_sysctl_set_loglvl' [-Wmissing-prototypes]
int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
^
kernel/printk/printk.c:176:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int devkmsg_sysctl_set_loglvl(struct ctl_table *table, int write,
^
static
kernel/printk/printk.c:2282:2: error: FIXME
#error FIXME
^
kernel/printk/printk.c:2642:9: error: implicit declaration of function 'latched_seq_read_nolock' [-Werror,-Wimplicit-function-declaration]
seq = latched_seq_read_nolock(&console_seq);
^
>> kernel/printk/printk.c:2648:4: error: implicit declaration of function 'latched_seq_write' [-Werror,-Wimplicit-function-declaration]
latched_seq_write(&console_seq, r.info->seq);
^
kernel/printk/printk.c:2658:4: error: implicit declaration of function 'latched_seq_write' [-Werror,-Wimplicit-function-declaration]
latched_seq_write(&console_seq, seq + 1);
^
kernel/printk/printk.c:2685:3: error: implicit declaration of function 'latched_seq_write' [-Werror,-Wimplicit-function-declaration]
latched_seq_write(&console_seq, seq + 1);
^
kernel/printk/printk.c:2776:4: error: implicit declaration of function 'latched_seq_write' [-Werror,-Wimplicit-function-declaration]
latched_seq_write(&console_seq, prb_first_valid_seq(prb));
^
kernel/printk/printk.c:3023:32: error: implicit declaration of function 'latched_seq_read_nolock' [-Werror,-Wimplicit-function-declaration]
exclusive_console_stop_seq = latched_seq_read_nolock(&console_seq);
^
kernel/printk/printk.c:3027:3: error: implicit declaration of function 'latched_seq_write' [-Werror,-Wimplicit-function-declaration]
latched_seq_write(&console_seq, syslog_seq);
^
2 warnings and 8 errors generated.


vim +/latched_seq_write +2648 kernel/printk/printk.c

2576
2577 /**
2578 * console_unlock - unlock the console system
2579 *
2580 * Releases the console_lock which the caller holds on the console system
2581 * and the console driver list.
2582 *
2583 * While the console_lock was held, console output may have been buffered
2584 * by printk(). If this is the case, console_unlock(); emits
2585 * the output prior to releasing the lock.
2586 *
2587 * If there is output waiting, we wake /dev/kmsg and syslog() users.
2588 *
2589 * console_unlock(); may be called from any context.
2590 */
2591 void console_unlock(void)
2592 {
2593 static char ext_text[CONSOLE_EXT_LOG_MAX];
2594 static char text[CONSOLE_LOG_MAX];
2595 unsigned long flags;
2596 bool do_cond_resched, retry;
2597 struct printk_info info;
2598 struct printk_record r;
2599 u64 seq;
2600
2601 if (console_suspended) {
2602 up_console_sem();
2603 return;
2604 }
2605
2606 prb_rec_init_rd(&r, &info, text, sizeof(text));
2607
2608 /*
2609 * Console drivers are called with interrupts disabled, so
2610 * @console_may_schedule should be cleared before; however, we may
2611 * end up dumping a lot of lines, for example, if called from
2612 * console registration path, and should invoke cond_resched()
2613 * between lines if allowable. Not doing so can cause a very long
2614 * scheduling stall on a slow console leading to RCU stall and
2615 * softlockup warnings which exacerbate the issue with more
2616 * messages practically incapacitating the system.
2617 *
2618 * console_trylock() is not able to detect the preemptive
2619 * context reliably. Therefore the value must be stored before
2620 * and cleared after the "again" goto label.
2621 */
2622 do_cond_resched = console_may_schedule;
2623 again:
2624 console_may_schedule = 0;
2625
2626 /*
2627 * We released the console_sem lock, so we need to recheck if
2628 * cpu is online and (if not) is there at least one CON_ANYTIME
2629 * console.
2630 */
2631 if (!can_use_console()) {
2632 console_locked = 0;
2633 up_console_sem();
2634 return;
2635 }
2636
2637 for (;;) {
2638 size_t ext_len = 0;
2639 size_t len;
2640
2641 skip:
2642 seq = latched_seq_read_nolock(&console_seq);
2643 if (!prb_read_valid(prb, seq, &r))
2644 break;
2645
2646 if (seq != r.info->seq) {
2647 console_dropped += r.info->seq - seq;
> 2648 latched_seq_write(&console_seq, r.info->seq);
2649 seq = r.info->seq;
2650 }
2651
2652 if (suppress_message_printing(r.info->level)) {
2653 /*
2654 * Skip record we have buffered and already printed
2655 * directly to the console when we received it, and
2656 * record that has level above the console loglevel.
2657 */
2658 latched_seq_write(&console_seq, seq + 1);
2659 goto skip;
2660 }
2661
2662 /* Output to all consoles once old messages replayed. */
2663 if (unlikely(exclusive_console &&
2664 seq >= exclusive_console_stop_seq)) {
2665 exclusive_console = NULL;
2666 }
2667
2668 /*
2669 * Handle extended console text first because later
2670 * record_print_text() will modify the record buffer in-place.
2671 */
2672 if (nr_ext_console_drivers) {
2673 ext_len = info_print_ext_header(ext_text,
2674 sizeof(ext_text),
2675 r.info);
2676 ext_len += msg_print_ext_body(ext_text + ext_len,
2677 sizeof(ext_text) - ext_len,
2678 &r.text_buf[0],
2679 r.info->text_len,
2680 &r.info->dev_info);
2681 }
2682 len = record_print_text(&r,
2683 console_msg_format & MSG_FORMAT_SYSLOG,
2684 printk_time);
2685 latched_seq_write(&console_seq, seq + 1);
2686
2687 printk_safe_enter_irqsave(flags);
2688
2689 /*
2690 * While actively printing out messages, if another printk()
2691 * were to occur on another CPU, it may wait for this one to
2692 * finish. This task can not be preempted if there is a
2693 * waiter waiting to take over.
2694 */
2695 console_lock_spinning_enable();
2696
2697 stop_critical_timings(); /* don't trace print latency */
2698 call_console_drivers(ext_text, ext_len, text, len);
2699 start_critical_timings();
2700
2701 if (console_lock_spinning_disable_and_check()) {
2702 printk_safe_exit_irqrestore(flags);
2703 return;
2704 }
2705
2706 printk_safe_exit_irqrestore(flags);
2707
2708 if (do_cond_resched)
2709 cond_resched();
2710 }
2711
2712 console_locked = 0;
2713
2714 up_console_sem();
2715
2716 /*
2717 * Someone could have filled up the buffer again, so re-check if there's
2718 * something to flush. In case we cannot trylock the console_sem again,
2719 * there's a new owner and the console_unlock() from them will do the
2720 * flush, no worries.
2721 */
2722 retry = prb_read_valid(prb, latched_seq_read_nolock(&console_seq), NULL);
2723 if (retry && console_trylock())
2724 goto again;
2725 }
2726 EXPORT_SYMBOL(console_unlock);
2727

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip