Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4875641pjb; Mon, 27 Jul 2020 07:22:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJziyb8fMUcqsk+ecmAAVgRv5XY5Tesgm4D2rLfnP4PaWWGxsRpSzN9ljzQ2ecen9mLT01dk X-Received: by 2002:aa7:d7cf:: with SMTP id e15mr21912261eds.236.1595859736383; Mon, 27 Jul 2020 07:22:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859736; cv=none; d=google.com; s=arc-20160816; b=vokA3EjskwNgMKTRCoyTj9eBf4QyvCAz1Bx65guLBtyPBE9xt3aGA8iMXVoDAEAwua 8PDOKBrE/2H9fXvIL1rCVrZ8jgdEFgke+/2+ySHFfAvLsH4HUmrJaChE2pRMTV65iUtT dbcWalNQGF8qhNTs8ikbW565io5L3LelS5lSaXvV5AWmUaosNEQRmGPEwCK8UzkZf6CM mDm9GvdH9Ln+Dm3OuVXnrkexqRPxINLWMElazhXb1KXFs113T26yhvy65x8zu+IGV6Gy RLBEguxD6Ynqqpkxfn0bQMwOdq9wEIzQL/nwkVxv3klvnQomffINiYiBHQRfSx6hMPKD qe1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cQlkW4jcYNbq9ZJUGOXd4/8YvuF5IvK2YeBmV1KsaMo=; b=dz+YzybrtIWo3/FviIV+A9Zq+AXgZhdQVYH71cCiTzd0qTT83RClCSWEQOdKDEfWIZ j0m2BcmeRu7WjJchi4Flva67apTHq2KVzzSGNbSEPOHhDiFlEwPWYTXyHkUNuMnkBWCX pfmlTh3WYDSM8UXHmJXX0oiWAcT7vTKLqhh+duIWKrd1E1fYgMu8GSfhajSbrdkDOzfL 6/5R85TjJDRNqUt6KhFNsPB8G3BP7GY9vXdRozpX9LENVKFHbei5NnTkzj4SZWlsE4AO zS+NSwwCUcj0ofVYM+FojiIVX6mIIhA/25G4qxv13Irsw7PLQwru9kLM7DZmA8j1CCV0 QFIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PlkGHAFU; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jp23si5590068ejb.5.2020.07.27.07.21.53; Mon, 27 Jul 2020 07:22:16 -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=@kernel.org header.s=default header.b=PlkGHAFU; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731558AbgG0OUb (ORCPT + 99 others); Mon, 27 Jul 2020 10:20:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:48730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731548AbgG0OU1 (ORCPT ); Mon, 27 Jul 2020 10:20:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D19DC208E4; Mon, 27 Jul 2020 14:20:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859627; bh=O9Z9tiqTm9cnKbRq09/xuN1LzIH51JT2PRH3U8rB0eU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PlkGHAFU5hZO7IZVRY8nSLMwTsHdW/tHvQ2Ng20241QwISejDrM9KBbflS2YksQIj AMzggPMNdYnu7+L/hzJROuNfNNNX10rGlL+d+Tkdij6Epd8zX1uR6X2Io2tjZbsIGb WJj5sAlOMq8JzIOJhf/xjgMkH7cQgjCAhTiUbq8w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vasundhara Volam , Edwin Peer , Michael Chan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.7 043/179] bnxt_en: Fix race when modifying pause settings. Date: Mon, 27 Jul 2020 16:03:38 +0200 Message-Id: <20200727134934.779055697@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vasundhara Volam [ Upstream commit 163e9ef63641a02de4c95cd921577265c52e1ce2 ] The driver was modified to not rely on rtnl lock to protect link settings about 2 years ago. The pause setting was missed when making that change. Fix it by acquiring link_lock mutex before calling bnxt_hwrm_set_pause(). Fixes: e2dc9b6e38fa ("bnxt_en: Don't use rtnl lock to protect link change logic in workqueue.") Signed-off-by: Vasundhara Volam Reviewed-by: Edwin Peer Signed-off-by: Michael Chan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index 360f9a95c1d50..21cc2bd127603 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -1687,8 +1687,11 @@ static int bnxt_set_pauseparam(struct net_device *dev, if (epause->tx_pause) link_info->req_flow_ctrl |= BNXT_LINK_PAUSE_TX; - if (netif_running(dev)) + if (netif_running(dev)) { + mutex_lock(&bp->link_lock); rc = bnxt_hwrm_set_pause(bp); + mutex_unlock(&bp->link_lock); + } return rc; } -- 2.25.1