All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v1 2/2] genirq/irqdesc: Balance locking to make sparse happy
@ 2025-04-17 15:36 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2025-04-17 15:36 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20250416114122.2191820-3-andriy.shevchenko@linux.intel.com>
References: <20250416114122.2191820-3-andriy.shevchenko@linux.intel.com>
TO: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
TO: Thomas Gleixner <tglx@linutronix.de>
TO: linux-kernel@vger.kernel.org
CC: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Hi Andy,

kernel test robot noticed the following build warnings:

[auto build test WARNING on tip/irq/core]
[also build test WARNING on linus/master v6.15-rc2 next-20250417]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Andy-Shevchenko/genirq-irqdesc-Decrease-indentation-level-in-__irq_get_desc_lock/20250416-194250
base:   tip/irq/core
patch link:    https://lore.kernel.org/r/20250416114122.2191820-3-andriy.shevchenko%40linux.intel.com
patch subject: [PATCH v1 2/2] genirq/irqdesc: Balance locking to make sparse happy
:::::: branch date: 28 hours ago
:::::: commit date: 28 hours ago
config: powerpc-randconfig-r062-20250417 (https://download.01.org/0day-ci/archive/20250417/202504172346.KbnCGLce-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202504172346.KbnCGLce-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> kernel/irq/irqdesc.c:931:18-22: ERROR: desc is NULL but dereferenced.

vim +931 kernel/irq/irqdesc.c

a98d24b71b6e22 Thomas Gleixner 2010-09-30  902  
d5eb4ad2dfb2df Thomas Gleixner 2011-02-12  903  struct irq_desc *
31d9d9b6d83030 Marc Zyngier    2011-09-23  904  __irq_get_desc_lock(unsigned int irq, unsigned long *flags, bool bus,
31d9d9b6d83030 Marc Zyngier    2011-09-23  905  		    unsigned int check)
752346dda9011a Andy Shevchenko 2025-04-16  906  	__acquires(&desc->lock)
d5eb4ad2dfb2df Thomas Gleixner 2011-02-12  907  {
cd49c072791316 Andy Shevchenko 2025-04-16  908  	struct irq_desc *desc;
cd49c072791316 Andy Shevchenko 2025-04-16  909  
cd49c072791316 Andy Shevchenko 2025-04-16  910  	desc = irq_to_desc(irq);
cd49c072791316 Andy Shevchenko 2025-04-16  911  	if (!desc)
752346dda9011a Andy Shevchenko 2025-04-16  912  		goto lock;
d5eb4ad2dfb2df Thomas Gleixner 2011-02-12  913  
31d9d9b6d83030 Marc Zyngier    2011-09-23  914  	if (check & _IRQ_DESC_CHECK) {
31d9d9b6d83030 Marc Zyngier    2011-09-23  915  		if ((check & _IRQ_DESC_PERCPU) &&
31d9d9b6d83030 Marc Zyngier    2011-09-23  916  		    !irq_settings_is_per_cpu_devid(desc))
752346dda9011a Andy Shevchenko 2025-04-16  917  			goto lock;
31d9d9b6d83030 Marc Zyngier    2011-09-23  918  
31d9d9b6d83030 Marc Zyngier    2011-09-23  919  		if (!(check & _IRQ_DESC_PERCPU) &&
31d9d9b6d83030 Marc Zyngier    2011-09-23  920  		    irq_settings_is_per_cpu_devid(desc))
752346dda9011a Andy Shevchenko 2025-04-16  921  			goto lock;
31d9d9b6d83030 Marc Zyngier    2011-09-23  922  	}
31d9d9b6d83030 Marc Zyngier    2011-09-23  923  
d5eb4ad2dfb2df Thomas Gleixner 2011-02-12  924  	if (bus)
d5eb4ad2dfb2df Thomas Gleixner 2011-02-12  925  		chip_bus_lock(desc);
d5eb4ad2dfb2df Thomas Gleixner 2011-02-12  926  	raw_spin_lock_irqsave(&desc->lock, *flags);
cd49c072791316 Andy Shevchenko 2025-04-16  927  
d5eb4ad2dfb2df Thomas Gleixner 2011-02-12  928  	return desc;
752346dda9011a Andy Shevchenko 2025-04-16  929  
752346dda9011a Andy Shevchenko 2025-04-16  930  lock:
752346dda9011a Andy Shevchenko 2025-04-16 @931  	__acquire(&desc->lock);
752346dda9011a Andy Shevchenko 2025-04-16  932  	return NULL;
d5eb4ad2dfb2df Thomas Gleixner 2011-02-12  933  }
d5eb4ad2dfb2df Thomas Gleixner 2011-02-12  934  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH v1 0/2] genirq/irqdesc: Make sparse happy
@ 2025-04-16 11:40 Andy Shevchenko
  2025-04-16 11:40 ` [PATCH v1 2/2] genirq/irqdesc: Balance locking to make " Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2025-04-16 11:40 UTC (permalink / raw)
  To: Thomas Gleixner, linux-kernel; +Cc: Andy Shevchenko

There is a conditional locking that sparse is not happy about.
Fix it by the respective code refactoring and using available
annotations.

Andy Shevchenko (2):
  genirq/irqdesc: Decrease indentation level in __irq_get_desc_lock()
  genirq/irqdesc: Balance locking to make sparse happy

 kernel/irq/irqdesc.c | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)

-- 
2.47.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-17 15:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-17 15:36 [PATCH v1 2/2] genirq/irqdesc: Balance locking to make sparse happy kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2025-04-16 11:40 [PATCH v1 0/2] genirq/irqdesc: Make " Andy Shevchenko
2025-04-16 11:40 ` [PATCH v1 2/2] genirq/irqdesc: Balance locking to make " Andy Shevchenko
2025-04-16 11:52   ` Andy Shevchenko
2025-04-16 11:53     ` Andy Shevchenko

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.