Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3066850pxj; Mon, 17 May 2021 16:56:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyycjvhCFDcDRbvE3LAcnov+EmzzCiF/5D7g/gyGSYL1dqJsfB8UG/D7Q15ih5VjQPtPZ9w X-Received: by 2002:a17:906:604a:: with SMTP id p10mr2739765ejj.148.1621295772112; Mon, 17 May 2021 16:56:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621295772; cv=none; d=google.com; s=arc-20160816; b=Ita57FA8gmPgRNJWZGizwxm7r0mi24rLEZJ+JBgNaEv/UCzOv98g4U2tGQh7F5Bp5n 8YZ5LWYTiM7HosGHgYE8osbLiP1536H3hq7zO6asWYMCOKGsMX90H0JDJLqbaE4frDRZ hPylXtBFAFhgI0dWBqQelumH9BmqFq/qRCQMBY+NEGowD23VM2om7YSTRisY2Aw8szT5 V5+M+h2ID9B+GM2QGWRyaToYK6YDetGLKpgvXF3dHXnbIdL/Z37QeULg//M6mvpWbX9q ChsgT3cZMsyvbtX9jzOgufDwFvrBZvGguUsMXIKiAHWxayarDvqdzsOvsIH4h02bCVdz cacQ== 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=bb0mz4t36Hqnsr9hBOdmdbOCCuKzc3k58b2uuYfRy3g=; b=UGHVYDdCvyZXlCTea/+Y14HdyhHE17KAGTNk2DIrUa2XswyHZ1rIGRYdviZa/uMrqP 5ZuE9t6GH5fp82pqmfBqupx699IQhJ0HqoL1sY3HBwaU2+GGMzA0xmg2DloZ7/qjbHLy cmh8bX0IMG9VB1XdN/PvMqkbIlYv5P/X976ZeQ36B23x3UN/EKpXzpgR9gcKvbO8M9bX cUCYEZNXk/SJFArgthId2CSrP7Y943qp1kF3xhLH0dYZBRlxAcVn7mJyR3bV5eaBIm5R faBfCaGLUApfqGxnlGKWl24S2t5aLJd4N73LYYgfjRIRN1kKx0go+ybBgisvuAwqTLIh oAXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="xfLJ8oQ/"; 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 x22si15724804ejf.188.2021.05.17.16.55.47; Mon, 17 May 2021 16:56:12 -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="xfLJ8oQ/"; 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 S239554AbhEQOYX (ORCPT + 99 others); Mon, 17 May 2021 10:24:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:59262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239173AbhEQOVE (ORCPT ); Mon, 17 May 2021 10:21:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A5EDB601FC; Mon, 17 May 2021 14:11:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260693; bh=N+K6TTedcgDguB5TVUshG9q0umiFW1TPlM1eEe/yEA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xfLJ8oQ/SCJQKZmg0m8t+43/Ipt18dU2ClRa+cLIXQRpxAYjY4tlX7pylv05vFUkP amtVDlTeNli/m+BAz1VuXD8mhOyyFJ/Vw+STMvhAg086209vy4Wllj0bPa/hnf0Om9 GMzCSKoDylXh1iEuA1h8eoEpQWuHdUenWd3WpKkU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Li , Huazhong Tan , "David S. Miller" , Sasha Levin Subject: [PATCH 5.12 197/363] net: hns3: use netif_tx_disable to stop the transmit queue Date: Mon, 17 May 2021 16:01:03 +0200 Message-Id: <20210517140309.251160673@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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: Peng Li [ Upstream commit b416e872be06fdace3c36cf5210130509d0f0e72 ] Currently, netif_tx_stop_all_queues() is used to ensure that the xmit is not running, but for the concurrent case it will not take effect, since netif_tx_stop_all_queues() just sets a flag without locking to indicate that the xmit queue(s) should not be run. So use netif_tx_disable() to replace netif_tx_stop_all_queues(), it takes the xmit queue lock while marking the queue stopped. Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC") Signed-off-by: Peng Li Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index d24bafb7ce46..0f70158c2551 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -576,8 +576,8 @@ static int hns3_nic_net_stop(struct net_device *netdev) if (h->ae_algo->ops->set_timer_task) h->ae_algo->ops->set_timer_task(priv->ae_handle, false); - netif_tx_stop_all_queues(netdev); netif_carrier_off(netdev); + netif_tx_disable(netdev); hns3_nic_net_down(netdev); -- 2.30.2