From patchwork Fri Jul 6 20:04:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10512501 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2DA9E603D7 for ; Fri, 6 Jul 2018 20:04:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14E7D287BB for ; Fri, 6 Jul 2018 20:04:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09CC8287BE; Fri, 6 Jul 2018 20:04:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D452F287BD for ; Fri, 6 Jul 2018 20:04:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933831AbeGFUEc (ORCPT ); Fri, 6 Jul 2018 16:04:32 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:21022 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933738AbeGFUEb (ORCPT ); Fri, 6 Jul 2018 16:04:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1530907471; x=1562443471; h=from:to:cc:subject:date:message-id; bh=tXbbg2MZlWjXb3dszmM21PMMpTP2MlPymnB9JMllr0w=; b=GbUNmh38pgR2nKOogWL0VLsYL8sDRPNuQMqeZYHIkzmFZzVq68oleVpI G3b+eVXSXj1JFohG5Y6+Kib3BmrZK+GTl8vpdzMOs5pC4C4C/1TesRG8a r4E3pbl4JADQ8Z5MN70iF3v3p+1O6elZGfd3PjeksEQKzxsBlXw94gchr RYIuLXBUDvA3tDaDnGyqukBc1Y9PFkW1wAVj7O9kHqR7JNJqeiJdbBiUb jy+2Gt4nrYZfTTFNUO4FfTDEAR2ltisZF8oOXsHp5u6fWgm0mtWUs5XUe f+hixKKQfHd6Q7SImDG5FJdcZ0ompek26MPHgB2oBuxMmS/rEG7aEbMd6 A==; X-IronPort-AV: E=Sophos;i="5.51,317,1526313600"; d="scan'208";a="186922607" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 07 Jul 2018 04:04:31 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP; 06 Jul 2018 12:53:30 -0700 Received: from thinkpad-bart.sdcorp.global.sandisk.com ([10.111.67.248]) by uls-op-cesaip01.wdc.com with ESMTP; 06 Jul 2018 13:04:30 -0700 From: Bart Van Assche To: Jason Gunthorpe Cc: Doug Ledford , linux-rdma@vger.kernel.org, Bart Van Assche , Selvin Xavier , Devesh Sharma Subject: [PATCH] RDMA/ocrdma: Make ocrdma_destroy_qp() easier to analyze Date: Fri, 6 Jul 2018 13:04:30 -0700 Message-Id: <20180706200430.13585-1-bart.vanassche@wdc.com> X-Mailer: git-send-email 2.18.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch does not change any functionality but avoids that sparse reports the following: drivers/infiniband/hw/ocrdma/ocrdma_verbs.c:1818:31: warning: context imbalance in 'ocrdma_destroy_qp' - different lock contexts for basic block Compile-tested only. Signed-off-by: Bart Van Assche Cc: Selvin Xavier Cc: Devesh Sharma --- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c index 542686dd8267..d3ec2051278c 100644 --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c @@ -1775,13 +1775,13 @@ int ocrdma_destroy_qp(struct ib_qp *ibqp) * protect against proessing in-flight CQEs for this QP. */ spin_lock_irqsave(&qp->sq_cq->cq_lock, flags); - if (qp->rq_cq && (qp->rq_cq != qp->sq_cq)) + if (qp->rq_cq && (qp->rq_cq != qp->sq_cq)) { spin_lock(&qp->rq_cq->cq_lock); - - ocrdma_del_qpn_map(dev, qp); - - if (qp->rq_cq && (qp->rq_cq != qp->sq_cq)) + ocrdma_del_qpn_map(dev, qp); spin_unlock(&qp->rq_cq->cq_lock); + } else { + ocrdma_del_qpn_map(dev, qp); + } spin_unlock_irqrestore(&qp->sq_cq->cq_lock, flags); if (!pd->uctx) {