Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3699823imu; Mon, 28 Jan 2019 09:15:16 -0800 (PST) X-Google-Smtp-Source: ALg8bN7u9mm/O4tuuJj/ZxlkhzQAaQawR4xgSam1n86Vy6j5OhbG19fUHhtMv57PAXCXQALk7Czo X-Received: by 2002:a63:4c04:: with SMTP id z4mr20659547pga.312.1548695716259; Mon, 28 Jan 2019 09:15:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548695716; cv=none; d=google.com; s=arc-20160816; b=FNCpkEk1p0i6o+WrwKUtjlysDVBc1JmejY1Gjd42OMVBy+W1xedLL5pxur38ObnuwF ijoTFxfmMf+2KkvKqArgMHxYETyAGynonJJjjNxpiwqG7LtZIDaHSzXYdGSftFWJ4Cfl idDn5n5IoOvZVjT61GaemBQGslobXSQCj4tP7lpV3Pfv9VDrgJMyal+SflHUXUfnLPIp 0/qz6VoKwFabYpTrUtQYOjuMiAWcQ8yNZV+wnmKQStLKGD16AGT9tFlJgtz4CFDOA6sK Uws43zZrJaztnJjVikGIb84zatTuedcL39sZoyUoOBK8BvjY0RzPIgUqN6bCDtKw/w5b Vv5w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=A9S8wSOIma2BKUxNjkjrb9uVZGDNNMD9252GAqFJsug=; b=SSGGyTZ7t329vsXUrS8i9IxLQuRTMuoOcWh6/FiUXgwMgZ2MCNHDgxc2RD4Umgn6kN TWNDGnwUBRQZrdz/Q8dII1nKg3EWZ9WX0f7nLSws6VVwfmyKiNskarw8xn2tmfCIYvJj kfu5yjBxnz8EKgtOLNVHNpus21kMkSeIs+zFuswgErucD4zd83ZxnIWDaYL95xj6G0Zw ZpuqO71a+D0PD9+HL9oHiL35mT2HzxnVyPANp9xBEPsEZXc5Y+D7boq3p29/r9b0QABQ ETYXLYxqTNMHiyGefjVvsPfEbeCKv29a3D0v+NUJm/+mEOiNnP/tZcD0iWLaRk6NvjLi 9kNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=n030O25d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si33606276pga.219.2019.01.28.09.14.57; Mon, 28 Jan 2019 09:15:16 -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=n030O25d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732445AbfA1ROx (ORCPT + 99 others); Mon, 28 Jan 2019 12:14:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:58042 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731482AbfA1QHZ (ORCPT ); Mon, 28 Jan 2019 11:07:25 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EC8062147A; Mon, 28 Jan 2019 16:07:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691645; bh=uHnkHQQsOVEeoAnRkGNL9lBBtPsK+Co/sNtCztttgWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n030O25dj8PlOr46ECGSTZ3sq5YnxaifAhWGd4z9JyYV161/zoTuVEZkOzKylSXA4 q5xqgOndpEB4CyY8qfWENK+mUBsBlioMod4sUspB8YOceY3E950R60Q/8XxHKbYPVC d5P3S+I2pYdDgNExHCQwMHPrlTx9BRBn76l8bVi4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Michael Chan , "David S . Miller" , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 171/258] bnxt_en: Disable MSIX before re-reserving NQs/CMPL rings. Date: Mon, 28 Jan 2019 10:57:57 -0500 Message-Id: <20190128155924.51521-171-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Chan [ 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 e2d92548226a..034f57500f00 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -6073,23 +6073,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