From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [hare-scsi-devel:scsi-result-rework 137/146] drivers/scsi/scsi_debug.c:5441:9: error: 'scsi_result' undeclared; did you mean 'scsi_request'?
Date: Thu, 22 Apr 2021 15:31:09 +0800 [thread overview]
Message-ID: <202104221558.YfXltmLs-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 36017 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git scsi-result-rework
head: 19720ea7b22b443a182646eef7edc36e32e7b515
commit: 06067178668aa7d94b6e554575795dfc561bfa14 [137/146] scsi_debug: split scsi_status argument to schedule_resp()
config: mips-randconfig-r016-20210421 (attached as .config)
compiler: mips64el-linux-gcc (GCC) 9.3.0
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
# https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commit/?id=06067178668aa7d94b6e554575795dfc561bfa14
git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel scsi-result-rework
git checkout 06067178668aa7d94b6e554575795dfc561bfa14
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
4588 | static void zbc_finish_zone(struct sdebug_dev_info *devip,
| ^~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:4604:13: error: invalid storage class for function 'zbc_finish_all'
4604 | static void zbc_finish_all(struct sdebug_dev_info *devip)
| ^~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:4612:12: error: invalid storage class for function 'resp_finish_zone'
4612 | static int resp_finish_zone(struct scsi_cmnd *scp,
| ^~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:4661:13: error: invalid storage class for function 'zbc_rwp_zone'
4661 | static void zbc_rwp_zone(struct sdebug_dev_info *devip,
| ^~~~~~~~~~~~
drivers/scsi/scsi_debug.c:4681:13: error: invalid storage class for function 'zbc_rwp_all'
4681 | static void zbc_rwp_all(struct sdebug_dev_info *devip)
| ^~~~~~~~~~~
drivers/scsi/scsi_debug.c:4689:12: error: invalid storage class for function 'resp_rwp_zone'
4689 | static int resp_rwp_zone(struct scsi_cmnd *scp, struct sdebug_dev_info *devip)
| ^~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:4736:29: error: invalid storage class for function 'get_queue'
4736 | static struct sdebug_queue *get_queue(struct scsi_cmnd *cmnd)
| ^~~~~~~~~
drivers/scsi/scsi_debug.c:4750:12: error: invalid storage class for function 'get_tag'
4750 | static u32 get_tag(struct scsi_cmnd *cmnd)
| ^~~~~~~
drivers/scsi/scsi_debug.c:4756:13: error: invalid storage class for function 'sdebug_q_cmd_complete'
4756 | static void sdebug_q_cmd_complete(struct sdebug_defer *sd_dp)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:4830:29: error: invalid storage class for function 'sdebug_q_cmd_hrt_complete'
4830 | static enum hrtimer_restart sdebug_q_cmd_hrt_complete(struct hrtimer *timer)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:4839:13: error: invalid storage class for function 'sdebug_q_cmd_wq_complete'
4839 | static void sdebug_q_cmd_wq_complete(struct work_struct *work)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:4849:12: error: invalid storage class for function 'sdebug_device_create_zones'
4849 | static int sdebug_device_create_zones(struct sdebug_dev_info *devip)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:4935:32: error: invalid storage class for function 'sdebug_device_create'
4935 | static struct sdebug_dev_info *sdebug_device_create(
| ^~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:4971:32: error: invalid storage class for function 'find_build_dev_info'
4971 | static struct sdebug_dev_info *find_build_dev_info(struct scsi_device *sdev)
| ^~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5011:12: error: invalid storage class for function 'scsi_debug_slave_alloc'
5011 | static int scsi_debug_slave_alloc(struct scsi_device *sdp)
| ^~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5019:12: error: invalid storage class for function 'scsi_debug_slave_configure'
5019 | static int scsi_debug_slave_configure(struct scsi_device *sdp)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5041:13: error: invalid storage class for function 'scsi_debug_slave_destroy'
5041 | static void scsi_debug_slave_destroy(struct scsi_device *sdp)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5056:13: error: invalid storage class for function 'stop_qc_helper'
5056 | static void stop_qc_helper(struct sdebug_defer *sd_dp,
| ^~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5069:13: error: invalid storage class for function 'stop_queued_cmnd'
5069 | static bool stop_queued_cmnd(struct scsi_cmnd *cmnd)
| ^~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5114:13: error: invalid storage class for function 'stop_all_queued'
5114 | static void stop_all_queued(void)
| ^~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5153:13: error: invalid storage class for function 'free_all_queued'
5153 | static void free_all_queued(void)
| ^~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5168:12: error: invalid storage class for function 'scsi_debug_abort'
5168 | static int scsi_debug_abort(struct scsi_cmnd *SCpnt)
| ^~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5183:12: error: invalid storage class for function 'scsi_debug_device_reset'
5183 | static int scsi_debug_device_reset(struct scsi_cmnd *SCpnt)
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5199:12: error: invalid storage class for function 'scsi_debug_target_reset'
5199 | static int scsi_debug_target_reset(struct scsi_cmnd *SCpnt)
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5235:12: error: invalid storage class for function 'scsi_debug_bus_reset'
5235 | static int scsi_debug_bus_reset(struct scsi_cmnd *SCpnt)
| ^~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5268:12: error: invalid storage class for function 'scsi_debug_host_reset'
5268 | static int scsi_debug_host_reset(struct scsi_cmnd *SCpnt)
| ^~~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5293:13: error: invalid storage class for function 'sdebug_build_parts'
5293 | static void sdebug_build_parts(unsigned char *ramp, unsigned long store_size)
| ^~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5346:13: error: invalid storage class for function 'block_unblock_all_queues'
5346 | static void block_unblock_all_queues(bool block)
| ^~~~~~~~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5358:13: error: invalid storage class for function 'tweak_cmnd_count'
5358 | static void tweak_cmnd_count(void)
| ^~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5371:13: error: invalid storage class for function 'clear_queue_stats'
5371 | static void clear_queue_stats(void)
| ^~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5379:13: error: invalid storage class for function 'inject_on_this_cmd'
5379 | static bool inject_on_this_cmd(void)
| ^~~~~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5393:12: error: invalid storage class for function 'schedule_resp'
5393 | static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip,
| ^~~~~~~~~~~~~
In file included from include/linux/kernel.h:10,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/scsi/scsi_debug.c:18:
drivers/scsi/scsi_debug.c: In function 'schedule_resp':
>> drivers/scsi/scsi_debug.c:5441:9: error: 'scsi_result' undeclared (first use in this function); did you mean 'scsi_request'?
5441 | (scsi_result == 0))) {
| ^~~~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
drivers/scsi/scsi_debug.c:5441:9: note: each undeclared identifier is reported only once for each function it appears in
5441 | (scsi_result == 0))) {
| ^~~~~~~~~~~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
>> drivers/scsi/scsi_debug.c:5514:38: error: expected ';' before '}' token
5514 | set_status_byte(cmnd, status_byte)
| ^
| ;
5515 | }
| ~
In file included from include/linux/module.h:21,
from drivers/scsi/scsi_debug.c:18:
drivers/scsi/scsi_debug.c: In function 'p_fill_from_dev_buffer':
include/linux/moduleparam.h:409:38: error: invalid storage class for function '__check_add_host'
409 | static inline type __always_unused *__check_##name(void) { return(p); }
| ^~~~~~~~
include/linux/moduleparam.h:429:34: note: in expansion of macro '__param_check'
429 | #define param_check_int(name, p) __param_check(name, p, int)
| ^~~~~~~~~~~~~
include/linux/moduleparam.h:150:2: note: in expansion of macro 'param_check_int'
150 | param_check_##type(name, &(value)); \
| ^~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5650:1: note: in expansion of macro 'module_param_named'
5650 | module_param_named(add_host, sdebug_add_host, int, S_IRUGO | S_IWUSR);
| ^~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:289:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
289 | static const char __param_str_##name[] = prefix #name; \
| ^~~~~~
include/linux/moduleparam.h:176:2: note: in expansion of macro '__module_param_call'
176 | __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1, 0)
| ^~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:151:2: note: in expansion of macro 'module_param_cb'
151 | module_param_cb(name, ¶m_ops_##type, &value, perm); \
| ^~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5650:1: note: in expansion of macro 'module_param_named'
5650 | module_param_named(add_host, sdebug_add_host, int, S_IRUGO | S_IWUSR);
| ^~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:409:38: error: invalid storage class for function '__check_ato'
409 | static inline type __always_unused *__check_##name(void) { return(p); }
| ^~~~~~~~
include/linux/moduleparam.h:429:34: note: in expansion of macro '__param_check'
429 | #define param_check_int(name, p) __param_check(name, p, int)
| ^~~~~~~~~~~~~
include/linux/moduleparam.h:150:2: note: in expansion of macro 'param_check_int'
150 | param_check_##type(name, &(value)); \
| ^~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5651:1: note: in expansion of macro 'module_param_named'
5651 | module_param_named(ato, sdebug_ato, int, S_IRUGO);
| ^~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:289:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
289 | static const char __param_str_##name[] = prefix #name; \
| ^~~~~~
include/linux/moduleparam.h:176:2: note: in expansion of macro '__module_param_call'
176 | __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1, 0)
| ^~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:151:2: note: in expansion of macro 'module_param_cb'
151 | module_param_cb(name, ¶m_ops_##type, &value, perm); \
| ^~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5651:1: note: in expansion of macro 'module_param_named'
5651 | module_param_named(ato, sdebug_ato, int, S_IRUGO);
| ^~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:409:38: error: invalid storage class for function '__check_cdb_len'
409 | static inline type __always_unused *__check_##name(void) { return(p); }
| ^~~~~~~~
include/linux/moduleparam.h:429:34: note: in expansion of macro '__param_check'
429 | #define param_check_int(name, p) __param_check(name, p, int)
| ^~~~~~~~~~~~~
include/linux/moduleparam.h:150:2: note: in expansion of macro 'param_check_int'
150 | param_check_##type(name, &(value)); \
| ^~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5652:1: note: in expansion of macro 'module_param_named'
5652 | module_param_named(cdb_len, sdebug_cdb_len, int, 0644);
| ^~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:289:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
289 | static const char __param_str_##name[] = prefix #name; \
| ^~~~~~
include/linux/moduleparam.h:176:2: note: in expansion of macro '__module_param_call'
176 | __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1, 0)
| ^~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:151:2: note: in expansion of macro 'module_param_cb'
151 | module_param_cb(name, ¶m_ops_##type, &value, perm); \
| ^~~~~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5652:1: note: in expansion of macro 'module_param_named'
5652 | module_param_named(cdb_len, sdebug_cdb_len, int, 0644);
| ^~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:409:38: error: invalid storage class for function '__check_clustering'
409 | static inline type __always_unused *__check_##name(void) { return(p); }
| ^~~~~~~~
include/linux/moduleparam.h:466:35: note: in expansion of macro '__param_check'
466 | #define param_check_bool(name, p) __param_check(name, p, bool)
| ^~~~~~~~~~~~~
include/linux/moduleparam.h:150:2: note: in expansion of macro 'param_check_bool'
150 | param_check_##type(name, &(value)); \
| ^~~~~~~~~~~~
drivers/scsi/scsi_debug.c:5653:1: note: in expansion of macro 'module_param_named'
5653 | module_param_named(clustering, sdebug_clustering, bool, S_IRUGO | S_IWUSR);
| ^~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:289:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
289 | static const char __param_str_##name[] = prefix #name; \
| ^~~~~~
include/linux/moduleparam.h:176:2: note: in expansion of macro '__module_param_call'
176 | __module_param_call(MODULE_PARAM_PREFIX, name, ops, arg, perm, -1, 0)
| ^~~~~~~~~~~~~~~~~~~
include/linux/moduleparam.h:151:2: note: in expansion of macro 'module_param_cb'
151 | module_param_cb(name, ¶m_ops_##type, &value, perm); \
vim +5441 drivers/scsi/scsi_debug.c
a2aede970a8e12 Douglas Gilbert 2020-04-21 5387
c483739430f107 Douglas Gilbert 2016-05-06 5388 /* Complete the processing of the thread that queued a SCSI command to this
c483739430f107 Douglas Gilbert 2016-05-06 5389 * driver. It either completes the command by calling cmnd_done() or
c483739430f107 Douglas Gilbert 2016-05-06 5390 * schedules a hr timer or work queue then returns 0. Returns
c483739430f107 Douglas Gilbert 2016-05-06 5391 * SCSI_MLQUEUE_HOST_BUSY if temporarily out of resources.
c483739430f107 Douglas Gilbert 2016-05-06 5392 */
fd32119b0deac1 Douglas Gilbert 2016-04-25 5393 static int schedule_resp(struct scsi_cmnd *cmnd, struct sdebug_dev_info *devip,
06067178668aa7 Hannes Reinecke 2021-04-21 5394 unsigned char host_byte, unsigned char status_byte,
f66b85171a0ebd Martin Wilck 2018-02-14 5395 int (*pfp)(struct scsi_cmnd *,
f66b85171a0ebd Martin Wilck 2018-02-14 5396 struct sdebug_dev_info *),
f66b85171a0ebd Martin Wilck 2018-02-14 5397 int delta_jiff, int ndelay)
^1da177e4c3f41 Linus Torvalds 2005-04-16 5398 {
a2aede970a8e12 Douglas Gilbert 2020-04-21 5399 bool new_sd_dp;
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5400 bool inject = false;
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5401 bool qfull = false;
771f712ba5b0c6 Douglas Gilbert 2021-03-03 5402 bool hipri = (cmnd->request->cmd_flags & REQ_HIPRI);
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5403 int k, num_in_q, qdepth;
a2aede970a8e12 Douglas Gilbert 2020-04-21 5404 unsigned long iflags;
a2aede970a8e12 Douglas Gilbert 2020-04-21 5405 u64 ns_from_boot = 0;
c483739430f107 Douglas Gilbert 2016-05-06 5406 struct sdebug_queue *sqp;
c483739430f107 Douglas Gilbert 2016-05-06 5407 struct sdebug_queued_cmd *sqcp;
299b6c07ea134d Tomas Winkler 2015-07-28 5408 struct scsi_device *sdp;
a10bc12af6347d Douglas Gilbert 2016-04-25 5409 struct sdebug_defer *sd_dp;
299b6c07ea134d Tomas Winkler 2015-07-28 5410
b01f6f8316af52 Douglas Gilbert 2016-04-30 5411 if (unlikely(devip == NULL)) {
06067178668aa7 Hannes Reinecke 2021-04-21 5412 if (host_byte == DID_OK)
06067178668aa7 Hannes Reinecke 2021-04-21 5413 host_byte = DID_NO_CONNECT;
f46eb0e9fc763b Douglas Gilbert 2016-04-25 5414 goto respond_in_thread;
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5415 }
299b6c07ea134d Tomas Winkler 2015-07-28 5416 sdp = cmnd->device;
299b6c07ea134d Tomas Winkler 2015-07-28 5417
cd62b7dae245dd Douglas Gilbert 2014-08-05 5418 if (delta_jiff == 0)
cd62b7dae245dd Douglas Gilbert 2014-08-05 5419 goto respond_in_thread;
^1da177e4c3f41 Linus Torvalds 2005-04-16 5420
c483739430f107 Douglas Gilbert 2016-05-06 5421 sqp = get_queue(cmnd);
c483739430f107 Douglas Gilbert 2016-05-06 5422 spin_lock_irqsave(&sqp->qc_lock, iflags);
c483739430f107 Douglas Gilbert 2016-05-06 5423 if (unlikely(atomic_read(&sqp->blocked))) {
c483739430f107 Douglas Gilbert 2016-05-06 5424 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
c483739430f107 Douglas Gilbert 2016-05-06 5425 return SCSI_MLQUEUE_HOST_BUSY;
c483739430f107 Douglas Gilbert 2016-05-06 5426 }
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5427 num_in_q = atomic_read(&devip->num_in_q);
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5428 qdepth = cmnd->device->queue_depth;
f46eb0e9fc763b Douglas Gilbert 2016-04-25 5429 if (unlikely((qdepth > 0) && (num_in_q >= qdepth))) {
06067178668aa7 Hannes Reinecke 2021-04-21 5430 if (host_byte != DID_OK || status_byte != SAM_STAT_GOOD) {
c483739430f107 Douglas Gilbert 2016-05-06 5431 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
cd62b7dae245dd Douglas Gilbert 2014-08-05 5432 goto respond_in_thread;
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5433 } else {
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5434 device_qfull_result(scp);
06067178668aa7 Hannes Reinecke 2021-04-21 5435 host_byte = get_host_byte(scp);
06067178668aa7 Hannes Reinecke 2021-04-21 5436 status_byte = get_status_byte(scp);
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5437 qfull = true;
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5438 }
c483739430f107 Douglas Gilbert 2016-05-06 5439 } else if (unlikely(sdebug_every_nth &&
773642d95b8220 Douglas Gilbert 2016-04-25 5440 (SDEBUG_OPT_RARE_TSF & sdebug_opts) &&
f46eb0e9fc763b Douglas Gilbert 2016-04-25 @5441 (scsi_result == 0))) {
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5442 if ((num_in_q == (qdepth - 1)) &&
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5443 (atomic_inc_return(&sdebug_a_tsf) >=
773642d95b8220 Douglas Gilbert 2016-04-25 5444 abs(sdebug_every_nth))) {
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5445 atomic_set(&sdebug_a_tsf, 0);
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5446 inject = true;
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5447 device_qfull_result(scp);
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5448 qfull = true;
06067178668aa7 Hannes Reinecke 2021-04-21 5449 host_byte = get_host_byte(scp);
06067178668aa7 Hannes Reinecke 2021-04-21 5450 status_byte = get_status_byte(scp);
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5451 }
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5452 }
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5453
c483739430f107 Douglas Gilbert 2016-05-06 5454 k = find_first_zero_bit(sqp->in_use_bm, sdebug_max_queue);
f46eb0e9fc763b Douglas Gilbert 2016-04-25 5455 if (unlikely(k >= sdebug_max_queue)) {
c483739430f107 Douglas Gilbert 2016-05-06 5456 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
06067178668aa7 Hannes Reinecke 2021-04-21 5457 if (host_byte != DID_OK || status_byte != SAM_STAT_GOOD)
cd62b7dae245dd Douglas Gilbert 2014-08-05 5458 goto respond_in_thread;
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5459 else if (SDEBUG_OPT_ALL_TSF & sdebug_opts) {
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5460 device_qfull_result(scp);
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5461 qfull = true;
06067178668aa7 Hannes Reinecke 2021-04-21 5462 host_byte = get_host_byte(scp);
06067178668aa7 Hannes Reinecke 2021-04-21 5463 status_byte = get_status_byte(scp);
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5464 }
773642d95b8220 Douglas Gilbert 2016-04-25 5465 if (SDEBUG_OPT_Q_NOISE & sdebug_opts)
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5466 sdev_printk(KERN_INFO, sdp,
cd62b7dae245dd Douglas Gilbert 2014-08-05 5467 "%s: max_queue=%d exceeded, %s\n",
773642d95b8220 Douglas Gilbert 2016-04-25 5468 __func__, sdebug_max_queue,
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5469 (qfull ? "status: TASK SET FULL" :
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5470 "report: host busy"));
06067178668aa7 Hannes Reinecke 2021-04-21 5471 if (host_byte != DID_OK || status_byte != SAM_STAT_GOOD)
cd62b7dae245dd Douglas Gilbert 2014-08-05 5472 goto respond_in_thread;
cd62b7dae245dd Douglas Gilbert 2014-08-05 5473 else
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5474 return SCSI_MLQUEUE_HOST_BUSY;
^1da177e4c3f41 Linus Torvalds 2005-04-16 5475 }
74595c044cb56c Douglas Gilbert 2020-07-02 5476 set_bit(k, sqp->in_use_bm);
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5477 atomic_inc(&devip->num_in_q);
c483739430f107 Douglas Gilbert 2016-05-06 5478 sqcp = &sqp->qc_arr[k];
^1da177e4c3f41 Linus Torvalds 2005-04-16 5479 sqcp->a_cmnd = cmnd;
c483739430f107 Douglas Gilbert 2016-05-06 5480 cmnd->host_scribble = (unsigned char *)sqcp;
a10bc12af6347d Douglas Gilbert 2016-04-25 5481 sd_dp = sqcp->sd_dp;
c483739430f107 Douglas Gilbert 2016-05-06 5482 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
c4b57d89bad828 Kashyap Desai 2021-02-15 5483
74595c044cb56c Douglas Gilbert 2020-07-02 5484 if (!sd_dp) {
10bde980ac18da Douglas Gilbert 2018-01-10 5485 sd_dp = kzalloc(sizeof(*sd_dp), GFP_ATOMIC);
74595c044cb56c Douglas Gilbert 2020-07-02 5486 if (!sd_dp) {
74595c044cb56c Douglas Gilbert 2020-07-02 5487 atomic_dec(&devip->num_in_q);
74595c044cb56c Douglas Gilbert 2020-07-02 5488 clear_bit(k, sqp->in_use_bm);
10bde980ac18da Douglas Gilbert 2018-01-10 5489 return SCSI_MLQUEUE_HOST_BUSY;
74595c044cb56c Douglas Gilbert 2020-07-02 5490 }
a2aede970a8e12 Douglas Gilbert 2020-04-21 5491 new_sd_dp = true;
a2aede970a8e12 Douglas Gilbert 2020-04-21 5492 } else {
a2aede970a8e12 Douglas Gilbert 2020-04-21 5493 new_sd_dp = false;
10bde980ac18da Douglas Gilbert 2018-01-10 5494 }
f66b85171a0ebd Martin Wilck 2018-02-14 5495
c10fa55f5e7ad3 John Garry 2020-07-09 5496 /* Set the hostwide tag */
c10fa55f5e7ad3 John Garry 2020-07-09 5497 if (sdebug_host_max_queue)
c10fa55f5e7ad3 John Garry 2020-07-09 5498 sd_dp->hc_idx = get_tag(cmnd);
c10fa55f5e7ad3 John Garry 2020-07-09 5499
771f712ba5b0c6 Douglas Gilbert 2021-03-03 5500 if (hipri)
a2aede970a8e12 Douglas Gilbert 2020-04-21 5501 ns_from_boot = ktime_get_boottime_ns();
a2aede970a8e12 Douglas Gilbert 2020-04-21 5502
a2aede970a8e12 Douglas Gilbert 2020-04-21 5503 /* one of the resp_*() response functions is called here */
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5504 cmnd->result = pfp ? pfp(cmnd, devip) : 0;
f66b85171a0ebd Martin Wilck 2018-02-14 5505 if (cmnd->result & SDEG_RES_IMMED_MASK) {
f66b85171a0ebd Martin Wilck 2018-02-14 5506 cmnd->result &= ~SDEG_RES_IMMED_MASK;
f66b85171a0ebd Martin Wilck 2018-02-14 5507 delta_jiff = ndelay = 0;
f66b85171a0ebd Martin Wilck 2018-02-14 5508 }
06067178668aa7 Hannes Reinecke 2021-04-21 5509 if (scsi_result_is_good(cmnd) &&
06067178668aa7 Hannes Reinecke 2021-04-21 5510 (host_byte != DID_OK || status_byte != SAM_STAT_GOOD)) {
06067178668aa7 Hannes Reinecke 2021-04-21 5511 if (host_byte != DID_OK)
06067178668aa7 Hannes Reinecke 2021-04-21 5512 set_host_byte(cmnd, host_byte);
06067178668aa7 Hannes Reinecke 2021-04-21 5513 if (status_byte != SAM_STAT_GOOD)
06067178668aa7 Hannes Reinecke 2021-04-21 @5514 set_status_byte(cmnd, status_byte)
06067178668aa7 Hannes Reinecke 2021-04-21 5515 }
941c01f1d8b12b Hannes Reinecke 2021-04-21 5516 if (scsi_result_is_good(cmnd) &&
941c01f1d8b12b Hannes Reinecke 2021-04-21 5517 unlikely(sdebug_opts & SDEBUG_OPT_TRANSPORT_ERR)) {
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5518 if (atomic_read(&sdeb_inject_pending)) {
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5519 mk_sense_buffer(cmnd, ABORTED_COMMAND, TRANSPORT_PROBLEM, ACK_NAK_TO);
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5520 atomic_set(&sdeb_inject_pending, 0);
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5521 }
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5522 }
f66b85171a0ebd Martin Wilck 2018-02-14 5523
941c01f1d8b12b Hannes Reinecke 2021-04-21 5524 if (unlikely(sdebug_verbose && !scsi_result_is_good(cmnd)))
f66b85171a0ebd Martin Wilck 2018-02-14 5525 sdev_printk(KERN_INFO, sdp, "%s: non-zero result=0x%x\n",
06067178668aa7 Hannes Reinecke 2021-04-21 5526 __func__, scsi_get_compat_result(cmnd));
f66b85171a0ebd Martin Wilck 2018-02-14 5527
10bde980ac18da Douglas Gilbert 2018-01-10 5528 if (delta_jiff > 0 || ndelay > 0) {
b333a819813c75 Douglas Gilbert 2016-04-25 5529 ktime_t kt;
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5530
b333a819813c75 Douglas Gilbert 2016-04-25 5531 if (delta_jiff > 0) {
0c4bc91d664953 Douglas Gilbert 2020-04-21 5532 u64 ns = jiffies_to_nsecs(delta_jiff);
0c4bc91d664953 Douglas Gilbert 2020-04-21 5533
0c4bc91d664953 Douglas Gilbert 2020-04-21 5534 if (sdebug_random && ns < U32_MAX) {
0c4bc91d664953 Douglas Gilbert 2020-04-21 5535 ns = prandom_u32_max((u32)ns);
0c4bc91d664953 Douglas Gilbert 2020-04-21 5536 } else if (sdebug_random) {
0c4bc91d664953 Douglas Gilbert 2020-04-21 5537 ns >>= 12; /* scale to 4 usec precision */
0c4bc91d664953 Douglas Gilbert 2020-04-21 5538 if (ns < U32_MAX) /* over 4 hours max */
0c4bc91d664953 Douglas Gilbert 2020-04-21 5539 ns = prandom_u32_max((u32)ns);
0c4bc91d664953 Douglas Gilbert 2020-04-21 5540 ns <<= 12;
0c4bc91d664953 Douglas Gilbert 2020-04-21 5541 }
0c4bc91d664953 Douglas Gilbert 2020-04-21 5542 kt = ns_to_ktime(ns);
0c4bc91d664953 Douglas Gilbert 2020-04-21 5543 } else { /* ndelay has a 4.2 second max */
0c4bc91d664953 Douglas Gilbert 2020-04-21 5544 kt = sdebug_random ? prandom_u32_max((u32)ndelay) :
0c4bc91d664953 Douglas Gilbert 2020-04-21 5545 (u32)ndelay;
a2aede970a8e12 Douglas Gilbert 2020-04-21 5546 if (ndelay < INCLUSIVE_TIMING_MAX_NS) {
a2aede970a8e12 Douglas Gilbert 2020-04-21 5547 u64 d = ktime_get_boottime_ns() - ns_from_boot;
a2aede970a8e12 Douglas Gilbert 2020-04-21 5548
a2aede970a8e12 Douglas Gilbert 2020-04-21 5549 if (kt <= d) { /* elapsed duration >= kt */
223f91b4807922 Douglas Gilbert 2020-08-13 5550 spin_lock_irqsave(&sqp->qc_lock, iflags);
a2aede970a8e12 Douglas Gilbert 2020-04-21 5551 sqcp->a_cmnd = NULL;
a2aede970a8e12 Douglas Gilbert 2020-04-21 5552 atomic_dec(&devip->num_in_q);
a2aede970a8e12 Douglas Gilbert 2020-04-21 5553 clear_bit(k, sqp->in_use_bm);
223f91b4807922 Douglas Gilbert 2020-08-13 5554 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
a2aede970a8e12 Douglas Gilbert 2020-04-21 5555 if (new_sd_dp)
a2aede970a8e12 Douglas Gilbert 2020-04-21 5556 kfree(sd_dp);
a2aede970a8e12 Douglas Gilbert 2020-04-21 5557 /* call scsi_done() from this thread */
a2aede970a8e12 Douglas Gilbert 2020-04-21 5558 cmnd->scsi_done(cmnd);
a2aede970a8e12 Douglas Gilbert 2020-04-21 5559 return 0;
a2aede970a8e12 Douglas Gilbert 2020-04-21 5560 }
a2aede970a8e12 Douglas Gilbert 2020-04-21 5561 /* otherwise reduce kt by elapsed time */
a2aede970a8e12 Douglas Gilbert 2020-04-21 5562 kt -= d;
a2aede970a8e12 Douglas Gilbert 2020-04-21 5563 }
0c4bc91d664953 Douglas Gilbert 2020-04-21 5564 }
771f712ba5b0c6 Douglas Gilbert 2021-03-03 5565 if (hipri) {
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5566 sd_dp->cmpl_ts = ktime_add(ns_to_ktime(ns_from_boot), kt);
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5567 spin_lock_irqsave(&sqp->qc_lock, iflags);
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5568 if (!sd_dp->init_poll) {
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5569 sd_dp->init_poll = true;
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5570 sqcp->sd_dp = sd_dp;
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5571 sd_dp->sqa_idx = sqp - sdebug_q_arr;
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5572 sd_dp->qc_idx = k;
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5573 }
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5574 sd_dp->defer_t = SDEB_DEFER_POLL;
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5575 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5576 } else {
10bde980ac18da Douglas Gilbert 2018-01-10 5577 if (!sd_dp->init_hrt) {
10bde980ac18da Douglas Gilbert 2018-01-10 5578 sd_dp->init_hrt = true;
a10bc12af6347d Douglas Gilbert 2016-04-25 5579 sqcp->sd_dp = sd_dp;
a10bc12af6347d Douglas Gilbert 2016-04-25 5580 hrtimer_init(&sd_dp->hrt, CLOCK_MONOTONIC,
c483739430f107 Douglas Gilbert 2016-05-06 5581 HRTIMER_MODE_REL_PINNED);
a10bc12af6347d Douglas Gilbert 2016-04-25 5582 sd_dp->hrt.function = sdebug_q_cmd_hrt_complete;
c483739430f107 Douglas Gilbert 2016-05-06 5583 sd_dp->sqa_idx = sqp - sdebug_q_arr;
c483739430f107 Douglas Gilbert 2016-05-06 5584 sd_dp->qc_idx = k;
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5585 }
10bde980ac18da Douglas Gilbert 2018-01-10 5586 sd_dp->defer_t = SDEB_DEFER_HRT;
a2aede970a8e12 Douglas Gilbert 2020-04-21 5587 /* schedule the invocation of scsi_done() for a later time */
c483739430f107 Douglas Gilbert 2016-05-06 5588 hrtimer_start(&sd_dp->hrt, kt, HRTIMER_MODE_REL_PINNED);
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5589 }
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5590 if (sdebug_statistics)
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5591 sd_dp->issuing_cpu = raw_smp_processor_id();
c483739430f107 Douglas Gilbert 2016-05-06 5592 } else { /* jdelay < 0, use work queue */
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5593 if (unlikely((sdebug_opts & SDEBUG_OPT_CMD_ABORT) &&
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5594 atomic_read(&sdeb_inject_pending)))
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5595 sd_dp->aborted = true;
771f712ba5b0c6 Douglas Gilbert 2021-03-03 5596 if (hipri) {
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5597 sd_dp->cmpl_ts = ns_to_ktime(ns_from_boot);
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5598 spin_lock_irqsave(&sqp->qc_lock, iflags);
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5599 if (!sd_dp->init_poll) {
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5600 sd_dp->init_poll = true;
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5601 sqcp->sd_dp = sd_dp;
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5602 sd_dp->sqa_idx = sqp - sdebug_q_arr;
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5603 sd_dp->qc_idx = k;
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5604 }
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5605 sd_dp->defer_t = SDEB_DEFER_POLL;
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5606 spin_unlock_irqrestore(&sqp->qc_lock, iflags);
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5607 } else {
10bde980ac18da Douglas Gilbert 2018-01-10 5608 if (!sd_dp->init_wq) {
10bde980ac18da Douglas Gilbert 2018-01-10 5609 sd_dp->init_wq = true;
a10bc12af6347d Douglas Gilbert 2016-04-25 5610 sqcp->sd_dp = sd_dp;
c483739430f107 Douglas Gilbert 2016-05-06 5611 sd_dp->sqa_idx = sqp - sdebug_q_arr;
c483739430f107 Douglas Gilbert 2016-05-06 5612 sd_dp->qc_idx = k;
a10bc12af6347d Douglas Gilbert 2016-04-25 5613 INIT_WORK(&sd_dp->ew.work, sdebug_q_cmd_wq_complete);
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5614 }
10bde980ac18da Douglas Gilbert 2018-01-10 5615 sd_dp->defer_t = SDEB_DEFER_WQ;
a10bc12af6347d Douglas Gilbert 2016-04-25 5616 schedule_work(&sd_dp->ew.work);
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5617 }
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5618 if (sdebug_statistics)
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5619 sd_dp->issuing_cpu = raw_smp_processor_id();
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5620 if (unlikely(sd_dp->aborted)) {
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5621 sdev_printk(KERN_INFO, sdp, "abort request tag %d\n", cmnd->request->tag);
7382f9d8dc0db2 Douglas Gilbert 2018-07-21 5622 blk_abort_request(cmnd->request);
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5623 atomic_set(&sdeb_inject_pending, 0);
4a0c6f432d1531 Douglas Gilbert 2021-02-15 5624 sd_dp->aborted = false;
7382f9d8dc0db2 Douglas Gilbert 2018-07-21 5625 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 5626 }
8759c3fdb10bdd Hannes Reinecke 2021-04-21 5627 if (unlikely((SDEBUG_OPT_Q_NOISE & sdebug_opts) && qfull))
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5628 sdev_printk(KERN_INFO, sdp, "%s: num_in_q=%d +1, %s%s\n", __func__,
3a90a63d02b8b7 Douglas Gilbert 2020-07-12 5629 num_in_q, (inject ? "<inject> " : ""), "status: TASK SET FULL");
cbf67842c3d9e7 Douglas Gilbert 2014-07-26 5630 return 0;
cd62b7dae245dd Douglas Gilbert 2014-08-05 5631
:::::: The code at line 5441 was first introduced by commit
:::::: f46eb0e9fc763b7b66c325eb94e6aefa960146d2 scsi_debug: use likely hints on fast path
:::::: TO: Douglas Gilbert <dgilbert@interlog.com>
:::::: CC: Martin K. Petersen <martin.petersen@oracle.com>
---
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: 34689 bytes --]
reply other threads:[~2021-04-22 7:31 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=202104221558.YfXltmLs-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/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.