From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: lib/test_context-analysis.c:114 test_spinlock_trylock_extra() warn: mixing irq and irqsave
Date: Sat, 08 Aug 2026 05:58:26 +0800 [thread overview]
Message-ID: <202608080540.g9LgU6ec-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Marco Elver <elver@google.com>
CC: Peter Zijlstra <peterz@infradead.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 3f008280327ba5ad132965abab0c7846283cef0c
commit: f16a802d402d735a55731f8c94952b3bbb5ddfe8 locking/rwlock, spinlock: Support Clang's context analysis
date: 7 months ago
:::::: branch date: 2 hours ago
:::::: commit date: 7 months ago
config: openrisc-randconfig-r073-20260807 (https://download.01.org/0day-ci/archive/20260808/202608080540.g9LgU6ec-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 10.5.0
smatch: v0.5.0-9187-g5189e3fb
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
| Fixes: f16a802d402d ("locking/rwlock, spinlock: Support Clang's context analysis")
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202608080540.g9LgU6ec-lkp@intel.com/
New smatch warnings:
lib/test_context-analysis.c:114 test_spinlock_trylock_extra() warn: mixing irq and irqsave
Old smatch warnings:
lib/test_context-analysis.c:90 test_raw_spinlock_trylock_extra() warn: mixing irq and irqsave
include/linux/spinlock.h:556 class_raw_spinlock_try_constructor() warn: passing zero to 'ERR_PTR'
include/linux/spinlock.h:604 class_spinlock_try_constructor() warn: passing zero to 'ERR_PTR'
vim +114 lib/test_context-analysis.c
f16a802d402d73 Marco Elver 2025-12-19 98
f16a802d402d73 Marco Elver 2025-12-19 99 TEST_SPINLOCK_COMMON(spinlock,
f16a802d402d73 Marco Elver 2025-12-19 100 spinlock_t,
f16a802d402d73 Marco Elver 2025-12-19 101 spin_lock_init,
f16a802d402d73 Marco Elver 2025-12-19 102 spin_lock,
f16a802d402d73 Marco Elver 2025-12-19 103 spin_unlock,
f16a802d402d73 Marco Elver 2025-12-19 104 spin_trylock,
f16a802d402d73 Marco Elver 2025-12-19 105 TEST_OP_RW);
f16a802d402d73 Marco Elver 2025-12-19 106 static void __used test_spinlock_trylock_extra(struct test_spinlock_data *d)
f16a802d402d73 Marco Elver 2025-12-19 107 {
f16a802d402d73 Marco Elver 2025-12-19 108 unsigned long flags;
f16a802d402d73 Marco Elver 2025-12-19 109
f16a802d402d73 Marco Elver 2025-12-19 110 if (spin_trylock_irq(&d->lock)) {
f16a802d402d73 Marco Elver 2025-12-19 111 d->counter++;
f16a802d402d73 Marco Elver 2025-12-19 112 spin_unlock_irq(&d->lock);
f16a802d402d73 Marco Elver 2025-12-19 113 }
f16a802d402d73 Marco Elver 2025-12-19 @114 if (spin_trylock_irqsave(&d->lock, flags)) {
f16a802d402d73 Marco Elver 2025-12-19 115 d->counter++;
f16a802d402d73 Marco Elver 2025-12-19 116 spin_unlock_irqrestore(&d->lock, flags);
f16a802d402d73 Marco Elver 2025-12-19 117 }
f16a802d402d73 Marco Elver 2025-12-19 118 scoped_cond_guard(spinlock_try, return, &d->lock) {
f16a802d402d73 Marco Elver 2025-12-19 119 d->counter++;
f16a802d402d73 Marco Elver 2025-12-19 120 }
f16a802d402d73 Marco Elver 2025-12-19 121 }
f16a802d402d73 Marco Elver 2025-12-19 122
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-08-07 21:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202608080540.g9LgU6ec-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.