Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11788899pjo; Thu, 2 Jan 2020 14:18:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzLLmdaeuhLmVMIdfUV3HL3Y2pJZaNkIHYqey8IWrCjuBWjJKc8SCuqv+EYs3UPWzqPnr04 X-Received: by 2002:a9d:53c4:: with SMTP id i4mr84939926oth.48.1578003494409; Thu, 02 Jan 2020 14:18:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578003494; cv=none; d=google.com; s=arc-20160816; b=y10yA+fGrCgJfsm4lHK7zF7O11TjbXQvJJBH4ra8Y8xbGwkycVjEbiOxjJJeujH52j Yt2fPpFPW041y2qMZ/A5glLTdqqsDQmMnyzw61XTDJ02DyHnHzZupSnIPyEoGZS6E4sg COW3DZwVunkal3BMX/h3GbQB9e5IDp6KKo/3a1NRJT0F1TIqE/rGQcIzmHHlcp1gsIWQ A98N3/tvbNh0AVkRvZQmbL3PnhGi/Z9VpEGrXEnhhtWfi9HoJgcSREKcXdwHcn/IN0oG i7nJYlzYf0tDLPn7/hGjxTHZoeKJ8J0IXLIyOSQfJmQf32/TOcHxR6Xv3/ZTO35sPYXU 6DpA== 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=ykrXbNmbYZ/OZUgGfpnpQkZj2nwiP9tYkG7vVNszK3Q=; b=GYfpB675eqQin9Xd7+0Q7BqXLvhRQ5/kLxE2MzrjcGL+piLabqeoTWnZ73AJUB8E7r Ks29YEABZTIOgnJi4qm4eOen/HQH6cEYveaXrHNSNMDn9f+bM047Pxr++CAk5EZxFby6 Jl4ZSoFD3xIKxOKHnNlERidkZM5GsRObuMgvghAvNOzpEc3ct4/TRsFaWLZqNBbIbhQE qp7ZhQdL9kcO8PRHiKAS8AKEdoR8zgIzDDAMXASYFhvcXrVwzi6/ZI0bbgA1DbQgrmcx ZnZ/gjfdfEeSTVz+22Rd/C3F8GcEeR0AlYJNxHdUYP1rfN/rvSxl7/72KCcskE8ezoJX Lxqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lu+B1C9E; 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 8si30332256otd.274.2020.01.02.14.18.02; Thu, 02 Jan 2020 14:18:14 -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=lu+B1C9E; 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 S1727570AbgABWRP (ORCPT + 99 others); Thu, 2 Jan 2020 17:17:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:59568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727374AbgABWRN (ORCPT ); Thu, 2 Jan 2020 17:17:13 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 75BA521582; Thu, 2 Jan 2020 22:17:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003432; bh=6gg8n245oKU6viEJFYY+Mla3YUq8ygLK2YyYWrBCq1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lu+B1C9EClHWHzRki/5HXpjr1Luptwk1CZ7SOcwI7LZhUnUyqSPBwLj41eBNwrKBz WhtaVe8UXBT+qblwSzo7AFlnyVOS5aZiyv1edfvSzaIAeoZoCwfa8v1GKRjhYKKYh+ 8RSko/3GoHbbma+FEvzhaCRF/2/LJ1MxfyUxEj2k= 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 5.4 159/191] bnxt_en: Free context memory in the open path if firmware has been reset. Date: Thu, 2 Jan 2020 23:07:21 +0100 Message-Id: <20200102215846.425151646@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Michael Chan [ Upstream commit 325f85f37e5b35807d86185bdf2c64d2980c44ba ] This will trigger new context memory to be rediscovered and allocated during the re-probe process after a firmware reset. Without this, the newly reset firmware does not have valid context memory and the driver will eventually fail to allocate some resources. Fixes: ec5d31e3c15d ("bnxt_en: Handle firmware reset status during IF_UP.") Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -8766,6 +8766,9 @@ static int bnxt_hwrm_if_change(struct bn } if (resc_reinit || fw_reset) { if (fw_reset) { + bnxt_free_ctx_mem(bp); + kfree(bp->ctx); + bp->ctx = NULL; rc = bnxt_fw_init_one(bp); if (rc) { set_bit(BNXT_STATE_ABORT_ERR, &bp->state);