From: Julia Lawall <julia.lawall@lip6.fr>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: kbuild-all@01.org, Steve Wise <swise@opengridcomputing.com>,
linux-nvme@lists.infradead.org,
Stephen Bates <sbates@raithlin.com>,
target-devel@vger.kernel.org, devel@driverdev.osuosl.org,
rds-devel@oss.oracle.com, Sagi Grimberg <sagi@grimberg.me>,
linux-scsi@vger.kernel.org,
Matthew Wilcox <mawilcox@microsoft.com>,
linux-rdma@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
fcoe-devel@open-fcoe.org,
Ross Zwisler <ross.zwisler@linux.intel.com>,
open-iscsi@googlegroups.com, linux-media@vger.kernel.org,
Ming Lin <ming.l@ssi.samsung.com>,
intel-gfx@lists.freedesktop.org, sparmaintainer@unisys.com,
linux-raid@vger.kernel.org, dri-devel@lists.freedesktop.org,
Dan Williams <dan.j.williams@intel.com>,
megaraidlinux.pdl@broadcom.com, Jens Axboe <axboe@kernel.dk>,
linaro-mm-sig@lists.linaro.org,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Greg Kroah-Hartman <gregkh@linuxfo>
Subject: Re: [PATCH 04/22] target: Make use of the new sg_map function at 16 call sites (fwd)
Date: Fri, 14 Apr 2017 17:19:28 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.20.1704141717510.3212@hadrien> (raw)
It looks like &udev->cmdr_lock should be released at line 512 if it has
not been released otherwise. The lock was taken at line 438.
julia
---------- Forwarded message ----------
Date: Fri, 14 Apr 2017 22:21:44 +0800
From: kbuild test robot <fengguang.wu@intel.com>
To: kbuild@01.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Subject: Re: [PATCH 04/22] target: Make use of the new sg_map function at 16
call sites
Hi Logan,
[auto build test WARNING on scsi/for-next]
[also build test WARNING on v4.11-rc6]
[cannot apply to next-20170413]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Logan-Gunthorpe/Introduce-common-scatterlist-map-function/20170414-142518
base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
:::::: branch date: 8 hours ago
:::::: commit date: 8 hours ago
>> drivers/target/target_core_user.c:512:2-8: preceding lock on line 438
drivers/target/target_core_user.c:512:2-8: preceding lock on line 471
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 78082134e7afdc59d744eb8d2def5c588e89c378
vim +512 drivers/target/target_core_user.c
7c9e7a6f Andy Grover 2014-10-01 432 sizeof(struct tcmu_cmd_entry));
7c9e7a6f Andy Grover 2014-10-01 433 command_size = base_command_size
7c9e7a6f Andy Grover 2014-10-01 434 + round_up(scsi_command_size(se_cmd->t_task_cdb), TCMU_OP_ALIGN_SIZE);
7c9e7a6f Andy Grover 2014-10-01 435
7c9e7a6f Andy Grover 2014-10-01 436 WARN_ON(command_size & (TCMU_OP_ALIGN_SIZE-1));
7c9e7a6f Andy Grover 2014-10-01 437
7c9e7a6f Andy Grover 2014-10-01 @438 spin_lock_irq(&udev->cmdr_lock);
7c9e7a6f Andy Grover 2014-10-01 439
7c9e7a6f Andy Grover 2014-10-01 440 mb = udev->mb_addr;
7c9e7a6f Andy Grover 2014-10-01 441 cmd_head = mb->cmd_head % udev->cmdr_size; /* UAM */
26418649 Sheng Yang 2016-02-26 442 data_length = se_cmd->data_length;
26418649 Sheng Yang 2016-02-26 443 if (se_cmd->se_cmd_flags & SCF_BIDI) {
26418649 Sheng Yang 2016-02-26 444 BUG_ON(!(se_cmd->t_bidi_data_sg && se_cmd->t_bidi_data_nents));
26418649 Sheng Yang 2016-02-26 445 data_length += se_cmd->t_bidi_data_sg->length;
26418649 Sheng Yang 2016-02-26 446 }
554617b2 Andy Grover 2016-08-25 447 if ((command_size > (udev->cmdr_size / 2)) ||
554617b2 Andy Grover 2016-08-25 448 data_length > udev->data_size) {
554617b2 Andy Grover 2016-08-25 449 pr_warn("TCMU: Request of size %zu/%zu is too big for %u/%zu "
3d9b9555 Andy Grover 2016-08-25 450 "cmd ring/data area\n", command_size, data_length,
7c9e7a6f Andy Grover 2014-10-01 451 udev->cmdr_size, udev->data_size);
554617b2 Andy Grover 2016-08-25 452 spin_unlock_irq(&udev->cmdr_lock);
554617b2 Andy Grover 2016-08-25 453 return TCM_INVALID_CDB_FIELD;
554617b2 Andy Grover 2016-08-25 454 }
7c9e7a6f Andy Grover 2014-10-01 455
26418649 Sheng Yang 2016-02-26 456 while (!is_ring_space_avail(udev, command_size, data_length)) {
7c9e7a6f Andy Grover 2014-10-01 457 int ret;
7c9e7a6f Andy Grover 2014-10-01 458 DEFINE_WAIT(__wait);
7c9e7a6f Andy Grover 2014-10-01 459
7c9e7a6f Andy Grover 2014-10-01 460 prepare_to_wait(&udev->wait_cmdr, &__wait, TASK_INTERRUPTIBLE);
7c9e7a6f Andy Grover 2014-10-01 461
7c9e7a6f Andy Grover 2014-10-01 462 pr_debug("sleeping for ring space\n");
7c9e7a6f Andy Grover 2014-10-01 463 spin_unlock_irq(&udev->cmdr_lock);
7c9e7a6f Andy Grover 2014-10-01 464 ret = schedule_timeout(msecs_to_jiffies(TCMU_TIME_OUT));
7c9e7a6f Andy Grover 2014-10-01 465 finish_wait(&udev->wait_cmdr, &__wait);
7c9e7a6f Andy Grover 2014-10-01 466 if (!ret) {
7c9e7a6f Andy Grover 2014-10-01 467 pr_warn("tcmu: command timed out\n");
02eb924f Andy Grover 2016-10-06 468 return TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
7c9e7a6f Andy Grover 2014-10-01 469 }
7c9e7a6f Andy Grover 2014-10-01 470
7c9e7a6f Andy Grover 2014-10-01 471 spin_lock_irq(&udev->cmdr_lock);
7c9e7a6f Andy Grover 2014-10-01 472
7c9e7a6f Andy Grover 2014-10-01 473 /* We dropped cmdr_lock, cmd_head is stale */
7c9e7a6f Andy Grover 2014-10-01 474 cmd_head = mb->cmd_head % udev->cmdr_size; /* UAM */
7c9e7a6f Andy Grover 2014-10-01 475 }
7c9e7a6f Andy Grover 2014-10-01 476
f56574a2 Andy Grover 2014-10-02 477 /* Insert a PAD if end-of-ring space is too small */
f56574a2 Andy Grover 2014-10-02 478 if (head_to_end(cmd_head, udev->cmdr_size) < command_size) {
f56574a2 Andy Grover 2014-10-02 479 size_t pad_size = head_to_end(cmd_head, udev->cmdr_size);
f56574a2 Andy Grover 2014-10-02 480
7c9e7a6f Andy Grover 2014-10-01 481 entry = (void *) mb + CMDR_OFF + cmd_head;
7c9e7a6f Andy Grover 2014-10-01 482 tcmu_flush_dcache_range(entry, sizeof(*entry));
0ad46af8 Andy Grover 2015-04-14 483 tcmu_hdr_set_op(&entry->hdr.len_op, TCMU_OP_PAD);
0ad46af8 Andy Grover 2015-04-14 484 tcmu_hdr_set_len(&entry->hdr.len_op, pad_size);
0ad46af8 Andy Grover 2015-04-14 485 entry->hdr.cmd_id = 0; /* not used for PAD */
0ad46af8 Andy Grover 2015-04-14 486 entry->hdr.kflags = 0;
0ad46af8 Andy Grover 2015-04-14 487 entry->hdr.uflags = 0;
7c9e7a6f Andy Grover 2014-10-01 488
7c9e7a6f Andy Grover 2014-10-01 489 UPDATE_HEAD(mb->cmd_head, pad_size, udev->cmdr_size);
7c9e7a6f Andy Grover 2014-10-01 490
7c9e7a6f Andy Grover 2014-10-01 491 cmd_head = mb->cmd_head % udev->cmdr_size; /* UAM */
7c9e7a6f Andy Grover 2014-10-01 492 WARN_ON(cmd_head != 0);
7c9e7a6f Andy Grover 2014-10-01 493 }
7c9e7a6f Andy Grover 2014-10-01 494
7c9e7a6f Andy Grover 2014-10-01 495 entry = (void *) mb + CMDR_OFF + cmd_head;
7c9e7a6f Andy Grover 2014-10-01 496 tcmu_flush_dcache_range(entry, sizeof(*entry));
0ad46af8 Andy Grover 2015-04-14 497 tcmu_hdr_set_op(&entry->hdr.len_op, TCMU_OP_CMD);
0ad46af8 Andy Grover 2015-04-14 498 tcmu_hdr_set_len(&entry->hdr.len_op, command_size);
0ad46af8 Andy Grover 2015-04-14 499 entry->hdr.cmd_id = tcmu_cmd->cmd_id;
0ad46af8 Andy Grover 2015-04-14 500 entry->hdr.kflags = 0;
0ad46af8 Andy Grover 2015-04-14 501 entry->hdr.uflags = 0;
7c9e7a6f Andy Grover 2014-10-01 502
26418649 Sheng Yang 2016-02-26 503 bitmap_copy(old_bitmap, udev->data_bitmap, DATA_BLOCK_BITS);
26418649 Sheng Yang 2016-02-26 504
3d9b9555 Andy Grover 2016-08-25 505 /* Handle allocating space from the data area */
7c9e7a6f Andy Grover 2014-10-01 506 iov = &entry->req.iov[0];
f97ec7db Ilias Tsitsimpis 2015-04-23 507 iov_cnt = 0;
e4648b01 Ilias Tsitsimpis 2015-04-23 508 copy_to_data_area = (se_cmd->data_direction == DMA_TO_DEVICE
e4648b01 Ilias Tsitsimpis 2015-04-23 509 || se_cmd->se_cmd_flags & SCF_BIDI);
78082134 Logan Gunthorpe 2017-04-13 510 if (alloc_and_scatter_data_area(udev, se_cmd->t_data_sg,
78082134 Logan Gunthorpe 2017-04-13 511 se_cmd->t_data_nents, &iov, &iov_cnt, copy_to_data_area))
78082134 Logan Gunthorpe 2017-04-13 @512 return TCM_OUT_OF_RESOURCES;
78082134 Logan Gunthorpe 2017-04-13 513
7c9e7a6f Andy Grover 2014-10-01 514 entry->req.iov_cnt = iov_cnt;
0ad46af8 Andy Grover 2015-04-14 515 entry->req.iov_dif_cnt = 0;
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next reply other threads:[~2017-04-14 15:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-14 15:19 Julia Lawall [this message]
2017-04-14 16:09 ` [PATCH 04/22] target: Make use of the new sg_map function at 16 call sites (fwd) Logan Gunthorpe
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=alpine.DEB.2.20.1704141717510.3212@hadrien \
--to=julia.lawall@lip6.fr \
--cc=axboe@kernel.dk \
--cc=dan.j.williams@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=fcoe-devel@open-fcoe.org \
--cc=gregkh@linuxfo \
--cc=hch@lst.de \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kbuild-all@01.org \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-raid@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=martin.petersen@oracle.com \
--cc=mawilcox@microsoft.com \
--cc=megaraidlinux.pdl@broadcom.com \
--cc=ming.l@ssi.samsung.com \
--cc=open-iscsi@googlegroups.com \
--cc=rds-devel@oss.oracle.com \
--cc=ross.zwisler@linux.intel.com \
--cc=sagi@grimberg.me \
--cc=sbates@raithlin.com \
--cc=sparmaintainer@unisys.com \
--cc=swise@opengridcomputing.com \
--cc=target-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox