From patchwork Tue Jul 12 02:26:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 12914469 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F03BC43334 for ; Tue, 12 Jul 2022 02:26:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229909AbiGLC0l (ORCPT ); Mon, 11 Jul 2022 22:26:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbiGLC0k (ORCPT ); Mon, 11 Jul 2022 22:26:40 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F027132D8C for ; Mon, 11 Jul 2022 19:26:39 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id i8-20020a17090a4b8800b001ef8a65bfbdso6607521pjh.1 for ; Mon, 11 Jul 2022 19:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zV1a814olpDnSbmo97nfIlwRNcemiuv9zZ0syJp1uHE=; b=KwX91G8WkeyFWJo6OLPWD/VS8DyWpu6dhmTjTyYRq7FyzjH65ti3DA2x9riaWVL5dy IE19C0X2Zz+ifodn3Q1ro/ZQSveeMV18u1TPcyq0H3/WMQHWzYUu6M/9v4iUZ7hph8/o hpFCqDRbR16Uh4uKPEZDd3qbtSM4IzwGEwFSc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zV1a814olpDnSbmo97nfIlwRNcemiuv9zZ0syJp1uHE=; b=QdrfQYwArMXNW5pyme493vRBNcpXoSC17LRBy8rELkDBjzWCY9JqHja5yNBhMOKR6P vbf5oQH6VtjQetInzqgK9xKxbNGV7QP7mGde+Hj4MXxWQn+SXcVk+li9nzmqEqxtXmrh 9KTJJaDsI1Z+h4PwP2Eh7y9B1g3vTBnEQe7NMSoN2uJ4aim3Mvl+HVS4bRLhyZ7zCZS/ dXOIH1dQxy0x69ffw768fxQYHalecbqZScZeyvGDcTLzYlP2hk5TYC2oYwap2FK6xCI+ Fp+cfONtWQUvWP91IxMfz+MPWp3JaMRk0vpMRdeoB8N1YoFQ4TeCWufDKt4ukr2M3jxn P6/g== X-Gm-Message-State: AJIora9za6ZrUkY+2M0Hm5zsX0ZC0PlVHl1sA4J5Qy30883lamfCrz5s N9AyxxF56anqcbR2XNarNIxnWw== X-Google-Smtp-Source: AGRyM1uxmmaAZcuXYEbkxaqeVQjmhgV/BUUV7JsM5hgvav3yc0jnaGHIMPsTPPmIFkZQnRFYa5EYAA== X-Received: by 2002:a17:90b:1e4f:b0:1ef:aa42:f196 with SMTP id pi15-20020a17090b1e4f00b001efaa42f196mr1538306pjb.228.1657592799259; Mon, 11 Jul 2022 19:26:39 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id p4-20020a62d004000000b0052878f66f8asm5443049pfg.132.2022.07.11.19.26.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jul 2022 19:26:38 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com Subject: [PATCH net 2/5] bnxt_en: Fix bnxt_reinit_after_abort() code path Date: Mon, 11 Jul 2022 22:26:15 -0400 Message-Id: <1657592778-12730-3-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1657592778-12730-1-git-send-email-michael.chan@broadcom.com> References: <1657592778-12730-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 --- 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 7ba181ccaac2..cf9b00576ed3 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -10065,7 +10065,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);