Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3487261imu; Sun, 11 Nov 2018 16:12:32 -0800 (PST) X-Google-Smtp-Source: AJdET5cZ3GdnwoEHVNkCMGtb+zJYHn4zwwdmMsCARFWe+MJ1TMkX882EXAb9YmF0YOE4uASc5fgL X-Received: by 2002:a63:b94c:: with SMTP id v12mr1670299pgo.221.1541981552340; Sun, 11 Nov 2018 16:12:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981552; cv=none; d=google.com; s=arc-20160816; b=nlm8EafSpuDtsRsJGxExWJVr6ZEWojB2hO/RNaL7ogZ4WFxD42XRwuxbgQu37pjAdl Psqr4GKEZuTk6scHx7mJ3BLdhglrRDtOTv6OaysP9XWg3Aoi9EXjX18T2ujf6oBUmztg I5seny4hrLp4MXQHVZmZrwB9RQEy0ddweqqyPjppS1PY/iB+EFWgEBfOD5VBeSjm6opd Fg31bASNZL7ksQM+rVKZulJMiPEVEijR+PbrQ8BsB4wV2pGoSva+ZeBbegPNnKuWFsyi jtVukHkJredCCT3gv2c/6R0v9LpOuP+KS85nBleJ6CcZKtJFGpyJXOtPomeAi4A7H+hI cKoQ== 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=RdB8CrJyTRwWriJlea0VwEnN1LEp7MAlHj3OxTXGQCM=; b=gYntQaDz7rtKeAFKg0tIusAEzM8YgGKkQpNggulpz1OcRhi0ix/yaA6bu0rP1BseQA wNpjGr91VqwFQhDD3ZS0dA4enKAQAWd/sxFRBCZdbyfL+vm3Z5jaJus0eEUfs7SDkh+Y RRpCwwOlAWH4fsP0tB+qG5yEVdtL4fvIzhFkLEPy+veNUipGGECUW97VQUS12jfXf2o2 cSVwrkAK6MDfKYGxYbNsSGJwvaP5H9MJb138v19yhNSoRinrciUmq5KcIQMSHOv3cq/z 0wSY9AalIqppkuxLGOyTgcC4Ebg8f7nOqBJnL+yc8rxK6XLidtd4CZkhE+xAfW9FkPEM T+Ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i6m2Cdvj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1-v6si13907860pgw.151.2018.11.11.16.12.17; Sun, 11 Nov 2018 16:12:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i6m2Cdvj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731567AbeKLKCW (ORCPT + 99 others); Mon, 12 Nov 2018 05:02:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:60776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730603AbeKLIRU (ORCPT ); Mon, 12 Nov 2018 03:17:20 -0500 Received: from localhost (unknown [206.108.79.134]) (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 E35F3223C8; Sun, 11 Nov 2018 22:27:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975245; bh=gbahwvlC6Z9JRuSwHHAmVdMQYuKoKmswGfbwX0WezSw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i6m2Cdvj0OVu/8l4XcSPITBGD3rSwTt6QfyffAQyWK3d3TbnfEfUBbkGjOCwvs3O4 k6pVpG4BdwLqdzr+EYCjMnlr7KgWK4HyeMvpEA0VhWhV4tCBfLZFUuKWDdTKhWhNFD GVLUKoVEaScEUfXoCt7S121565iHXYSSjYb8UGvw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian Shen , Peng Li , Salil Mehta , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 095/361] net: hns3: Add nic state check before calling netif_tx_wake_queue Date: Sun, 11 Nov 2018 14:17:22 -0800 Message-Id: <20181111221633.073077947@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jian Shen [ Upstream commit 7a8101109dd37837f587cd56f3111d4fc17a07f5 ] When nic down, it firstly calls netif_tx_stop_all_queues(), then calls napi_disable(). But napi_disable() will wait current napi_poll finish, it may call netif_tx_wake_queue(). This patch fixes it by add nic state checking. Fixes: 424eb834a9be ("net: hns3: Unified HNS3 {VF|PF} Ethernet Driver for hip08 SoC") Signed-off-by: Jian Shen Signed-off-by: Peng Li Signed-off-by: Salil Mehta Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -1915,6 +1915,7 @@ static int is_valid_clean_head(struct hn bool hns3_clean_tx_ring(struct hns3_enet_ring *ring, int budget) { struct net_device *netdev = ring->tqp->handle->kinfo.netdev; + struct hns3_nic_priv *priv = netdev_priv(netdev); struct netdev_queue *dev_queue; int bytes, pkts; int head; @@ -1961,7 +1962,8 @@ bool hns3_clean_tx_ring(struct hns3_enet * sees the new next_to_clean. */ smp_mb(); - if (netif_tx_queue_stopped(dev_queue)) { + if (netif_tx_queue_stopped(dev_queue) && + !test_bit(HNS3_NIC_STATE_DOWN, &priv->state)) { netif_tx_wake_queue(dev_queue); ring->stats.restart_queue++; }