Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp175409imd; Wed, 31 Oct 2018 16:50:24 -0700 (PDT) X-Google-Smtp-Source: AJdET5c8y7Dn+HJnVPl/UEYjfd/KOLOCfETNj7yizXHFfFB3FA9Znlt5GqeBZlRIZaLl0V1u22Js X-Received: by 2002:a63:d00b:: with SMTP id z11-v6mr5106148pgf.317.1541029824895; Wed, 31 Oct 2018 16:50:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029824; cv=none; d=google.com; s=arc-20160816; b=OCOmbL//+HGiO8pRn5RgrZuZknCLVtodIdyfP39V76ARykjRg7ne4jlHiW+C9rTocD X4BRJehbiJME0lSwNsUO1DoDD/QwbO0odvSjtMBpEjYQG7lX1+ZQ6letEyg8pb1DF3a4 4rUW/o3WycwkC/n8zjPeQMAMNipITuxP5B4ZIceCgs5c+/RtUgx7xeDz4HWib2x1bm+f zLlUhEnp+6OsbPVqIwHF9c3/XQNL9ZStVb0ORl45KIz1QOLsGzZIAKTwMXk7KjUDJdJh u//8PTvZPn8GzX5hxE6FYuJ3I8PQ+zM99dZNxjhqPg190uZ8Nm5ejdT4Idr+e7lpJmA4 5JOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=CDvXvxH+jQKBrylVK788AgkR3M0PMwSQGmLsR8Ob/B4=; b=d1rDRfjXqpNBAvH4twrVJ6I4zNHk/y63hzUA3LqGAWEKGijcEK0yhyIN/OQvej0S7e bn0vkJkyRXTCA7jl4DXxftFLndsPEMCPazYQ8mOuYIw18eC+Cv6UNSYFNZ2l88l1gSak FHCEOCni5df2xD9lj5eJTnBAPYIY+VTEV8VnR5EnFdrTcWIHQUS0RiKmR4z6CRDnTwjt KtNxZH/rlZi2Rv9tyf9/A6bGJ13GDw6Eug4JeE7p4l71pSN5qFUoQRCK3ewZlARsKn8q /Ynp0V7bnY3BaQWHVh2R5CjhqGIoyw6WejxDmoR3lqDk/QJC7nt1V3iEuobAt8YmNjAz oaNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XBvAzuIj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v69si18274730pgb.3.2018.10.31.16.50.10; Wed, 31 Oct 2018 16:50:24 -0700 (PDT) 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=XBvAzuIj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728323AbeKAIGp (ORCPT + 99 others); Thu, 1 Nov 2018 04:06:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:53848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728269AbeKAIGn (ORCPT ); Thu, 1 Nov 2018 04:06:43 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7A1F12081B; Wed, 31 Oct 2018 23:06:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027193; bh=awt/G9gSc7+/pujsjfYrcn89gAlm/nY0qQQCBktt78I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XBvAzuIjn4q1zOnEGK9vfXReqQgHbBP1CZCdHqDGCHJJMjBtxGRMnQMOSF8Bras0X nNy239KiGiaE/JnWvEth2ygDDv5urEUx8//KHyra3ImfRJHlixsOd+CnRsQyBP1Fpj q4AsHpnXv04nVA8W9Vg9fYNdLIJlUFN4/yUKjZXs= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Fuyun Liang , Peng Li , Salil Mehta , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.19 056/146] net: hns3: Set STATE_DOWN bit of hdev state when stopping net Date: Wed, 31 Oct 2018 19:04:11 -0400 Message-Id: <20181031230541.28822-56-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 0c64089c914f..dd1e390ed68e 100644 --- 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_handle *handle) 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); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index d78064bb718a..320043e87fc6 100644 --- 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_handle *handle) 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]); -- 2.17.1