From patchwork Mon Jul 16 15:36:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Salil Mehta X-Patchwork-Id: 142033 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2568397ljj; Mon, 16 Jul 2018 08:37:30 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdiRvvP8beqLxC3OnoMvlZPeM+er0yp6rrVg+Ev/tOQ1cOIBh3ooIILOJF4GUSjJ2wEn0zW X-Received: by 2002:a65:49c7:: with SMTP id t7-v6mr16102633pgs.23.1531755450593; Mon, 16 Jul 2018 08:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531755450; cv=none; d=google.com; s=arc-20160816; b=jgoA3I0fGm42m5iu9obOW/lzQ0nPR/6Pvxj2RxnBeLVn+RUTcCUBHV/F4Go9xsQ08a m/42LWwahXT+NoC2iDZowjpto2bP9y5pnsaNpGih28FjOBaKcm6JUEUM8XIZDqyFBsPN 6ZvbxjLMS9HLgUzru5sD12pjaU8nSioncVxwmYRNmjccNc5QvNJAPlJhjw5CnPEt+VIT jvUHxHUbMzeoMLEf3r4U5qrgtQI5vScK83ip57r7FF5nX4cnUjkHyF2nhkfyZvw79vCy dezS58jDo21xqo129MGiQnk3E3BP8YgV5Dne+teq/NDhYt5v10Tq4TLs1DplQ6+E2FJe E3pw== 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 138-v6si9724114pga.188.2018.07.16.08.37.30; Mon, 16 Jul 2018 08:37:30 -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 S1731221AbeGPQFZ (ORCPT + 31 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 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(-) -- 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 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)