From patchwork Sat May 19 15:53:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 136401 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2546590lji; Sat, 19 May 2018 08:55:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpqjjKpg3AzK17F0wK1rPuzo9VHpJ7PTW3A6UOxJy+xQFiKRHgCma+r84uxL7ohbM23k37W X-Received: by 2002:a17:902:a702:: with SMTP id w2-v6mr13742460plq.8.1526745355993; Sat, 19 May 2018 08:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526745355; cv=none; d=google.com; s=arc-20160816; b=wbUH0z3S8j7IoYsN5SDvzz1ZMpNuq+aEmq7l/yQ9D/MNiHsl75wl35LY/F9hPhMMeN sbTZj3LZ6dBu2UmSN1+VdlRorh8yZnXqLJUjM6I8wgrl9bWg5PWeyD54/08V5ubSaMFG DKhLviu9VAeJfs8NXRFD5/zYCxD2K06cA4EjzYVsLUPkFrmVQds26G+y/fnx0V9jjWj2 Bh5gaO2zyUbtPyfS7gQJDJj9LZ5fmoHcF1g87JX1g8a15uidoTXzm9krCFbVe9YA3uXS 7YEO4ov9eL90c2A5oZmzznM8Jt8tEJTalmEdzZtAyJDJIeYYP8MpX9eeXYViirpGEZ54 gFLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=lqMiYOV+rUU3c2fI4SulG11NzR7MLyJkS2RG+pQ4Y+k=; b=fKJcMBJNsY4ms07Omnvao19kHP7HMxv0G6y6uj4mdTnnL7oGMcd38d2H/IOVCXUsQj ue/j2nTDl524JoTi0TBjaf6fg1V42CagVaNliQnns5MC7V4kbjQucLAdxMuR8krzM2q+ ALVNvv/o5YhhclqJk0U+cq8Z7FtXqYJ4AY5AabwUYzN0AV+izN4klZAtnzTiS6MdB6jQ mXHf5fyCRmRQCxE6O4FSkrRDgpa+JLrPlEhZh/pwG4Ybn+f91MUjF7CLA+XZteBqgIHC 7FdeThy7zrNmPFhBxFRpCObL/CO+ZmLFklNMLquXTpJkf8M90+fKXyQIaMuwp/zanJjT mdrQ== ARC-Authentication-Results: i=1; mx.google.com; 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 g125-v6si7680294pgc.568.2018.05.19.08.55.55; Sat, 19 May 2018 08:55:55 -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; 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 S1752701AbeESPzh (ORCPT + 29 others); Sat, 19 May 2018 11:55:37 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:8124 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752623AbeESPy6 (ORCPT ); Sat, 19 May 2018 11:54:58 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 57AC9F2E94419; Sat, 19 May 2018 23:54:43 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.382.0; Sat, 19 May 2018 23:54:35 +0800 From: Salil Mehta To: CC: , , , , , , , Fuyun Liang Subject: [PATCH net-next 7/9] net: hns3: Fix for netdev not running problem after calling net_stop and net_open Date: Sat, 19 May 2018 16:53:21 +0100 Message-ID: <20180519155323.68960-8-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180519155323.68960-1-salil.mehta@huawei.com> References: <20180519155323.68960-1-salil.mehta@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.202.227.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuyun Liang The link status update function is called by timer every second. But net_stop and net_open may be called with very short intervals. The link status update function can not detect the link state has changed. It causes the netdev not running problem. This patch fixes it by updating the link state in ae_stop function. Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support") Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.7.4 diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 46e030c..2f0bbb6 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -3793,6 +3793,9 @@ static void hclge_ae_stop(struct hnae3_handle *handle) /* reset tqp stats */ hclge_reset_tqp_stats(handle); + del_timer_sync(&hdev->service_timer); + cancel_work_sync(&hdev->service_task); + hclge_update_link_status(hdev); } static int hclge_get_mac_vlan_cmd_status(struct hclge_vport *vport,