Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp368150pxx; Wed, 28 Oct 2020 06:52:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy4yjqXpQgCoRLjeHwKipcOPGv2oLkbbGTRaNj9jb93mU/T/zFYSx6JTv7EUudCZaS1qIA1 X-Received: by 2002:a17:906:141b:: with SMTP id p27mr7947075ejc.205.1603893170381; Wed, 28 Oct 2020 06:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603893170; cv=none; d=google.com; s=arc-20160816; b=IXYns5tGqTPyqGjIJ6xH+VFPoc5smkPz5wh6pQ4hy2F9I4vHdVi02RKpEJAkaXiYFD Vp15qPaOxIuy29vW9y/GF9R+fuz1qGTN4EXAJdALhSM2MPZZ0TWgRjuK9/vF4Zx43BEu r56Gsu8mFTF99/Ci4Hx9frsuJ6WbmP0zLE4wuKyQy+9eAkrlsy7M2jpG5tb5D1tw0s8d wGldiGt7qKb6AiZbDIUPPv1cPKM+/l6r8avd0OJZvT893hIBioOz63I9f+8bv/4cfo6k +msek2iI4Weykiv4+cHUXQT1omJw0Syw0cX4EkDHqAjviv6i/m63xGPa6EQLthsS6mmE Viow== 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=m1y7G3IFs1XgOL84D6qajCkTS7W3IMH2R0+xOIFRGIM=; b=MvfuRri4o7p2GB8OrkKfOgJFUOMJwhaDx2nFlVvkMKAqJ+CDL9IkVlosWUDETDvnTL jEDf6RXoLFo3wGioDcKKpd9e2jInGTyMQtMUT13i/tfEIJqrVwBIMuHm3Rb4dfDTRkik A0iqg4ZhoTa758cgVdhDLVc90BBQumu8IZhtQr/yGc7MaUGLBDe7rSy/83v21srwOsfw lIuPqUkMXnrpAU3YkKc0cyVRcjMMfuRHnbBQvovPivcIc7TWQmt4POopjVKBjpKJ3mDL L4mKx6TUiQXrtaiumOGdI1jquAaCKih6HVaUhFffHErgjUyRM6L+xnuXR03q6tSoRYLr h/yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lrziUagB; 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=fail (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 jr1si3058858ejb.164.2020.10.28.06.52.28; Wed, 28 Oct 2020 06:52:50 -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=lrziUagB; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1803279AbgJ0Pwb (ORCPT + 99 others); Tue, 27 Oct 2020 11:52:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:46372 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1799096AbgJ0P3y (ORCPT ); Tue, 27 Oct 2020 11:29:54 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 9E49522264; Tue, 27 Oct 2020 15:29:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603812593; bh=wHEBUNkcsiftxN1X5zv+IIrtBCPEKGCBkQheH9aKlTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lrziUagBRYHbMOWsk39mC1yS18doPfHn8RJ93assVRNoRowtWZSUeyp4tEIRFGCsC 1adoDTN7wtPHxOib9jcT61gNgbqmEgIZ+3+unxn0eRHrOzntYkx5W3kGkZGOGp2lLh iB9QComa64V7Pdun0XtJcA2gteCsMT882XKugRVo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ong Boon Leong , Voon Weifeng , "David S. Miller" , Sasha Levin Subject: [PATCH 5.9 263/757] net: stmmac: use netif_tx_start|stop_all_queues() function Date: Tue, 27 Oct 2020 14:48:33 +0100 Message-Id: <20201027135502.917378612@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@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: Ong Boon Leong [ Upstream commit 9f19306d166688a73356aa636c62e698bf2063cc ] The current implementation of stmmac_stop_all_queues() and stmmac_start_all_queues() will not work correctly when the value of tx_queues_to_use is changed through ethtool -L DEVNAME rx N tx M command. Also, netif_tx_start|stop_all_queues() are only needed in driver open() and close() only. Fixes: c22a3f48 net: stmmac: adding multiple napi mechanism Signed-off-by: Ong Boon Leong Signed-off-by: Voon Weifeng Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 33 +------------------ 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 1af25da4461da..122a0697229af 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -176,32 +176,6 @@ static void stmmac_enable_all_queues(struct stmmac_priv *priv) } } -/** - * stmmac_stop_all_queues - Stop all queues - * @priv: driver private structure - */ -static void stmmac_stop_all_queues(struct stmmac_priv *priv) -{ - u32 tx_queues_cnt = priv->plat->tx_queues_to_use; - u32 queue; - - for (queue = 0; queue < tx_queues_cnt; queue++) - netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, queue)); -} - -/** - * stmmac_start_all_queues - Start all queues - * @priv: driver private structure - */ -static void stmmac_start_all_queues(struct stmmac_priv *priv) -{ - u32 tx_queues_cnt = priv->plat->tx_queues_to_use; - u32 queue; - - for (queue = 0; queue < tx_queues_cnt; queue++) - netif_tx_start_queue(netdev_get_tx_queue(priv->dev, queue)); -} - static void stmmac_service_event_schedule(struct stmmac_priv *priv) { if (!test_bit(STMMAC_DOWN, &priv->state) && @@ -2872,7 +2846,7 @@ static int stmmac_open(struct net_device *dev) } stmmac_enable_all_queues(priv); - stmmac_start_all_queues(priv); + netif_tx_start_all_queues(priv->dev); return 0; @@ -2915,8 +2889,6 @@ static int stmmac_release(struct net_device *dev) phylink_stop(priv->phylink); phylink_disconnect_phy(priv->phylink); - stmmac_stop_all_queues(priv); - stmmac_disable_all_queues(priv); for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++) @@ -5086,7 +5058,6 @@ int stmmac_suspend(struct device *dev) mutex_lock(&priv->lock); netif_device_detach(ndev); - stmmac_stop_all_queues(priv); stmmac_disable_all_queues(priv); @@ -5213,8 +5184,6 @@ int stmmac_resume(struct device *dev) stmmac_enable_all_queues(priv); - stmmac_start_all_queues(priv); - mutex_unlock(&priv->lock); if (!device_may_wakeup(priv->device) || !priv->plat->pmt) { -- 2.25.1