Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4889447pjb; Mon, 27 Jul 2020 07:40:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw7USpnGwP9MEwT8li47Lv4psHM12/hwYQ88mKZEZoh9dfJaRtQADolhPal31bIbJ45aum X-Received: by 2002:a17:906:3756:: with SMTP id e22mr6753746ejc.487.1595860856039; Mon, 27 Jul 2020 07:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595860856; cv=none; d=google.com; s=arc-20160816; b=jtqu+YI9pHDT1q92Sz5SMr/wc9ZGuVVGWTw8xXj38Fy0oFtK58+/AAel1iPRLwMGXS FSA653PlCOwtzSASYORLNE2rYXs28JOdRIYRt4sNpWiFKazv+pKYoq5yUvypvoq+adn8 zonhL7XBX8KvEcNz28dDESP+Hv2JquEpoJK6xEF5Fxi77kmQleAHx1ZYcJXsIkokA+K3 F6pN8UkTuW33JHiEMB7zRp2NHdy1FcXRkE8MbG9CVPBeewHi0oZrawtBe8sqOdJUFmRq V+eJgZwRGVVW7s0G5H01nCmExJrzveAJgQn16QvnkcPjFAR1YKlRMUvZrmTwf5uRNogP hO1A== 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=OnRt7xxVaclmUh+ucBNDUM36CQOXiUHK0yvhx8EwwRM=; b=LHtYWhq4aEW+ipd2aeMyBSJSL3eOd/qVAg+xE9NKk3ow8eRTtw2aA2k5kAtVauLk5R wgLSzyIbUJ2IIGAyJOwUVg3ZOYKtCQS0Gg0t4HSbm96XEC+xZey/du1Icat0IZkQ+U2F 7eglppAtr4oj7EHRYvdADZDRluKVYWu0yRkUJe8bZWRPRqvF5QXJzT9EafhSeom1juOY iVnVjn+UnyQda5ThUH/X2AFcPXXACMhGymsF3nPlFFHNiziKrq0XnO4ezI/xGK4S5V0f ll68JT7pgQHV0H2YGyeVuOTj1kHoGPhz4mhaQDVjRewbg9oLlcTU7aOae3AwgFLx1l7m opRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Mq9nbZHM; 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 m10si5720103eds.471.2020.07.27.07.40.34; Mon, 27 Jul 2020 07:40:56 -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=Mq9nbZHM; 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 S1733003AbgG0Ojc (ORCPT + 99 others); Mon, 27 Jul 2020 10:39:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:60526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729378AbgG0OJy (ORCPT ); Mon, 27 Jul 2020 10:09:54 -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 1246A2083E; Mon, 27 Jul 2020 14:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595858994; bh=TIhLDenDiUzlHo0WlCWSDO4biF+szFVqHksXro8nHYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mq9nbZHMCeqzbPJtzXKqPGi+vwJ11lMQUF/Fg6lyAITTzf5gHsIOzB0MbrAwuOFR/ BayaY+Ly8inpZLXIaZQ36MHtkS2NtKOgYEp9A+CK/gX7PNobUPxvgvzdlj4zTR2e8f WK/HjEnUWIYLMCKv1U9kc4A9iPfShwFHdYWrB48Q= 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 4.19 25/86] bnxt_en: Fix race when modifying pause settings. Date: Mon, 27 Jul 2020 16:03:59 +0200 Message-Id: <20200727134915.625690928@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134914.312934924@linuxfoundation.org> References: <20200727134914.312934924@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 047024717d654..63730e449e088 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -1392,8 +1392,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