Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3674182pxv; Mon, 26 Jul 2021 09:09:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycpm9ka/+civ7SAZJc+2p29lHGLQeymzJAB0y2KHAAVjaI0yVAASCfhqvk//nO3yDEEXr0 X-Received: by 2002:a05:6638:3708:: with SMTP id k8mr17285889jav.58.1627315779753; Mon, 26 Jul 2021 09:09:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627315779; cv=none; d=google.com; s=arc-20160816; b=VMsjSDvplEEvkLsEN9aNoHV9wolQt6AW4VyJUOMhhmXPe1JR/dLEhA9V2hyIWI7CPq p3lGVzFSnPjprJdkXo+jauNt4pjjclcN4ELw4GUdQWLriiHNf6Kg7Iq369uF/2POuQQ8 I9l4w6YfDASQHBDnTCWcVBkp8zhgN7jbUgU8N/4r5oohaNcLTHsHbrWx7fnNW4z4u3fV yIYqhY9B3T+K3KCrtrHnEdkKMd63p5Y9IGjtOJpe6SeHPypr81G4JzJtCN+9k7IJ8HWb UA27o95jjVU4FzG07Mvin9EByDTcVbuMdhsUhwACGRFOoYMRClOdYNT1upe4UMwXUG+X +sSg== 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=yRpZlvvjDVix7HI8VYfEvBk34WQKqWIbn6Jw/9PvBsg=; b=QD8QJOqIjWT3vuPPL6ovx1pizNO+b8AorbGFMKivpkor19addm9T4bV9FvFJYk1E/7 zUfwER8BZIoViWSJQDMjnjNK4eK3pb9CniE+SkXpkysIZDhJTU4+VFf4LcJmOepn2Z+N ecMJ014dD6QGGhbzcgvR2lzSA4PydAJ3yqBOqI44cH1VBNZc0T5V97JUtjFyee2ioYcf PHf+7Nc/QF+gyHWiBnBBrvwBEyyrcBDqE9xpImqUa39Wvj6btm4zDKLQjDoAPiLaVd3y mE4nlfwVpQ+7fQx5ucousUuyV1k2WvCXaDA8bh9PCd+ZjMxVaFeq6WZwhh+H5rlPitup o9Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=v3XeNypc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si205643ilu.143.2021.07.26.09.09.27; Mon, 26 Jul 2021 09:09:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=v3XeNypc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238264AbhGZPZP (ORCPT + 99 others); Mon, 26 Jul 2021 11:25:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:56082 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236879AbhGZPQ3 (ORCPT ); Mon, 26 Jul 2021 11:16:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1C7AB60F42; Mon, 26 Jul 2021 15:56:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315017; bh=0GgKxFC8ghrohYqcjtaPwdicgfloUS+9xer7YRIFMCU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v3XeNypcvSOXM9BpwW22r9tDWIgY67nkDtldsQzD/a4i6pdyNSMCfBgSnkFDQDqzd 1xsKQOrc+06lapdEX5JqsDBVYlbXglHL7Ydnc/dpc9pctZlXt3bjAJ75MQ1sm0NF3F b6nMSPgxvdVA8Kf2ViZfqeC0QP0eVDZq5+v6ZV00= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Chan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 053/108] bnxt_en: Add missing check for BNXT_STATE_ABORT_ERR in bnxt_fw_rset_task() Date: Mon, 26 Jul 2021 17:38:54 +0200 Message-Id: <20210726153833.383297944@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153831.696295003@linuxfoundation.org> References: <20210726153831.696295003@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michael Chan [ Upstream commit 6cd657cb3ee6f4de57e635b126ffbe0e51d00f1a ] 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 Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- 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 e840aae894ff..f4f63c359bdb 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -10735,6 +10735,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; -- 2.30.2