Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2475968imm; Mon, 16 Jul 2018 08:38:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcJ/uHsjOJV6vuWlMKAv4AjbiRH2Ac6FtUOZZKv3QnZPhdTFpfA6srRQ9sm63HMwLSOxygw X-Received: by 2002:a62:4909:: with SMTP id w9-v6mr18762038pfa.154.1531755498509; Mon, 16 Jul 2018 08:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755498; cv=none; d=google.com; s=arc-20160816; b=up9Q6Ewkduz5m6b3uviPCHMttbUMfo03i2w9v1st+HgJoqhQLTv0jIj2khDk20B1O0 7s7NsRPQx/gT1kUXV0lbN472GLbGaeyiu1/Q8snPX4dGGRJIvjDVVnh95TXzHnryKl+w 5hs4ZSu5GgWJ/CND14aTnotABDlJ47+O1F/avMjHKRBSAr9ZvujQ4CU/Hf3l+0I3RfiN c65yHSK45CNfKXSST5LdWcCbQLglNc4ltVW+ZaY0E0Sb42wCk4WV8u2w/zVJC/APDoLh zlK6s62FR2UQyt6MBdIS17hDs6vcyLmgei7qtT7jZYcQFo5ns+V/BOW9LTYkAdyaPP2y z0nA== 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=2hX8LvQPAcOUSAcEZBJELh70FXXVI19QOxTjW+97nk4=; b=s13fDvzK8sBe748v3PZt0c941hXNVmXDwuP5DErdv81GjxKmpL0MPBzROiLYZKUA3J 27nruHYYaj1y+dzt9A90dOEjtqSVlAmxIazREoQUfKPMMArxmEDQv7AKDTm5hgPGbX3Z /OpvkCuV2GVbejOMFZQZT23PtdoFppsR7bplL60jhjsSd5pp2nCrMjZ9VeQgt5QlQqZb aUi3OaxRTtcbCzTIvqZpW9w5IneNV6YX8OI64mtMk8CE+gd2rqSQK7iKyMwUzP7X703R C02kw4JHWAID0qyMTT76CBj06adlqYJeF3WM27OWX2/pIhctcTWddXHHvImFOzFfHCjN P+oQ== 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 r10-v6si28723740pgm.535.2018.07.16.08.38.03; Mon, 16 Jul 2018 08:38:18 -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 S1731198AbeGPQFZ (ORCPT + 99 others); Mon, 16 Jul 2018 12:05:25 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:9678 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727653AbeGPQFZ (ORCPT ); Mon, 16 Jul 2018 12:05:25 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C722E7B6DBD14; Mon, 16 Jul 2018 23:37:12 +0800 (CST) Received: from S00293818-DELL1.huawei.com (10.202.226.54) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.382.0; Mon, 16 Jul 2018 23:37:07 +0800 From: Salil Mehta To: CC: , , , , , , , Huazhong Tan Subject: [PATCH net-next 2/9] net: hns3: Reset net device with rtnl_lock Date: Mon, 16 Jul 2018 16:36:20 +0100 Message-ID: <20180716153627.476-3-salil.mehta@huawei.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180716153627.476-1-salil.mehta@huawei.com> References: <20180716153627.476-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.226.54] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huazhong Tan Since current locking was not covering certain code where netdev was being accessed or manipulated, this patch fixes it. Signed-off-by: Huazhong Tan Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 8bbf4e5..3886290 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2820,15 +2820,13 @@ static void hclge_clear_reset_cause(struct hclge_dev *hdev) static void hclge_reset(struct hclge_dev *hdev) { /* perform reset of the stack & ae device for a client */ - + rtnl_lock(); hclge_notify_client(hdev, HNAE3_DOWN_CLIENT); if (!hclge_reset_wait(hdev)) { - rtnl_lock(); hclge_notify_client(hdev, HNAE3_UNINIT_CLIENT); hclge_reset_ae_dev(hdev->ae_dev); hclge_notify_client(hdev, HNAE3_INIT_CLIENT); - rtnl_unlock(); hclge_clear_reset_cause(hdev); } else { @@ -2838,6 +2836,7 @@ static void hclge_reset(struct hclge_dev *hdev) } hclge_notify_client(hdev, HNAE3_UP_CLIENT); + rtnl_unlock(); } static void hclge_reset_event(struct hnae3_handle *handle) -- 2.7.4