Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4452777imw; Tue, 19 Jul 2022 06:56:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tNfwn2ElOJ1PuyTkmpxf16pxAETxPLSuZETzcqhZ9PVPcd8+lX0FvAD7K+8m5omWyPDtA8 X-Received: by 2002:a05:6402:274c:b0:43a:9204:95fb with SMTP id z12-20020a056402274c00b0043a920495fbmr44907000edd.259.1658239002244; Tue, 19 Jul 2022 06:56:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658239002; cv=none; d=google.com; s=arc-20160816; b=zFqMC3MntURYCCeXkP1i0k/1xQeb3aHHL8ffHmkfvoQUFvLB2c2WpY3vPdC1h8zZF2 mhzt+ud6c3JlUtBO8uERhaPAxftHJNjujwfm3isY90QaBipCTIjj10FdQ3JC63sYRSZ2 33F9rTsRU3LDCHCiO8MTkjNarmQ/IyZ1BzEw+1Y+4BKcO8G+R8aHMwxN0pEy3FnYt/iI GWirUN74iMaUZOmifTYOg8rMKbTdwPtttw01oZoZMmStayj6YXXtqyi4yCqrXLPsBmNa Gp8r1q133UUXv28u39H+xqCs+7n8MHebR7IbZ0Nrco3WXfbKv0H3H+NfbDQcIy5ecqUI gmVw== 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=ng2gr3Rpdpoh7g/vM4NilZRLLKdhOTITCzy9AOFiaPM=; b=kywbUaqZyh9dYa3xm3KoXRpzPpHfAEY9R//U4CJsfQapVkQp1adJuN819OOh12NhWz 4eD+azh2I9l0zeURR1RgTbngeWy+LRzmIJQ31RqP9UmElRzqCpxjY6lDQt6sDGPPrS05 2xkptAMiwVZNvT6BW9xblJMl24Ch9wLDUOeoV2RnZMvx8rkGXhyKnXjaLQ7tvLaIL9zH bgMe6PqfQ4UQy5dpCHR3t92SpaOW+TWkTqDYfDThSLLkmPglKoeX5aN6v1b06Ue8qUtx wfl9TFviGGOSTRZlIFgM/Fvc3U1ReFHKe5dfaQrX2TRo9XB1uHxNL8Lay6kMfF6BixJK g7mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="KgtmaZ5/"; 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 co13-20020a0564020c0d00b0043565bae501si17262191edb.210.2022.07.19.06.56.17; Tue, 19 Jul 2022 06:56:42 -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="KgtmaZ5/"; 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 S242105AbiGSM6Z (ORCPT + 99 others); Tue, 19 Jul 2022 08:58:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242456AbiGSM5b (ORCPT ); Tue, 19 Jul 2022 08:57:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E3C89B19C; Tue, 19 Jul 2022 05:23:09 -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 dfw.source.kernel.org (Postfix) with ESMTPS id CE3FE618F1; Tue, 19 Jul 2022 12:23:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98D9AC341C6; Tue, 19 Jul 2022 12:23:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658233388; bh=sbrNjhLCvn5a2AkRbEaXHTgvzEtiaBNNhza+/u7Y8Kg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KgtmaZ5/INc7RtnfAi3VnHEsCBP1/0J417923tlVDlDGRZNsjzHsrfPEa79pddu97 2XDxLPhbPAPUJhE7108dzzkTI7PgAGjsuYCy11pL8XR5qH+vIoYGf8gCUoqTiUxfyL V/aK/zOkFj+WAH872/VKPtJ3NrElJYMbd0ZnQJTY= 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.18 106/231] bnxt_en: Fix bnxt_reinit_after_abort() code path Date: Tue, 19 Jul 2022 13:53:11 +0200 Message-Id: <20220719114723.549336840@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114714.247441733@linuxfoundation.org> References: <20220719114714.247441733@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 ee6686a111bd..1ceccaed2da0 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -9916,7 +9916,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 bnxt_remap_fw_health_regs(bp); -- 2.35.1