From patchwork Thu Aug 10 04:44:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13348763 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C50BDC001B0 for ; Thu, 10 Aug 2023 04:56:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229470AbjHJE4X (ORCPT ); Thu, 10 Aug 2023 00:56:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230168AbjHJE4W (ORCPT ); Thu, 10 Aug 2023 00:56:22 -0400 Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D635A211D for ; Wed, 9 Aug 2023 21:56:21 -0700 (PDT) Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-6bc886d1504so525424a34.0 for ; Wed, 09 Aug 2023 21:56:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1691643381; x=1692248181; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=ueqRGJGiViI1JMOLJnAxFZ0CFuziAxRertdpYKGiipQ=; b=GONcpP4ZWrHQBHIfOOP7buLuHvtohkMGH6aLt0mJKe1zDUibUVoU9fzABkICocoq3V k0w6Lp1Ul+ZDD/iOs13kV5YEbPjTn47LSXr9nLyIG9RmPhWCN6yp9Zvfle4OwW/V7oBU /QSI8oR34yIPebfFO0ari43LgD8YiO4YGDib4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691643381; x=1692248181; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ueqRGJGiViI1JMOLJnAxFZ0CFuziAxRertdpYKGiipQ=; b=ERzalNCWlGQEDZ4cIk3vIwISFmmWfuI4s+PzJacbZOYlVMnbdWe7+YHnFvM+Cqat8J 2YnElIzXKR36+Hx6Er2sq99kVbqrGtk9VfTi4JH3SKdc28ElzNJcEmgerI7RXO6UpH1R 4UnfaT0+5IFWKC7xnIflKlJI4s3MrYYHmpFfPcmLCHKFADXHkSauxVvFDm4Gf7EAoIK2 sGrwqKYA5wNnU3O73ynJG0Zx2rzBX8z2xSHtqnU+B9aOW7pGjMo5jkOOzS9Voxd3Xw4D 9K2n0LwW/p6F3Y5PmnR8oW7I2wGE51hW3ORVBdmKTOK88Yc4gyDpAL0Q+R1q76d/zj5f tFMg== X-Gm-Message-State: AOJu0Yxv/ThUgAlo98E9otbQI603Zl90h4muUADkJ1u6kgJ6Gk5MYz5e ybRxWhfNjMYtUdDs8iEj0cIcjA== X-Google-Smtp-Source: AGHT+IFUrAggKgRQUw4bVnoB47979Xgy38WLPCUr1Nk5DOu662CSQ8O6c2jwWsbSP6g4590tqXRVYw== X-Received: by 2002:a05:6830:14d3:b0:6bc:e2a8:6e3c with SMTP id t19-20020a05683014d300b006bce2a86e3cmr1429404otq.27.1691643381083; Wed, 09 Aug 2023 21:56:21 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id x6-20020a63b346000000b00553b9e0510esm458672pgt.60.2023.08.09.21.56.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Aug 2023 21:56:19 -0700 (PDT) From: Selvin Xavier To: jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, Selvin Xavier Subject: [PATCH for-rc 1/3] RDMA/bnxt_re: Fix ib device unalloc Date: Wed, 9 Aug 2023 21:44:35 -0700 Message-Id: <1691642677-21369-2-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1691642677-21369-1-git-send-email-selvin.xavier@broadcom.com> References: <1691642677-21369-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org ib_dealloc_device should be called only after device cleanup. Fix the dealloc sequence. Fixes: 6d758147c7b8 ("RDMA/bnxt_re: Use auxiliary driver interface") Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index b42166f..1c76460 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -1526,8 +1526,8 @@ static void bnxt_re_remove(struct auxiliary_device *adev) } bnxt_re_setup_cc(rdev, false); ib_unregister_device(&rdev->ibdev); - ib_dealloc_device(&rdev->ibdev); bnxt_re_dev_uninit(rdev); + ib_dealloc_device(&rdev->ibdev); skip_remove: mutex_unlock(&bnxt_re_mutex); } From patchwork Thu Aug 10 04:44:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13348764 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A789FC001B0 for ; Thu, 10 Aug 2023 04:56:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230168AbjHJE4Z (ORCPT ); Thu, 10 Aug 2023 00:56:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229902AbjHJE4Z (ORCPT ); Thu, 10 Aug 2023 00:56:25 -0400 Received: from mail-ot1-x333.google.com (mail-ot1-x333.google.com [IPv6:2607:f8b0:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAEB01BCF for ; Wed, 9 Aug 2023 21:56:24 -0700 (PDT) Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6bcb5df95c5so494374a34.1 for ; Wed, 09 Aug 2023 21:56:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1691643384; x=1692248184; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=Gmf/IkFBFukGyxHoRFruSzCiAcIlplQqzDWBnB35TCw=; b=Q8EmfQl+/XZ2HgasKzDDB8dyfEDOAWLwCVu99kbT2R3j/Jf4cZnWaLDhigCflB27g6 oHjBzSWIw/0Ef7D3pu71VaKTvYKwFqlI3EEv0JriRMKmWrgdhizafm2mj4PrjdIMkYWJ lWH+ELAk+S58M2z1ZnS6d3DuV6YhN/vDWlErs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691643384; x=1692248184; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Gmf/IkFBFukGyxHoRFruSzCiAcIlplQqzDWBnB35TCw=; b=LCOo6szdKzLGo9Ycm1bzzohiX5l+D29sPH3wqkyYM1Uw9hHz0CYsOBPWThqspafI6V jHzZF+I/lSotPhCVsot0gwJ6LEMXtxk55CvjKQE702aGp6VALhyUEVuQ8ZXD06QMysQB NEAft8rAveMy9C40qQgi9S8QnGVSB/iUPNP+Niv4j0i+tw3TjmwGs1nsuPO1yaHSFJxS 7hBR8LLvgg5joSC68PfIGW9umcJLL8AMIcP6uuUoOyo1a9+gd5NpkGR+d661OW4/oN1s HyluQRFrSprRrxRH2f1jA8PXrWbo7rQOpF/CFEQ7iUI8gS+equ1Kd956vJSuIz01n5Rc ivVQ== X-Gm-Message-State: AOJu0YxLLNs21fbuGPvTP6JyVwm2L0EajWIxSqWlkYyU+VDLfBHWjH3y GMu5lelkxwF4ATKEeEFpqb2n0w== X-Google-Smtp-Source: AGHT+IE0JNPuvHWaV3m2oCa2socF6VLRFWqTWDwnsB9abrR0rl+lXdkLfTVwbAi09GEEHfl5h/O6Dw== X-Received: by 2002:a05:6358:9492:b0:135:aed4:99b4 with SMTP id i18-20020a056358949200b00135aed499b4mr1681182rwb.4.1691643383859; Wed, 09 Aug 2023 21:56:23 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id x6-20020a63b346000000b00553b9e0510esm458672pgt.60.2023.08.09.21.56.21 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Aug 2023 21:56:23 -0700 (PDT) From: Selvin Xavier To: jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, Kalesh AP , Selvin Xavier Subject: [PATCH for-rc 2/3] RDMA/bnxt_re: Fix error handling in probe failure path Date: Wed, 9 Aug 2023 21:44:36 -0700 Message-Id: <1691642677-21369-3-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1691642677-21369-1-git-send-email-selvin.xavier@broadcom.com> References: <1691642677-21369-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Kalesh AP During bnxt_re_dev_init(), when bnxt_re_setup_chip_ctx() fails unregister with L2 first before bailing out probe. Fixes: ae8637e13185 ("RDMA/bnxt_re: Add chip context to identify 57500 series") Signed-off-by: Kalesh AP Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c index 1c76460..63e98e2 100644 --- a/drivers/infiniband/hw/bnxt_re/main.c +++ b/drivers/infiniband/hw/bnxt_re/main.c @@ -1253,6 +1253,8 @@ static int bnxt_re_dev_init(struct bnxt_re_dev *rdev, u8 wqe_mode) rc = bnxt_re_setup_chip_ctx(rdev, wqe_mode); if (rc) { + bnxt_unregister_dev(rdev->en_dev); + clear_bit(BNXT_RE_FLAG_NETDEV_REGISTERED, &rdev->flags); ibdev_err(&rdev->ibdev, "Failed to get chip context\n"); return -EINVAL; } From patchwork Thu Aug 10 04:44:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Selvin Xavier X-Patchwork-Id: 13348765 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BC8AC04A6A for ; Thu, 10 Aug 2023 04:56:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229902AbjHJE42 (ORCPT ); Thu, 10 Aug 2023 00:56:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbjHJE41 (ORCPT ); Thu, 10 Aug 2023 00:56:27 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 532AE2115 for ; Wed, 9 Aug 2023 21:56:27 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-686ba97e4feso464693b3a.0 for ; Wed, 09 Aug 2023 21:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1691643387; x=1692248187; h=references:in-reply-to:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=O6+mCBB50buflkRqf9h8/y74WZspgWDZq0A4GtX3hCI=; b=IDwiLtV/nGp0be94r334e2eiUKLCwkM6F57xfSMu71Ssc5+tinZxQaW+vPNH5DG/eO GShUXgxJsm9QtxOstIwoM+sGen5O1Clt569EYyj7Gxbh/OARY+/CQ+VMl98eEzZC47wL bjfh68GWPQnay0DrYR+vWQmbJ2Ru5xCzHTkUs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691643387; x=1692248187; h=references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=O6+mCBB50buflkRqf9h8/y74WZspgWDZq0A4GtX3hCI=; b=V6Fwc4Gdy7hjs0c6nLXgEgRw17nzwcs7ZmyWm3MCk4lHi5IkAfZHoR+4z2N2d+ARK+ Oi17zK64rdzBvQUCTrHoDR9MuaVg8eCx/idw3rjpXW4Q+ZhNUS8HAuTeub8z8UQZJUyV KW26jpStUIa2Mq1K3X3kbzn3xlaEo+1CjhP3Ld6bDrF24npAChQAt+rgtS0QYrjV+pKd s3OU/H2qBIEvzURsBFf3Yn9Fj8A+m48ZGxKiCI2FGVIV/1Sc4i2Q9eThdbdwJ+by8EPw G8aCkUntPFu0Xo7jHu1jv0pvx5z7BuHxGcgthLGSra305Gr/FATPIZFF5a9B41UD/dAc G26Q== X-Gm-Message-State: AOJu0YzTtAP4Lb+oAY5WXxb1ombf1eZl3zTI8B90pPXElsq/AdEOyXUI cNRa/cS0hGr0DuPLK0p+qQBz+Q== X-Google-Smtp-Source: AGHT+IElipVCv43VG/Quwx8MT8i+j06Se8hIROkWCLKflCCEWTN43YFzPAj+HqejINwiE7uEGeo4GQ== X-Received: by 2002:a05:6a21:7807:b0:13f:cd07:2b40 with SMTP id be7-20020a056a21780700b0013fcd072b40mr1362078pzc.3.1691643386735; Wed, 09 Aug 2023 21:56:26 -0700 (PDT) Received: from dhcp-10-192-206-197.iig.avagotech.net.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id x6-20020a63b346000000b00553b9e0510esm458672pgt.60.2023.08.09.21.56.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Aug 2023 21:56:25 -0700 (PDT) From: Selvin Xavier To: jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, andrew.gospodarek@broadcom.com, Kashyap Desai , Selvin Xavier Subject: [PATCH for-rc 3/3] RDMA/bnxt_re: Initialize dpi_tbl_lock mutex Date: Wed, 9 Aug 2023 21:44:37 -0700 Message-Id: <1691642677-21369-4-git-send-email-selvin.xavier@broadcom.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1691642677-21369-1-git-send-email-selvin.xavier@broadcom.com> References: <1691642677-21369-1-git-send-email-selvin.xavier@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Kashyap Desai Fix the missing dpi_tbl_lock mutex initialization Fixes: 0ac20faf5d83 ("RDMA/bnxt_re: Reorg the bar mapping") Signed-off-by: Kashyap Desai Signed-off-by: Selvin Xavier --- drivers/infiniband/hw/bnxt_re/qplib_res.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/hw/bnxt_re/qplib_res.c b/drivers/infiniband/hw/bnxt_re/qplib_res.c index 5fd8f7c..739d942 100644 --- a/drivers/infiniband/hw/bnxt_re/qplib_res.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_res.c @@ -819,6 +819,7 @@ static int bnxt_qplib_alloc_dpi_tbl(struct bnxt_qplib_res *res, } memset((u8 *)dpit->tbl, 0xFF, bytes); + mutex_init(&res->dpi_tbl_lock); dpit->priv_db = dpit->ucreg.bar_reg + dpit->ucreg.offset; return 0;