CC: [email protected]
TO: Jens Axboe <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git 
perf-wip
head:   72d1b2aab791ef905294fe97afcf2e7c5a5fa865
commit: 483db1e620266850e23219d42d9f6b14551da18a [17/26] nvme: add support for 
mq_ops->queue_rqs()
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
config: x86_64-randconfig-c007-20211115 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
c3dddeeafb529e769cde87bd29ef6271ac6bfa5c)
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/axboe/linux-block.git/commit/?id=483db1e620266850e23219d42d9f6b14551da18a
        git remote add axboe-block 
https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git
        git fetch --no-tags axboe-block perf-wip
        git checkout 483db1e620266850e23219d42d9f6b14551da18a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hid/hid-dr.c:259:3: note: Taking false branch
                   if (field->flags & HID_MAIN_ITEM_RELATIVE)
                   ^
   drivers/hid/hid-dr.c:262:4: note: Calling 'hid_map_usage'
                           map_abs(usage->hid & 0xf);
                           ^
   drivers/hid/hid-dr.c:245:25: note: expanded from macro 'map_abs'
   #define map_abs(c)      hid_map_usage(hi, usage, bit, max, EV_ABS, (c))
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:982:2: note: 'input' initialized here
           struct input_dev *input = hidinput->input;
           ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:986:2: note: Control jumps to 'case 3:'  at line 987
           switch (type) {
           ^
   include/linux/hid.h:990:3: note:  Execution continues on line 1005
                   break;
                   ^
   include/linux/hid.h:1005:15: note: 'c' is <= 'limit'
           if (unlikely(c > limit || !bmap)) {
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/hid.h:1005:15: note: Left side of '||' is false
           if (unlikely(c > limit || !bmap)) {
                        ^
   include/linux/hid.h:1005:28: note: Assuming 'bmap' is null
           if (unlikely(c > limit || !bmap)) {
                                     ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/hid.h:1005:2: note: Taking true branch
           if (unlikely(c > limit || !bmap)) {
           ^
   include/linux/hid.h:1006:3: note: Assuming the condition is true
                   pr_warn_ratelimited("%s: Invalid code %d type %d\n",
                   ^
   include/linux/printk.h:656:2: note: expanded from macro 'pr_warn_ratelimited'
           printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/printk.h:639:6: note: expanded from macro 'printk_ratelimited'
           if (__ratelimit(&_rs))                                          \
               ^~~~~~~~~~~~~~~~~
   include/linux/ratelimit_types.h:41:28: note: expanded from macro 
'__ratelimit'
   #define __ratelimit(state) ___ratelimit(state, __func__)
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:1006:3: note: Taking true branch
                   pr_warn_ratelimited("%s: Invalid code %d type %d\n",
                   ^
   include/linux/printk.h:656:2: note: expanded from macro 'pr_warn_ratelimited'
           printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:639:2: note: expanded from macro 'printk_ratelimited'
           if (__ratelimit(&_rs))                                          \
           ^
   include/linux/hid.h:1006:3: note: Loop condition is false.  Exiting loop
                   pr_warn_ratelimited("%s: Invalid code %d type %d\n",
                   ^
   include/linux/printk.h:656:2: note: expanded from macro 'pr_warn_ratelimited'
           printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:640:3: note: expanded from macro 'printk_ratelimited'
                   printk(fmt, ##__VA_ARGS__);                             \
                   ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro 
'__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   include/linux/hid.h:1007:9: note: Access to field 'name' results in a 
dereference of a null pointer (loaded from variable 'input')
                                       input->name, c, type);
                                       ^
   include/linux/printk.h:656:49: note: expanded from macro 
'pr_warn_ratelimited'
           printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
                                                          ^~~~~~~~~~~
   include/linux/printk.h:640:17: note: expanded from macro 'printk_ratelimited'
                   printk(fmt, ##__VA_ARGS__);                             \
                                 ^~~~~~~~~~~
   include/linux/printk.h:446:60: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                                                              ^~~~~~~~~~~
   include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap'
                   _p_func(_fmt, ##__VA_ARGS__);                           \
                                   ^~~~~~~~~~~
   Suppressed 4 warnings (4 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   8 warnings generated.
>> drivers/nvme/host/pci.c:1049:18: warning: Dereference of null pointer 
>> [clang-analyzer-core.NullDereference]
                           prev->rq_next = NULL;
                           ~~~~~~~~~~~~~~^~~~~~
   drivers/nvme/host/pci.c:1022:46: note: 'prev' initialized to a null pointer 
value
           struct request *requeue_list = NULL, *req, *prev = NULL;
                                                       ^~~~
   drivers/nvme/host/pci.c:1028:8: note: Assuming 'rqlist' is non-null
           req = rq_list_peek(rqlist);
                 ^
   include/linux/blkdev.h:1361:6: note: expanded from macro 'rq_list_peek'
           if ((listptr) && *(listptr))                    \
               ^~~~~~~~~
   drivers/nvme/host/pci.c:1028:8: note: Left side of '&&' is true
           req = rq_list_peek(rqlist);
                 ^
   include/linux/blkdev.h:1361:6: note: expanded from macro 'rq_list_peek'
           if ((listptr) && *(listptr))                    \
               ^
   drivers/nvme/host/pci.c:1028:8: note: Assuming the condition is true
           req = rq_list_peek(rqlist);
                 ^
   include/linux/blkdev.h:1361:19: note: expanded from macro 'rq_list_peek'
           if ((listptr) && *(listptr))                    \
                            ^~~~~~~~~~
   drivers/nvme/host/pci.c:1028:8: note: Taking true branch
           req = rq_list_peek(rqlist);
                 ^
   include/linux/blkdev.h:1361:2: note: expanded from macro 'rq_list_peek'
           if ((listptr) && *(listptr))                    \
           ^
   drivers/nvme/host/pci.c:1037:6: note: Assuming the condition is false
           if (unlikely(!test_bit(NVMEQ_ENABLED, &nvmeq->flags)))
               ^
   include/linux/compiler.h:78:22: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/pci.c:1037:2: note: Taking false branch
           if (unlikely(!test_bit(NVMEQ_ENABLED, &nvmeq->flags)))
           ^
   drivers/nvme/host/pci.c:1040:19: note: 'rqlist' is non-null
           rq_list_for_each(rqlist, req) {
                            ^
   include/linux/blkdev.h:1367:27: note: expanded from macro 'rq_list_for_each'
           for (pos = rq_list_peek((listptr)); pos; pos = rq_list_next(pos)) \
                                    ^~~~~~~
   include/linux/blkdev.h:1361:7: note: expanded from macro 'rq_list_peek'
           if ((listptr) && *(listptr))                    \
                ^~~~~~~
   drivers/nvme/host/pci.c:1040:2: note: Left side of '&&' is true
           rq_list_for_each(rqlist, req) {
           ^
   include/linux/blkdev.h:1367:13: note: expanded from macro 'rq_list_for_each'
           for (pos = rq_list_peek((listptr)); pos; pos = rq_list_next(pos)) \
                      ^
   include/linux/blkdev.h:1361:6: note: expanded from macro 'rq_list_peek'
           if ((listptr) && *(listptr))                    \
               ^
   drivers/nvme/host/pci.c:1040:2: note: Taking true branch
           rq_list_for_each(rqlist, req) {
           ^
   include/linux/blkdev.h:1367:13: note: expanded from macro 'rq_list_for_each'
           for (pos = rq_list_peek((listptr)); pos; pos = rq_list_next(pos)) \
                      ^
   include/linux/blkdev.h:1361:2: note: expanded from macro 'rq_list_peek'
           if ((listptr) && *(listptr))                    \
           ^
   drivers/nvme/host/pci.c:1040:2: note: Loop condition is true.  Entering loop 
body
           rq_list_for_each(rqlist, req) {
           ^
   include/linux/blkdev.h:1367:2: note: expanded from macro 'rq_list_for_each'
           for (pos = rq_list_peek((listptr)); pos; pos = rq_list_next(pos)) \
           ^
   drivers/nvme/host/pci.c:1044:16: note: Assuming the condition is false
                   if (unlikely(!nvme_check_ready(&nvmeq->dev->ctrl, req, 
true)))
                                ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   drivers/nvme/host/pci.c:1044:3: note: Taking false branch
                   if (unlikely(!nvme_check_ready(&nvmeq->dev->ctrl, req, 
true)))
                   ^
   drivers/nvme/host/pci.c:1047:7: note: Assuming 'hctx' is not equal to field 
'mq_hctx'
                   if (req->mq_hctx != hctx) {
                       ^~~~~~~~~~~~~~~~~~~~
   drivers/nvme/host/pci.c:1047:3: note: Taking true branch
                   if (req->mq_hctx != hctx) {
                   ^
   drivers/nvme/host/pci.c:1049:18: note: Dereference of null pointer
                           prev->rq_next = NULL;
                           ~~~~~~~~~~~~~~^~~~~~
   Suppressed 7 warnings (7 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   Suppressed 2 warnings (2 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.

vim +1049 drivers/nvme/host/pci.c

483db1e6202668 Jens Axboe 2021-10-29  1019  
483db1e6202668 Jens Axboe 2021-10-29  1020  static void nvme_queue_rqs(struct 
request **rqlist)
483db1e6202668 Jens Axboe 2021-10-29  1021  {
483db1e6202668 Jens Axboe 2021-10-29  1022      struct request *requeue_list = 
NULL, *req, *prev = NULL;
483db1e6202668 Jens Axboe 2021-10-29  1023      struct blk_mq_hw_ctx *hctx;
483db1e6202668 Jens Axboe 2021-10-29  1024      struct nvme_queue *nvmeq;
483db1e6202668 Jens Axboe 2021-10-29  1025      struct nvme_ns *ns;
483db1e6202668 Jens Axboe 2021-10-29  1026  
483db1e6202668 Jens Axboe 2021-10-29  1027  restart:
483db1e6202668 Jens Axboe 2021-10-29  1028      req = rq_list_peek(rqlist);
483db1e6202668 Jens Axboe 2021-10-29  1029      hctx = req->mq_hctx;
483db1e6202668 Jens Axboe 2021-10-29  1030      nvmeq = hctx->driver_data;
483db1e6202668 Jens Axboe 2021-10-29  1031      ns = hctx->queue->queuedata;
483db1e6202668 Jens Axboe 2021-10-29  1032  
483db1e6202668 Jens Axboe 2021-10-29  1033      /*
483db1e6202668 Jens Axboe 2021-10-29  1034       * We should not need to do 
this, but we're still using this to
483db1e6202668 Jens Axboe 2021-10-29  1035       * ensure we can drain requests 
on a dying queue.
483db1e6202668 Jens Axboe 2021-10-29  1036       */
483db1e6202668 Jens Axboe 2021-10-29  1037      if 
(unlikely(!test_bit(NVMEQ_ENABLED, &nvmeq->flags)))
483db1e6202668 Jens Axboe 2021-10-29  1038              return;
483db1e6202668 Jens Axboe 2021-10-29  1039  
483db1e6202668 Jens Axboe 2021-10-29  1040      rq_list_for_each(rqlist, req) {
483db1e6202668 Jens Axboe 2021-10-29  1041              struct nvme_iod *iod = 
blk_mq_rq_to_pdu(req);
483db1e6202668 Jens Axboe 2021-10-29  1042              blk_status_t ret;
483db1e6202668 Jens Axboe 2021-10-29  1043  
483db1e6202668 Jens Axboe 2021-10-29  1044              if 
(unlikely(!nvme_check_ready(&nvmeq->dev->ctrl, req, true)))
483db1e6202668 Jens Axboe 2021-10-29  1045                      goto requeue;
483db1e6202668 Jens Axboe 2021-10-29  1046  
483db1e6202668 Jens Axboe 2021-10-29  1047              if (req->mq_hctx != 
hctx) {
483db1e6202668 Jens Axboe 2021-10-29  1048                      /* detach rest 
of list, and submit */
483db1e6202668 Jens Axboe 2021-10-29 @1049                      prev->rq_next = 
NULL;
483db1e6202668 Jens Axboe 2021-10-29  1050                      
nvme_submit_cmds(nvmeq, rqlist);
483db1e6202668 Jens Axboe 2021-10-29  1051                      /* req now 
start of new list for this hw queue */
483db1e6202668 Jens Axboe 2021-10-29  1052                      *rqlist = req;
483db1e6202668 Jens Axboe 2021-10-29  1053                      goto restart;
483db1e6202668 Jens Axboe 2021-10-29  1054              }
483db1e6202668 Jens Axboe 2021-10-29  1055  
483db1e6202668 Jens Axboe 2021-10-29  1056              
hctx->tags->rqs[req->tag] = req;
483db1e6202668 Jens Axboe 2021-10-29  1057              ret = 
nvme_prep_rq(nvmeq->dev, ns, req, &iod->cmd);
483db1e6202668 Jens Axboe 2021-10-29  1058              if (ret == BLK_STS_OK) {
483db1e6202668 Jens Axboe 2021-10-29  1059                      prev = req;
483db1e6202668 Jens Axboe 2021-10-29  1060                      continue;
483db1e6202668 Jens Axboe 2021-10-29  1061              }
483db1e6202668 Jens Axboe 2021-10-29  1062  requeue:
483db1e6202668 Jens Axboe 2021-10-29  1063              /* detach 'req' and add 
to remainder list */
483db1e6202668 Jens Axboe 2021-10-29  1064              if (prev)
483db1e6202668 Jens Axboe 2021-10-29  1065                      prev->rq_next = 
req->rq_next;
483db1e6202668 Jens Axboe 2021-10-29  1066              
rq_list_add(&requeue_list, req);
483db1e6202668 Jens Axboe 2021-10-29  1067      }
483db1e6202668 Jens Axboe 2021-10-29  1068  
483db1e6202668 Jens Axboe 2021-10-29  1069      nvme_submit_cmds(nvmeq, rqlist);
483db1e6202668 Jens Axboe 2021-10-29  1070      *rqlist = requeue_list;
483db1e6202668 Jens Axboe 2021-10-29  1071  }
483db1e6202668 Jens Axboe 2021-10-29  1072  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to