From patchwork Sun Jul 18 19:36:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Chan X-Patchwork-Id: 479782 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY, SPF_HELO_NONE, SPF_PASS, T_TVD_MIME_NO_HEADERS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27C16C636CA for ; Sun, 18 Jul 2021 19:36:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 131CA6108B for ; Sun, 18 Jul 2021 19:36:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232342AbhGRTjx (ORCPT ); Sun, 18 Jul 2021 15:39:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbhGRTjv (ORCPT ); Sun, 18 Jul 2021 15:39:51 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8EA3C061762 for ; Sun, 18 Jul 2021 12:36:52 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id h6-20020a17090a6486b029017613554465so816350pjj.4 for ; Sun, 18 Jul 2021 12:36:52 -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=Hh9rG2EbBgTHz6YteXKWobEw4rt1UICIoqpTaWRs3ns=; b=dj+B7O91nae6WwouqIHgjH2lYJtlItrWatucqi87RZGqaJzJXemHLgh70Yo1d4NzwV ++mn+V0woY8jmnGqwAdz/KKLpECTXt6oU3ppUdCM5uXBQXbOqiyWS0h6nngoP9GsnjGz TKFywnNThl7bf7th/pchxYErtUeBcXi4g+2VU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Hh9rG2EbBgTHz6YteXKWobEw4rt1UICIoqpTaWRs3ns=; b=J8IFVGO37bauBYw2zdVztF60CkQ5D6s9HpPMqn3NitI5RoNduk4PdEpxIXrzj4w6Cl 4A7OBly3Eo4sHDdCtpgQxxHJr0ZJpju9Ue6Aow0duh9ICoOo1SbEszL9LqheLlmoaaxL 3FCQRDmLtzN9tauOloVeLnvzN7U0eVOPHu5n3b/8ZLp4X2ExFBm96KlJuW58HI3TlrUm hdRR8Dc21kQMBhCGWAteLhRf6x1LtsVT/FirtU2TDYdFWj4Fkj0MuuAIRsxMAriejXil 5Z880y1JNgDV6nl3pwisXk6OAsNuTWza3DFsgSHogKFc5J/BD8FAR71OrQa9dHcxuJwB 1D7A== X-Gm-Message-State: AOAM531RjtVEfWQTKIH9rvc6ypyc+ZX83FqVn9kYbfU1no0j9KsdWCEy qREvx/XACoNDd03SLuBjNhnGIQ== X-Google-Smtp-Source: ABdhPJyk/8LKfC44kGVBPgqXsq3fzZ40QZ2R6sjCn+OTfsXz2C/HkEgo9DLLmpG36Gi2TgORtHw+Ow== X-Received: by 2002:a17:90a:bd04:: with SMTP id y4mr27129067pjr.127.1626637011919; Sun, 18 Jul 2021 12:36:51 -0700 (PDT) Received: from localhost.swdvt.lab.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id 22sm16743648pfo.80.2021.07.18.12.36.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 18 Jul 2021 12:36:51 -0700 (PDT) From: Michael Chan To: davem@davemloft.net Cc: netdev@vger.kernel.org, kuba@kernel.org, gospo@broadcom.com Subject: [PATCH net 4/9] bnxt_en: Add missing check for BNXT_STATE_ABORT_ERR in bnxt_fw_rset_task() Date: Sun, 18 Jul 2021 15:36:28 -0400 Message-Id: <1626636993-31926-5-git-send-email-michael.chan@broadcom.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1626636993-31926-1-git-send-email-michael.chan@broadcom.com> References: <1626636993-31926-1-git-send-email-michael.chan@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org In the BNXT_FW_RESET_STATE_POLL_VF state in bnxt_fw_reset_task() after all VFs have unregistered, we need to check for BNXT_STATE_ABORT_ERR after we acquire the rtnl_lock. If the flag is set, we need to abort. Fixes: 230d1f0de754 ("bnxt_en: Handle firmware reset.") Signed-off-by: Michael Chan --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index fdfb75a1608d..39908a3d9460 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11992,6 +11992,10 @@ static void bnxt_fw_reset_task(struct work_struct *work) } bp->fw_reset_timestamp = jiffies; rtnl_lock(); + if (test_bit(BNXT_STATE_ABORT_ERR, &bp->state)) { + rtnl_unlock(); + goto fw_reset_abort; + } bnxt_fw_reset_close(bp); if (bp->fw_cap & BNXT_FW_CAP_ERR_RECOVER_RELOAD) { bp->fw_reset_state = BNXT_FW_RESET_STATE_POLL_FW_DOWN;