* [android-common:upstream-linux-5.10.y 0/334] drivers/scsi/scsi_lib.c:321:16: warning: mixing declarations and code is a C99 extension
@ 2026-03-05 3:56 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-03-05 3:56 UTC (permalink / raw)
To: cros-kernel-buildreports; +Cc: oe-kbuild-all
tree: https://android.googlesource.com/kernel/common upstream-linux-5.10.y
head: aed5c3b77cd53ba74f66767b03bfb9177662af4b
commit: cc872e35c0df80062abc71268d690a2f749e542e [0/334] scsi: core: Wake up the error handler when final completions race against each other
config: x86_64-buildonly-randconfig-002-20260305 (https://download.01.org/0day-ci/archive/20260305/202603051152.AzF904IE-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 9a109fbb6e184ec9bcce10615949f598f4c974a9)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260305/202603051152.AzF904IE-lkp@intel.com/reproduce)
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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603051152.AzF904IE-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/scsi/scsi_lib.c:321:16: warning: mixing declarations and code is a C99 extension [-Wdeclaration-after-statement]
321 | unsigned int busy = scsi_host_busy(shost);
| ^
1 warning generated.
vim +321 drivers/scsi/scsi_lib.c
392160335c798b James Bottomley 2005-06-15 296
3bd6f43f5cb371 Bart Van Assche 2017-12-04 297 /*
6eb045e092efef Ming Lei 2019-10-25 298 * Wake up the error handler if necessary. Avoid as follows that the error
6eb045e092efef Ming Lei 2019-10-25 299 * handler is not woken up if host in-flight requests number ==
6eb045e092efef Ming Lei 2019-10-25 300 * shost->host_failed: use call_rcu() in scsi_eh_scmd_add() in combination
6eb045e092efef Ming Lei 2019-10-25 301 * with an RCU read lock in this function to ensure that this function in
6eb045e092efef Ming Lei 2019-10-25 302 * its entirety either finishes before scsi_eh_scmd_add() increases the
3bd6f43f5cb371 Bart Van Assche 2017-12-04 303 * host_failed counter or that it notices the shost state change made by
3bd6f43f5cb371 Bart Van Assche 2017-12-04 304 * scsi_eh_scmd_add().
3bd6f43f5cb371 Bart Van Assche 2017-12-04 305 */
6eb045e092efef Ming Lei 2019-10-25 306 static void scsi_dec_host_busy(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
^1da177e4c3f41 Linus Torvalds 2005-04-16 307 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 308 unsigned long flags;
^1da177e4c3f41 Linus Torvalds 2005-04-16 309
3bd6f43f5cb371 Bart Van Assche 2017-12-04 310 rcu_read_lock();
6eb045e092efef Ming Lei 2019-10-25 311 __clear_bit(SCMD_STATE_INFLIGHT, &cmd->state);
3bd6f43f5cb371 Bart Van Assche 2017-12-04 312 if (unlikely(scsi_host_in_recovery(shost))) {
cc872e35c0df80 David Jeffery 2026-01-13 313 /*
cc872e35c0df80 David Jeffery 2026-01-13 314 * Ensure the clear of SCMD_STATE_INFLIGHT is visible to
cc872e35c0df80 David Jeffery 2026-01-13 315 * other CPUs before counting busy requests. Otherwise,
cc872e35c0df80 David Jeffery 2026-01-13 316 * reordering can cause CPUs to race and miss an eh wakeup
cc872e35c0df80 David Jeffery 2026-01-13 317 * when no CPU sees all busy requests as done or timed out.
cc872e35c0df80 David Jeffery 2026-01-13 318 */
cc872e35c0df80 David Jeffery 2026-01-13 319 smp_mb();
cc872e35c0df80 David Jeffery 2026-01-13 320
9878c660d1f0d3 Ming Lei 2024-02-03 @321 unsigned int busy = scsi_host_busy(shost);
9878c660d1f0d3 Ming Lei 2024-02-03 322
74665016086615 Christoph Hellwig 2014-01-22 323 spin_lock_irqsave(shost->host_lock, flags);
3bd6f43f5cb371 Bart Van Assche 2017-12-04 324 if (shost->host_failed || shost->host_eh_scheduled)
9878c660d1f0d3 Ming Lei 2024-02-03 325 scsi_eh_wakeup(shost, busy);
74665016086615 Christoph Hellwig 2014-01-22 326 spin_unlock_irqrestore(shost->host_lock, flags);
74665016086615 Christoph Hellwig 2014-01-22 327 }
3bd6f43f5cb371 Bart Van Assche 2017-12-04 328 rcu_read_unlock();
3bd6f43f5cb371 Bart Van Assche 2017-12-04 329 }
3bd6f43f5cb371 Bart Van Assche 2017-12-04 330
:::::: The code at line 321 was first introduced by commit
:::::: 9878c660d1f0d37715547668adf241b5fb171dc1 scsi: core: Move scsi_host_busy() out of host lock if it is for per-command
:::::: TO: Ming Lei <ming.lei@redhat.com>
:::::: CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-03-05 4:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-05 3:56 [android-common:upstream-linux-5.10.y 0/334] drivers/scsi/scsi_lib.c:321:16: warning: mixing declarations and code is a C99 extension 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.