From patchwork Fri Dec 20 20:26:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Upinder Malhi (umalhi)" X-Patchwork-Id: 3391781 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 41B9FC0D4B for ; Fri, 20 Dec 2013 20:27:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 628BD20708 for ; Fri, 20 Dec 2013 20:27:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4FEE520703 for ; Fri, 20 Dec 2013 20:27:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752919Ab3LTU1V (ORCPT ); Fri, 20 Dec 2013 15:27:21 -0500 Received: from mtv-iport-2.cisco.com ([173.36.130.13]:9511 "EHLO mtv-iport-2.cisco.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752692Ab3LTU1L (ORCPT ); Fri, 20 Dec 2013 15:27:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3726; q=dns/txt; s=iport; t=1387571231; x=1388780831; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=MeInugc0LBJEUDf+XXfOQWkoGAtspH1Hj7NpgdUHLkg=; b=l7HShWuUxqkgzMyRM/K2fNBtdp2vOnvHRJ2SWE2goOMWqVfSQ9Q5cYVo /RXURf8/QpKW8IiWytvGl+A+B5HuQgA6ly0gDsgQnPqJwGOPhQ8IVRNw2 J+wfKIV3LpOdPZpHgfAHBnrW0RDBC9FYDzFrYBY5YsmkZERKAHiYxGS49 Q=; X-IronPort-AV: E=Sophos;i="4.95,523,1384300800"; d="scan'208";a="101113182" Received: from mtv-core-2.cisco.com ([171.68.58.7]) by mtv-iport-2.cisco.com with ESMTP; 20 Dec 2013 20:27:10 +0000 Received: from sjc-savbu-bld03.cisco.com (sjc-savbu-bld03.cisco.com [171.71.188.58]) by mtv-core-2.cisco.com (8.14.5/8.14.5) with ESMTP id rBKKR9u1028546; Fri, 20 Dec 2013 20:27:09 GMT Received: by sjc-savbu-bld03.cisco.com (Postfix, from userid 246720) id B82BB3F809; Fri, 20 Dec 2013 12:27:09 -0800 (PST) From: Upinder Malhi To: linux-rdma@vger.kernel.org, roland@kernel.org Cc: Upinder Malhi Subject: [PATCH for-next 05/15] IB/usnic: Change BUG_ON to WARN_ON Date: Fri, 20 Dec 2013 12:26:36 -0800 Message-Id: <1387571206-8043-6-git-send-email-umalhi@cisco.com> X-Mailer: git-send-email 1.8.0-rc0 In-Reply-To: <1387571206-8043-1-git-send-email-umalhi@cisco.com> References: <1387571206-8043-1-git-send-email-umalhi@cisco.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-15.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, USER_IN_DEF_DKIM_WL autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP usNIC calls BUG_ON(spinlock_is_held..) at few places. In some of these instances, the call is made while holding a spinlock. Change all BUG_ON(spinlock_is_held...) calls in usNIC to WARN_ON(spinlock_is_held...) to make it fool-proof bc the latter can be called while holding a spinlock. Signed-off-by: Upinder Malhi --- drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c | 16 ++++++++-------- drivers/infiniband/hw/usnic/usnic_uiom.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) -- 1.8.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c index f647b6b..ad57a77 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_qp_grp.c @@ -82,7 +82,7 @@ static int add_fwd_filter(struct usnic_ib_qp_grp *qp_grp, struct usnic_vnic_res_chunk *chunk; int rq_idx; - BUG_ON(!spin_is_locked(&qp_grp->lock)); + WARN_ON(!spin_is_locked(&qp_grp->lock)); chunk = usnic_ib_qp_grp_get_chunk(qp_grp, USNIC_VNIC_RES_TYPE_RQ); if (IS_ERR_OR_NULL(chunk) || chunk->cnt < 1) { @@ -119,7 +119,7 @@ static int del_all_filters(struct usnic_ib_qp_grp *qp_grp) int err, status; struct usnic_fwd_filter_hndl *filter_hndl, *tmp; - BUG_ON(!spin_is_locked(&qp_grp->lock)); + WARN_ON(!spin_is_locked(&qp_grp->lock)); status = 0; @@ -145,7 +145,7 @@ static int enable_qp_grp(struct usnic_ib_qp_grp *qp_grp) struct usnic_vnic_res_chunk *res_chunk; struct usnic_vnic_res *res; - BUG_ON(!spin_is_locked(&qp_grp->lock)); + WARN_ON(!spin_is_locked(&qp_grp->lock)); vnic_idx = usnic_vnic_get_index(qp_grp->vf->vnic); @@ -189,7 +189,7 @@ static int disable_qp_grp(struct usnic_ib_qp_grp *qp_grp) struct usnic_vnic_res *res; int status = 0; - BUG_ON(!spin_is_locked(&qp_grp->lock)); + WARN_ON(!spin_is_locked(&qp_grp->lock)); vnic_idx = usnic_vnic_get_index(qp_grp->vf->vnic); res_chunk = usnic_ib_qp_grp_get_chunk(qp_grp, USNIC_VNIC_RES_TYPE_RQ); @@ -392,7 +392,7 @@ static int qp_grp_and_vf_bind(struct usnic_ib_vf *vf, int err; struct pci_dev *pdev; - BUG_ON(!spin_is_locked(&vf->lock)); + WARN_ON(!spin_is_locked(&vf->lock)); pdev = usnic_vnic_get_pdev(vf->vnic); if (vf->qp_grp_ref_cnt++ == 0) { @@ -416,7 +416,7 @@ static void qp_grp_and_vf_unbind(struct usnic_ib_qp_grp *qp_grp) struct pci_dev *pdev; struct usnic_ib_pd *pd; - BUG_ON(!spin_is_locked(&qp_grp->vf->lock)); + WARN_ON(!spin_is_locked(&qp_grp->vf->lock)); pd = qp_grp->vf->pd; pdev = usnic_vnic_get_pdev(qp_grp->vf->vnic); @@ -446,7 +446,7 @@ struct usnic_ib_qp_grp *usnic_ib_qp_grp_create(struct usnic_fwd_dev *ufdev, u16 port_num; int err; - BUG_ON(!spin_is_locked(&vf->lock)); + WARN_ON(!spin_is_locked(&vf->lock)); err = usnic_vnic_res_spec_satisfied(&min_transport_spec[transport], res_spec); @@ -514,7 +514,7 @@ void usnic_ib_qp_grp_destroy(struct usnic_ib_qp_grp *qp_grp) enum usnic_transport_type transport; WARN_ON(qp_grp->state != IB_QPS_RESET); - BUG_ON(!spin_is_locked(&qp_grp->vf->lock)); + WARN_ON(!spin_is_locked(&qp_grp->vf->lock)); transport = qp_grp->filters[DFLT_FILTER_IDX].transport; default_port_num = qp_grp->filters[DFLT_FILTER_IDX].port_num; diff --git a/drivers/infiniband/hw/usnic/usnic_uiom.c b/drivers/infiniband/hw/usnic/usnic_uiom.c index c44acbc..359897d 100644 --- a/drivers/infiniband/hw/usnic/usnic_uiom.c +++ b/drivers/infiniband/hw/usnic/usnic_uiom.c @@ -270,7 +270,7 @@ iter_chunk: pa_end = pa; } - BUG_ON(va_start == -EINVAL); + WARN_ON(va_start == -EINVAL); if ((pa_end + PAGE_SIZE != pa) && (pa != pa_start)) {