Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5669326imu; Mon, 26 Nov 2018 03:49:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/Wzoev2/lmpTZV25OLoM9jDZTLYzFh8NPLlGnrwrq1LILy5xAqka+y6p9R3b4V1HFuoBnDX X-Received: by 2002:a17:902:2ec1:: with SMTP id r59-v6mr20964309plb.61.1543232957741; Mon, 26 Nov 2018 03:49:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543232957; cv=none; d=google.com; s=arc-20160816; b=aQyURrxuv6XR/hEJ+E9P0gLjUshZ4MCN94UZwNaQXt/c8FlaqfuiHmeRC0bbC/Tzaj CyftU9EVBVxeDdf3nggKPqFMaXdykchxjtjE9Eg7iGKwLoAucExQkLd8PSJHui82QhYm w6OY1zEuHOdEsGso9PLsW31hGVYEZWzSmMxZBY5F7TC0FELS2x7wlELPWltit3gISyBg +F7+8FXxIYIx1Q0j31p2retm3uC1nmiMLJDlvIylFbOBJP5FWipAzGLfHf2IgHYeksOW GsqAOxAK/8J1JF08rHVMlIp3csWj3BExPfqxEWVCErSAzwvbFNOlOz3unc6N29e+liBp UJZg== 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=aeBiLaBEHEWMmBbv05P368TrmsLEyViOK+1zySd7T/s=; b=eTltKZOO7wVbpkIMLB3gGGeQilcCZvVdov8VIVjfrtSE12YKFi6ZZIpnbw+bjcIlJN Xg3CJucxzhzvga2pawlf5ExF2ntWW7jtIO70eVlYsLjElHmPmLMrwPee3Nnncmya/kWS 1JpEj+P+4wlZJOXyekilvKSiCcKxF0RzWiJAjkaYcYAc7rTHNYafqDRZOm/1Jx+SSK+y 4fE+ZExCEFgizaRSvbf0a17dapyfUQA9EG31mcga2NEsuA3e9+L2+5BTlgBoKGM5Vrcf Ov+F8t+AXGIU8D1ha1yJG0b+Fz3CeXABJL/m/Rmvw5o0hMYMG71fZwggOig1kJrJusS0 QyGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hD9nvuJc; 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 l185si80350pgd.253.2018.11.26.03.48.57; Mon, 26 Nov 2018 03:49:17 -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=hD9nvuJc; 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 S1730668AbeKZV4y (ORCPT + 99 others); Mon, 26 Nov 2018 16:56:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:40508 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729988AbeKZV4x (ORCPT ); Mon, 26 Nov 2018 16:56:53 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 05AD22089F; Mon, 26 Nov 2018 11:03:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543230187; bh=bmRdhKk1QDyz67zDspBTbyiyAoF6XhprrJrgHJq4NMI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hD9nvuJckwPoGKA8QP9gqfJGwtK9Akk17W8e1X6OksgFetHSfr7TYw1m26SL6HCuf J/7L42xjiw/Zd6kidX3IYa4qe6wI4UMydt1ZEGCfcWzBVkLvbnuBFCVyi1n0mT0Ysv qWmFxtUIYqCq6rfQ1Qbtj+rgU1zZCrbC8v6ilLpg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Huazhong Tan , "David S. Miller" , Sasha Levin Subject: [PATCH 4.19 007/118] net: hns3: bugfix for rtnl_locks range in the hclgevf_reset() Date: Mon, 26 Nov 2018 11:50:01 +0100 Message-Id: <20181126105100.132235886@linuxfoundation.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: <20181126105059.832485122@linuxfoundation.org> References: <20181126105059.832485122@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. ------------------ [ Upstream commit 29118ab962d5476fdc65fae312ac38db68092d78 ] Since hclgevf_reset_wait() is used to wait for the hardware to complete the reset, it is not necessary to hold the rtnl_lock during hclgevf_reset_wait(). So this patch releases the lock for the duration of hclgevf_reset_wait(). Fixes: 6988eb2a9b77 ("net: hns3: Add support to reset the enet/ring mgmt layer") Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 320043e87fc6..5570fb5dc2eb 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1065,6 +1065,8 @@ static int hclgevf_reset(struct hclgevf_dev *hdev) /* bring down the nic to stop any ongoing TX/RX */ hclgevf_notify_client(hdev, HNAE3_DOWN_CLIENT); + rtnl_unlock(); + /* check if VF could successfully fetch the hardware reset completion * status from the hardware */ @@ -1076,12 +1078,15 @@ static int hclgevf_reset(struct hclgevf_dev *hdev) ret); dev_warn(&hdev->pdev->dev, "VF reset failed, disabling VF!\n"); + rtnl_lock(); hclgevf_notify_client(hdev, HNAE3_UNINIT_CLIENT); rtnl_unlock(); return ret; } + rtnl_lock(); + /* now, re-initialize the nic client and ae device*/ ret = hclgevf_reset_stack(hdev); if (ret) -- 2.17.1