From patchwork Wed Jun 7 07:54:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 13270121 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F95D8BE7 for ; Wed, 7 Jun 2023 07:54:50 +0000 (UTC) Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E882D12C for ; Wed, 7 Jun 2023 00:54:48 -0700 (PDT) Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-62b69b95a33so6608366d6.0 for ; Wed, 07 Jun 2023 00:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1686124488; x=1688716488; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=GRAWd5TgIlg3a1V00WobIR052JIKpWNHFDlf8mAf2dU=; b=hrqO19W4ECOHk7KW85jKiLaJEVz21WymK/r0rbHF7pn1i2+1wYHjkNx3kBnXLcAs7l tVEvU647BLdDARc6ZOKIbUkPpQKeQ0hPxPVQgIYX1AOc+U1Ot0qf3gpjLE02MS31xhfC qGCGmQmlNjbc+zFMn4SK0vxATmOCLh8jVAF2M= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686124488; x=1688716488; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GRAWd5TgIlg3a1V00WobIR052JIKpWNHFDlf8mAf2dU=; b=ML3wgTjLYwzXnpof0Qs1s9+u+zkkxlepClfs72BOyy+rTHK8t/FshNHtf0itmZgwR8 q/UWpLEDLj7iyrYZuzhuoHwHVJPvxDRa/PYWZ/jT6KQmY5g+GTn3Fmf8CbkgN1Awee7Y 5ZCuEMm1DaJod+EtEpueFJ1duzUTMpjJ0MpBYy0Aqnjw6p5rUorvqYHgEFmkYDqSzTOe wrS+0K+q8ADzF0+ffET6QDycGzNHVhUc4Kszv7NB/QRhTbxYDkGJze4vIsYKSz0oJRyx 21jZQZM4wLqjrYjaK6nyZjWhrQMJmwJiwqrcsVyO+x6KmnSq7kBPFmv4Nw1iWTaKfqA9 /NfA== X-Gm-Message-State: AC+VfDz1kd4/oAQml/FR1/AIBW1EtOdoPGRdQhFDKUqcjbsJkm6+7Ext Duig5OB0K+18acHl2HLgMGheFrrpMe2CCTOkW2o= X-Google-Smtp-Source: ACHHUZ6rzCZHgIO4xF42KoW1AsUANe8/+MkTRF/TFlvJXGScCOsq7NnLO+Qvi3wkU2ulLZP/WpWyRA== X-Received: by 2002:a05:6214:21eb:b0:629:78ae:80f8 with SMTP id p11-20020a05621421eb00b0062978ae80f8mr2348156qvj.10.1686124487603; Wed, 07 Jun 2023 00:54:47 -0700 (PDT) Received: from lvnvda5233.lvn.broadcom.net ([192.19.161.250]) by smtp.gmail.com with ESMTPSA id cs12-20020ad44c4c000000b00626362f1bf1sm5850817qvb.63.2023.06.07.00.54.45 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Jun 2023 00:54:46 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, gospo@broadcom.com, Vikas Gupta , Somnath Kotur , Pavan Chebbi Subject: [PATCH net 4/6] bnxt_en: Skip firmware fatal error recovery if chip is not accessible Date: Wed, 7 Jun 2023 00:54:07 -0700 Message-Id: <20230607075409.228450-5-michael.chan@broadcom.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20230607075409.228450-1-michael.chan@broadcom.com> References: <20230607075409.228450-1-michael.chan@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org From: Vikas Gupta Driver starts firmware fatal error recovery by detecting heartbeat failure or fw reset count register changing. But these checks are not reliable if the device is not accessible. This can happen while DPC (Downstream Port containment) is in progress. Skip firmware fatal recovery if pci_device_is_present() returns false. Fixes: acfb50e4e773 ("bnxt_en: Add FW fatal devlink_health_reporter.") Reviewed-by: Somnath Kotur Reviewed-by: Pavan Chebbi Signed-off-by: Vikas Gupta Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 2d39b43ee7cd..5c8d409d7af8 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11602,6 +11602,7 @@ static void bnxt_tx_timeout(struct net_device *dev, unsigned int txqueue) static void bnxt_fw_health_check(struct bnxt *bp) { struct bnxt_fw_health *fw_health = bp->fw_health; + struct pci_dev *pdev = bp->pdev; u32 val; if (!fw_health->enabled || test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) @@ -11615,7 +11616,7 @@ static void bnxt_fw_health_check(struct bnxt *bp) } val = bnxt_fw_health_readl(bp, BNXT_FW_HEARTBEAT_REG); - if (val == fw_health->last_fw_heartbeat) { + if (val == fw_health->last_fw_heartbeat && pci_device_is_present(pdev)) { fw_health->arrests++; goto fw_reset; } @@ -11623,7 +11624,7 @@ static void bnxt_fw_health_check(struct bnxt *bp) fw_health->last_fw_heartbeat = val; val = bnxt_fw_health_readl(bp, BNXT_FW_RESET_CNT_REG); - if (val != fw_health->last_fw_reset_cnt) { + if (val != fw_health->last_fw_reset_cnt && pci_device_is_present(pdev)) { fw_health->discoveries++; goto fw_reset; }