Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4449694imw; Tue, 19 Jul 2022 06:52:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vti/SNPZ8S0EVv51JtLWM81bA+JZomiI64yTgcwQVtbwb3ysnaT78i/alX8t/q9Kb5mq3Z X-Received: by 2002:a05:6402:448b:b0:43b:5ec6:8863 with SMTP id er11-20020a056402448b00b0043b5ec68863mr16364673edb.377.1658238771962; Tue, 19 Jul 2022 06:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658238771; cv=none; d=google.com; s=arc-20160816; b=Lbj+3yX0FNBGiqOYMbsRZVsRkp7xrSZ3Ly4+EpPKIsYrPoYWuEKDFx0ZXBIQh9p0IR VMpVDonMVDPPXvZ0WJSOSjGSCW66Ory8uQY61PKqCf6Qz/cOF3Thy1Uj3W6vRVRhHVK+ xg9S761mjawzl9l3Iy+Z9n9mA1O4SHh7yX4lyHNsfr7txiYuHWKfoPVpxHcNCtNo4wrl 9Ftn4flRfChbeES94kPTCBiy9p05d2eJCIJsJHNS944wGkr4l/B1exxwGz1tc1v4nvLi aI8b2EKvGSPSCwFv3trEG22kjuRP4fjIqGmvqKx7SkBGOEYM8fYzDklw+gvwmIf5D32X kHDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BSCcyE3esCu1KGmMqj8rWDqmFcUXW7fY9qX6p2RaGRg=; b=M9sObiGH8FZ26kF2DDTL2EqNBheS0KEtWF2h2UYDs4JNrHXBaqI29pOsNz8dEWeivP 1f6cAwTdwB3zd2BprBYZEFcnhmbEGgQTr5MvtKFYBAZmKqJl2nNEojdpOXA9ODVKD7+N tvml9s5oEluXD8w1+cPUVG+h5LBmz2vOGv1ecne0OlVYbe3s8coKreOiFXxYXObfpgvr MJQjCzRUhemJwxVKPf69xYyr3Cgx8WZ6cgTh/2r8uRO68EsatKGexebotODDipmued2w 6TJryIf/L0gPNx1hdp5w8eZyjRvGZh8EUIzmVq8v23G+LL/hWXG54eHZmhJCKj33EiKQ uhcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BojNICCq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne29-20020a1709077b9d00b0072b87c68bf1si21572688ejc.68.2022.07.19.06.52.27; Tue, 19 Jul 2022 06:52:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=BojNICCq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240495AbiGSMg3 (ORCPT + 99 others); Tue, 19 Jul 2022 08:36:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240528AbiGSMfG (ORCPT ); Tue, 19 Jul 2022 08:35:06 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D99002ADE; Tue, 19 Jul 2022 05:13:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BC16DB81B31; Tue, 19 Jul 2022 12:13:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 142F2C341C6; Tue, 19 Jul 2022 12:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658232828; bh=rpiQO8Sjibs+LwSJCBHBCpxHAgLFPuQs1Ttf3a7TM9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BojNICCq/qnoEsqEsLnrWQJ1yEh6pPjECY8FwDvGfUA62Yi5Olto1FGr2YhUVOWAx AMJbRWuzVj4T+DnYHPx+IeJ0uIrtsTXc+AQF3JhjQi9AvE9zBrqfKxDwF9aGaWjWxs aRdeTiK4RKY1xBkXfGHoyp7s7VKOMLOIB0YGF+64= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pavan Chebbi , Michael Chan , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 080/167] bnxt_en: Fix bnxt_reinit_after_abort() code path Date: Tue, 19 Jul 2022 13:53:32 +0200 Message-Id: <20220719114704.316223780@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114656.750574879@linuxfoundation.org> References: <20220719114656.750574879@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Chan [ Upstream commit 4279414bff8af9898e8c53ae6c5bc17f68ad67b7 ] bnxt_reinit_after_abort() is called during ifup when a previous FW reset sequence has aborted or a previous ifup has failed after detecting FW reset. In all cases, it is safe to assume that a previous FW reset has completed and the driver may not have fully reinitialized. Prior to this patch, it is assumed that the FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE flag will always be set by the firmware in bnxt_hwrm_if_change(). This may not be true if the driver has already attempted to register with the firmware. The firmware may not set the RESET_DONE flag again after the driver has registered, assuming that the driver has seen the flag already. Fix it to always go through the FW reset initialization path if the BNXT_STATE_FW_RESET_DET flag is set. This flag is always set by the driver after successfully going through bnxt_reinit_after_abort(). Fixes: 6882c36cf82e ("bnxt_en: attempt to reinitialize after aborted reset") Reviewed-by: Pavan Chebbi Signed-off-by: Michael Chan Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index cb5314945589..6962abe2358b 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -9806,7 +9806,8 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up) if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_RESC_CHANGE) resc_reinit = true; - if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE) + if (flags & FUNC_DRV_IF_CHANGE_RESP_FLAGS_HOT_FW_RESET_DONE || + test_bit(BNXT_STATE_FW_RESET_DET, &bp->state)) fw_reset = true; else if (bp->fw_health && !bp->fw_health->status_reliable) bnxt_try_map_fw_health_reg(bp); -- 2.35.1