Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3424073pxf; Mon, 29 Mar 2021 01:39:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJym/LAVu/dX6jjaKOwLxKSra53lHrqTCBmbsnPixTn1+wwOYnUpMof1UKGv6h52xc1s3p3z X-Received: by 2002:aa7:db51:: with SMTP id n17mr28223711edt.259.1617007198908; Mon, 29 Mar 2021 01:39:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617007198; cv=none; d=google.com; s=arc-20160816; b=QLLrxAr1ZwftY1ByQwdlpc9wZvne0Sft0JYk04NYXE8BxaSjLW5rX8LhS2N6uWQe1D SB8mLbDLTF9q/jRA6a/GZWkLz/2zfeAscWohqdsmOSs+R1dBUHoMg/qzo75K92t2YrZ8 HttTtaiOg/OMzuLqj4yvxmX7+suA+GK9B7ljtMw+FZycnKr57qtxpEmdO1KsYI8SDMIh tnGZAonqbCX7N0+NM0CyeKcKGkH0iGMk0K/NpId/AagQooYZdht2j4Qr0YZAtyMlOlt3 xhooGVDCqchNtmG2js2jEsnGVLFdIewG+GIWDcTgSUC+O1g2NdLw3QpSDpfgP1j50jTV uKzQ== 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=iUbcpSYSPKOQcoA/vw61do9vqsrXhFQFnBX8gFLjRtk=; b=PNJo93GeEiJxC8jiw6SpE8XjIYx9zpnYO2q9Wjc4QV0txJLYAvzuNXoITCCmdDTqdo b3oY+hOwF1VRw8xJoYNHulyddaEgYQroRzD0ek+BmYjt9GyM+abZGKMshpNfdv4vc1UB oIJxc5TtYX38WbbZjsnUnE84eNkrxtJluzMFgeruWzHtVZ45EXsMUAIN3brsADoGeMD/ 4WfMgv1jzFX5+aU9CG43Xni5ZZ0tQ9bjNP1Exzrg9hbSEVOMA9DZwfg2fxUJ4phhZTQL gS1250+JAhADU6Vlby2Ek0aTmVleCq5HM9LywAL2EMAmXoJcw7Hr5jEdywhS6+6mj7VK 5nPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1nmiyzkq; 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 a4si12240174ejy.263.2021.03.29.01.39.36; Mon, 29 Mar 2021 01:39:58 -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=1nmiyzkq; 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 S233630AbhC2Ii0 (ORCPT + 99 others); Mon, 29 Mar 2021 04:38:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:39408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234049AbhC2IWy (ORCPT ); Mon, 29 Mar 2021 04:22:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 69D0561477; Mon, 29 Mar 2021 08:22:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617006165; bh=tdEaXVDDIWKyUitt6dJGoDdSzLBhq6FyXe+kMzTgEWk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1nmiyzkqvxI2iHhnQ5zfdGplzafPseasWDBau/P9v2pcDf5EXpYnxqQ1i/egd614y J+liY4krE2VqgrcCeIDzjDMpa5q+clsa+rVhgYRyIiLpe69CjSxX9/tjAbZjffIV26 swbSFPDJ/41JH5THzUgXnoLnJaMg6XHMs2xLRZPU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jakub Kicinski , Sasha Neftin , Dvora Fuxbrumer , Tony Nguyen , Sasha Levin Subject: [PATCH 5.10 105/221] igc: reinit_locked() should be called with rtnl_lock Date: Mon, 29 Mar 2021 09:57:16 +0200 Message-Id: <20210329075632.721088252@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@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: Sasha Neftin [ Upstream commit 6da262378c99b17b1a1ac2e42aa65acc1bd471c7 ] This commit applies to the igc_reset_task the same changes that were applied to the igb driver in commit 024a8168b749 ("igb: reinit_locked() should be called with rtnl_lock") and fix possible race in reset subtask. Fixes: 0507ef8a0372 ("igc: Add transmit and receive fastpath and interrupt handlers") Suggested-by: Jakub Kicinski Signed-off-by: Sasha Neftin Tested-by: Dvora Fuxbrumer Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/igc/igc_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index b673ac1199bb..7b822cdcc6c5 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c @@ -3846,10 +3846,19 @@ static void igc_reset_task(struct work_struct *work) adapter = container_of(work, struct igc_adapter, reset_task); + rtnl_lock(); + /* If we're already down or resetting, just bail */ + if (test_bit(__IGC_DOWN, &adapter->state) || + test_bit(__IGC_RESETTING, &adapter->state)) { + rtnl_unlock(); + return; + } + igc_rings_dump(adapter); igc_regs_dump(adapter); netdev_err(adapter->netdev, "Reset adapter\n"); igc_reinit_locked(adapter); + rtnl_unlock(); } /** -- 2.30.1