Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2761315imj; Mon, 11 Feb 2019 08:05:43 -0800 (PST) X-Google-Smtp-Source: AHgI3IalBDJJYDA91luNRZ86xqhs8DFToDyxvqG58iDGa/0ItvWl9ZQLxziDCEBNn6p/NemFst23 X-Received: by 2002:a17:902:14b:: with SMTP id 69mr37052512plb.120.1549901143848; Mon, 11 Feb 2019 08:05:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549901143; cv=none; d=google.com; s=arc-20160816; b=ZX4FGQUGXn3pMS9+ktSNJwDOwGlIe533S9eBgQGINa1HFTUkY9+3z4aOWXUgsN2gj6 RUlUzQfAsSDbKqO6HOoeSJa/8GypwKGyKSr6RJFjRNAs41xQuJMKPL/UTONXft47Awj3 fKEduJfoyVzGuvDYiSNTPngI3FsuD0lhvxZNyio168szDxKVRrmx0Qdo/ycOJbfqBTMh 3pgGGwKMf9VWkvpBwIDo/uJwve3TTmX/OgCWkjzaDcOUvKjEa9DLwYim2bNYjbbkNK5O Xs88KOm3Z8ruByr0Lz7FB4QsTziVEWR3jATwJtraxCz9j4FlL7qZ3cPFDTwfOtWpKvtR YeQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EhZnQcg96kriAprqfTobZW32g6+LruQ6pkXS6FA89Zs=; b=f/Jkh745TotChckuOXyJB08xn4CVmlYCGRBWQHhxPIaVkoyOC5GyidCsk80hbEInP6 0yTrb+LjyfJct+B5TaoHuqEGq9xlOXiX4R25Ad+OUXlagDOwiBCh6lsavQVjHNiF8JSY g1rmzWpqoNXBVxPeGRPLAvQo8TCUtmDdFYBjbILFUGJty2kS9w3DqjThCGJ54YVR3FpR DBBhm9cDBS0aohuVMi5DI+6VYROmK4sN4UebE6wzufN11U4u8FIaSpEa1Hwo75qTS4e1 ShqausIBz6Us9vxjjP7ESfPyjTCj+CkYR6Spy+fYHE9jsU3RekfcFGvR8y6DlDFZMbIF k8IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sMh4qr0B; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p65si319164pfp.140.2019.02.11.08.05.19; Mon, 11 Feb 2019 08:05:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sMh4qr0B; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730333AbfBKQCt (ORCPT + 99 others); Mon, 11 Feb 2019 11:02:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:36128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730038AbfBKO35 (ORCPT ); Mon, 11 Feb 2019 09:29:57 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3370B2082F; Mon, 11 Feb 2019 14:29:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895396; bh=qKQsPld7+Gq6rUxJyQb1tECT4aTIdeFg0YFSTf/ufjQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sMh4qr0BktRW7zkv4lmbVVFxW9aG2AOCMQRusE6FSgqCGJhkBoI1fv872H3dvp2++ D4xKXYvzHBHDtNFhIcF2FkL63Isxs54ewXMc+caC9s7nVpajJQ8g4DzMJjATFX2l4o KJBZjc8KNFBNEwfWWg1yxVrOOKdKX0HAf4sFrXMs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Chan , "David S. Miller" , Sasha Levin Subject: [PATCH 4.20 192/352] bnxt_en: Disable MSIX before re-reserving NQs/CMPL rings. Date: Mon, 11 Feb 2019 15:16:59 +0100 Message-Id: <20190211141859.335051590@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 36d65be9a88052cdfc8524eb591baf0e6c878408 ] When bringing up a device, the code checks to see if the number of MSIX has changed. pci_disable_msix() should be called first before changing the number of reserved NQs/CMPL rings. This ensures that the MSIX vectors associated with the NQs/CMPL rings are still properly mapped when pci_disable_msix() masks the vectors. This patch will prevent errors when RDMA support is added for the new 57500 chips. When the RDMA driver shuts down, the number of NQs is decreased and we must use the new sequence to prevent MSIX errors. Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 5d21c14853ac..50a4c3ddf977 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -7203,23 +7203,26 @@ static void bnxt_clear_int_mode(struct bnxt *bp) int bnxt_reserve_rings(struct bnxt *bp) { int tcs = netdev_get_num_tc(bp->dev); + bool reinit_irq = false; int rc; if (!bnxt_need_reserve_rings(bp)) return 0; - rc = __bnxt_reserve_rings(bp); - if (rc) { - netdev_err(bp->dev, "ring reservation failure rc: %d\n", rc); - return rc; - } if (BNXT_NEW_RM(bp) && (bnxt_get_num_msix(bp) != bp->total_irqs)) { bnxt_ulp_irq_stop(bp); bnxt_clear_int_mode(bp); - rc = bnxt_init_int_mode(bp); + reinit_irq = true; + } + rc = __bnxt_reserve_rings(bp); + if (reinit_irq) { + if (!rc) + rc = bnxt_init_int_mode(bp); bnxt_ulp_irq_restart(bp, rc); - if (rc) - return rc; + } + if (rc) { + netdev_err(bp->dev, "ring reservation/IRQ init failure rc: %d\n", rc); + return rc; } if (tcs && (bp->tx_nr_rings_per_tc * tcs != bp->tx_nr_rings)) { netdev_err(bp->dev, "tx ring reservation failure\n"); -- 2.19.1