Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2661280imj; Mon, 11 Feb 2019 06:38:15 -0800 (PST) X-Google-Smtp-Source: AHgI3IYQ/b1aGKGjkd+Qhtez8h3NzKTnKoP7SuSgOzDl6Svn35A2EPba28F35pDBqHtcU7JpezfS X-Received: by 2002:a63:5e43:: with SMTP id s64mr33873833pgb.101.1549895895796; Mon, 11 Feb 2019 06:38:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549895895; cv=none; d=google.com; s=arc-20160816; b=OoznMRfa+pfcFTyuOJ73KXdgntkguCo448ORA39wO+aO52Ue3UriXCUOJ3+ZiR5shV t86mqSp/OKJ/GI1FS9CyjQzdxTPA4GZ97nnloh7l0ACfV8w5st+ON42gfP0zTOA6+dVL ovC/i+h8Z7lNSFvSKdEmaL9eIrCOcDTLUdBo9wF56BBWImGw4tG2sWJO9irfsw0Wt6Z9 xOHaC1AjpySC50PFk5KbOFLD2DbJ4My15ARe9gF4o+Im5+NQfusBeBEIhThSOJqq2idX qNaAkNAmGxiINaFz7JLJzKXOCh2PeGn/Wpoul1cxeQjtq1absYmbVR2tmFeB+oRust7+ JGIA== 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=oxMn50qxjoL0S5rvTGyvqaYgm+aXPXhYS+dQpKlcLVM=; b=lFBvnIdA6shf20rQKYHRdoHyn7PAvyyPrND31Y27Rsq24iHGrtg+BEnacmjoOBgFmA iIG7nIKzt5+nHfaxvuktjgS9EyJoNOo8YRdI73Spe8xPPoUk2gQ6l9zVhzwXgOMOmKx+ ofYB/YwWiu9y4JAhQRkyxWMxSJ3zSxstm328d6+/4jVTpLUjxIUyLS6yV5BceKb7vT+p p48s2uMzIhQPtpSp7/AN2fyenblFP119/A+nFcydBA9SF8rNZ2MVHsdBneCQFLI+4rZI HFzcGhOoZdJMPX8CXOD071JUf8dDDHrsH5Wl+ez1I52xxoSF7B5gc95bYXWZpstAe6Ew 3miw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S3jBE0NX; 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 z20si9217666pgv.159.2019.02.11.06.37.59; Mon, 11 Feb 2019 06:38:15 -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=S3jBE0NX; 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 S1731394AbfBKOhI (ORCPT + 99 others); Mon, 11 Feb 2019 09:37:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:46376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730726AbfBKOhG (ORCPT ); Mon, 11 Feb 2019 09:37:06 -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 4103420844; Mon, 11 Feb 2019 14:37:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895825; bh=mjAm/QKxfyT1jRVyldkpIRz0R5NSQs79h6mRIfQS5YQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S3jBE0NXsYtezWjW6yxfVhEzaWK7SfcyM6BNb5jYEsTwVj5wQ+LY1YM7Camu0W6sH 7E+LbjYPv5M1xcP0fqrJRFi2cUThJ7SknNC/8yGuC5crGh8yf43sAPKHPBKoV4GSor I9CjOHRPNuQfbOEUuyn2KHsc20XcnmhnuYpv4mmI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Chan , "David S. Miller" Subject: [PATCH 4.20 308/352] bnxt_en: Disable interrupts when allocating CP rings or NQs. Date: Mon, 11 Feb 2019 15:18:55 +0100 Message-Id: <20190211141906.448359989@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. ------------------ From: Michael Chan [ Upstream commit 5e66e35aab335b83d9ffb220d8a3a13986a7a60e ] When calling firmware to allocate a CP ring or NQ, an interrupt associated with that ring may be generated immediately before the doorbell is even setup after the firmware call returns. When servicing the interrupt, the driver may crash when trying to access the doorbell. Fix it by disabling interrupt on that vector until the doorbell is set up. Fixes: 697197e5a173 ("bnxt_en: Re-structure doorbells.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -4903,12 +4903,18 @@ static int bnxt_hwrm_ring_alloc(struct b struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring; struct bnxt_ring_struct *ring = &cpr->cp_ring_struct; u32 map_idx = ring->map_idx; + unsigned int vector; + vector = bp->irq_tbl[map_idx].vector; + disable_irq_nosync(vector); rc = hwrm_ring_alloc_send_msg(bp, ring, type, map_idx); - if (rc) + if (rc) { + enable_irq(vector); goto err_out; + } bnxt_set_db(bp, &cpr->cp_db, type, map_idx, ring->fw_ring_id); bnxt_db_nq(bp, &cpr->cp_db, cpr->cp_raw_cons); + enable_irq(vector); bp->grp_info[i].cp_fw_ring_id = ring->fw_ring_id; if (!i) {