All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 1290/8469] arch/um/kernel/kmsg_dump.c:10:13: sparse: sparse: context imbalance in 'kmsg_dumper_stdout' - different lock contexts for basic block
@ 2021-03-30  2:03 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-03-30  2:03 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 4506 bytes --]

CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: John Ogness <john.ogness@linutronix.de>
CC: Petr Mladek <pmladek@suse.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   9d49ed9ca93b8c564033c1d6808017bc9052b5db
commit: fdd2c1f4e2c2e2fee1d95d18b4b06bc0d15c368a [1290/8469] um: synchronize kmsg_dumper
:::::: branch date: 16 hours ago
:::::: commit date: 3 weeks ago
config: um-randconfig-s032-20210329 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-277-gc089cd2d-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=fdd2c1f4e2c2e2fee1d95d18b4b06bc0d15c368a
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout fdd2c1f4e2c2e2fee1d95d18b4b06bc0d15c368a
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=um 

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


sparse warnings: (new ones prefixed by >>)
   arch/um/kernel/kmsg_dump.c:51:12: sparse: sparse: symbol 'kmsg_dumper_stdout_init' was not declared. Should it be static?
>> arch/um/kernel/kmsg_dump.c:10:13: sparse: sparse: context imbalance in 'kmsg_dumper_stdout' - different lock contexts for basic block

vim +/kmsg_dumper_stdout +10 arch/um/kernel/kmsg_dump.c

04a418495e0852 Thomas Meyer    2015-03-28   9  
04a418495e0852 Thomas Meyer    2015-03-28 @10  static void kmsg_dumper_stdout(struct kmsg_dumper *dumper,
04a418495e0852 Thomas Meyer    2015-03-28  11  				enum kmsg_dump_reason reason)
04a418495e0852 Thomas Meyer    2015-03-28  12  {
fdd2c1f4e2c2e2 John Ogness     2021-03-03  13  	static DEFINE_SPINLOCK(lock);
04a418495e0852 Thomas Meyer    2015-03-28  14  	static char line[1024];
7d7c0568285d6f Andy Shevchenko 2020-02-12  15  	struct console *con;
fdd2c1f4e2c2e2 John Ogness     2021-03-03  16  	unsigned long flags;
04a418495e0852 Thomas Meyer    2015-03-28  17  	size_t len = 0;
04a418495e0852 Thomas Meyer    2015-03-28  18  
04a418495e0852 Thomas Meyer    2015-03-28  19  	/* only dump kmsg when no console is available */
04a418495e0852 Thomas Meyer    2015-03-28  20  	if (!console_trylock())
04a418495e0852 Thomas Meyer    2015-03-28  21  		return;
04a418495e0852 Thomas Meyer    2015-03-28  22  
e23fe90dec286c Thomas Meyer    2021-01-07  23  	for_each_console(con) {
e23fe90dec286c Thomas Meyer    2021-01-07  24  		if(strcmp(con->name, "tty") == 0 &&
e23fe90dec286c Thomas Meyer    2021-01-07  25  		   (con->flags & (CON_ENABLED | CON_CONSDEV)) != 0) {
7d7c0568285d6f Andy Shevchenko 2020-02-12  26  			break;
e23fe90dec286c Thomas Meyer    2021-01-07  27  		}
e23fe90dec286c Thomas Meyer    2021-01-07  28  	}
04a418495e0852 Thomas Meyer    2015-03-28  29  
04a418495e0852 Thomas Meyer    2015-03-28  30  	console_unlock();
04a418495e0852 Thomas Meyer    2015-03-28  31  
7d7c0568285d6f Andy Shevchenko 2020-02-12  32  	if (con)
04a418495e0852 Thomas Meyer    2015-03-28  33  		return;
04a418495e0852 Thomas Meyer    2015-03-28  34  
fdd2c1f4e2c2e2 John Ogness     2021-03-03  35  	if (!spin_trylock_irqsave(&lock, flags))
fdd2c1f4e2c2e2 John Ogness     2021-03-03  36  		return;
fdd2c1f4e2c2e2 John Ogness     2021-03-03  37  
04a418495e0852 Thomas Meyer    2015-03-28  38  	printf("kmsg_dump:\n");
04a418495e0852 Thomas Meyer    2015-03-28  39  	while (kmsg_dump_get_line(dumper, true, line, sizeof(line), &len)) {
04a418495e0852 Thomas Meyer    2015-03-28  40  		line[len] = '\0';
04a418495e0852 Thomas Meyer    2015-03-28  41  		printf("%s", line);
04a418495e0852 Thomas Meyer    2015-03-28  42  	}
fdd2c1f4e2c2e2 John Ogness     2021-03-03  43  
fdd2c1f4e2c2e2 John Ogness     2021-03-03  44  	spin_unlock_irqrestore(&lock, flags);
04a418495e0852 Thomas Meyer    2015-03-28  45  }
04a418495e0852 Thomas Meyer    2015-03-28  46  

:::::: The code at line 10 was first introduced by commit
:::::: 04a418495e0852263d77c4fb82adf470feaafef3 um: add a kmsg_dumper

:::::: TO: Thomas Meyer <thomas@m3y3r.de>
:::::: CC: Richard Weinberger <richard@nod.at>

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 9871 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-30  2:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-30  2:03 [linux-next:master 1290/8469] arch/um/kernel/kmsg_dump.c:10:13: sparse: sparse: context imbalance in 'kmsg_dumper_stdout' - different lock contexts for basic block kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.