Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3487264imu; Sun, 11 Nov 2018 16:12:32 -0800 (PST) X-Google-Smtp-Source: AJdET5duFEfS11iZULRSISwepbW4AZBzJITuvx3YHaIQh+0YSr2J+Qhl6APdSZGeKW5yh3KuWdKn X-Received: by 2002:a65:5c81:: with SMTP id a1-v6mr15317539pgt.390.1541981552443; 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=H0rnHYCTiueO8JwOi2m+nBbFQTBsOmwe5eM+nLiF2llG4fwhtZPdkn2S+0gN81md4T FX3aVVue8qFg+zJA9Tykw/f+FnTZ2BxOLTI4pShHl5WV+rIiSUCkEL4B6GTyJKo7/tvA 90wdgPkN6xl8A7iL3qRD0aNNI3APVNNX1qbXVvdNfdTKyDMb8WYE4HiGAlxmUq9rOijT OU/j1f7Hm5HvLUwUTKv9NAIYDoxd/JY6AVxpZ8UQeA2VVpgo4c0/efvT4IB3WFwS5C+o mWCtd82HHXjwIhGlVXom9o9V//Jv2Xe3X/guINCRntTrpE73nfNToBVvAZ0DZXqrBTOu EYHg== 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=s0f8dD+8HplIcuUOCiLbrQpdI1rcqziLACcBxX3Yr9w=; b=UOdh0NzpQtaTi4MxaZsKy02zwqp2sKc/D8hLK5VssUm490RUiA/etolDPlXj9TAzpL bjgF34sKDaqVk+rUw1cumcdec2X0FoVVwGeMP/fJXOQy37w3yUuQCqRxW0zTC3ZVvcpc Tx4GvOoYuzx4qvE+sV51Rjs084YFpRGtyStzfLKUlcCDRrMSWP/wbDfEBw8LzK1ww4L0 q0huyGsBCqn1K9U0Zb/0oR4bn0EGn7UkT1LWhhAUeWg8MvGDrUWgeUgqgkRrLwCBb1MH UAdqqsxuy0vRHglq+ay59RJnHnshzHKOGLmImt5pfY6RPEgxSMX4wRaJcOCqKokfqxla RcHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ckV7ab1A; 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 d36-v6si15895371pla.384.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=ckV7ab1A; 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 S1730842AbeKLIRY (ORCPT + 99 others); Mon, 12 Nov 2018 03:17:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:59904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730696AbeKLIRY (ORCPT ); Mon, 12 Nov 2018 03:17:24 -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 C477A21731; Sun, 11 Nov 2018 22:27:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975248; bh=KOvE5svoDbYK0qXw7laFzEE9V3uGK1hsnquQM0mAzcc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ckV7ab1AjOXBpOC3VJ7KDu4t++9oUc8Cwyb2NIzFggbLEkSLEPCA1IRXA6bQCaFDA NAl8trU6loMvf8yXoJFg/gysCzpR4LrvmLa4dS0num7l/AfeW7tYHJ49jTOskuRuDU S0yxmtpO15caI6TPF81u1jzgPEJr5DELgMTegYfM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fuyun Liang , Peng Li , Salil Mehta , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 101/361] net: hns3: Set STATE_DOWN bit of hdev state when stopping net Date: Sun, 11 Nov 2018 14:17:28 -0800 Message-Id: <20181111221633.846347975@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: Fuyun Liang [ Upstream commit 2f7e489611bc685b8e00aba436032a8aac6cac57 ] We clear STATE_DOWN bit of hdev state when starting net, but do not set it again when stopping net. It causes that the net is down, but hdev state is still up. STATE_DOWN bit of hdev state should be set when stopping net. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Fuyun Liang 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/hns3pf/hclge_main.c | 2 ++ drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 ++ 2 files changed, 4 insertions(+) --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3814,6 +3814,8 @@ static void hclge_ae_stop(struct hnae3_h struct hclge_dev *hdev = vport->back; int i; + set_bit(HCLGE_STATE_DOWN, &hdev->state); + del_timer_sync(&hdev->service_timer); cancel_work_sync(&hdev->service_task); clear_bit(HCLGE_STATE_SERVICE_SCHED, &hdev->state); --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1451,6 +1451,8 @@ static void hclgevf_ae_stop(struct hnae3 struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); int i, queue_id; + set_bit(HCLGEVF_STATE_DOWN, &hdev->state); + for (i = 0; i < hdev->num_tqps; i++) { /* Ring disable */ queue_id = hclgevf_get_queue_id(handle->kinfo.tqp[i]);