All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huazhong Tan <tanhuazhong@huawei.com>
To: <davem@davemloft.net>, <sergei.shtylyov@cogentembedded.com>
Cc: <netdev@vger.kernel.org>, <linuxarm@huawei.com>,
	<salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
	<lipeng321@huawei.com>, <linyunsheng@huawei.com>
Subject: [Patch V3 net 11/11] net: hns3: bugfix for rtnl_lock's range in the hclgevf_reset()
Date: Sun, 28 Oct 2018 11:34:11 +0800	[thread overview]
Message-ID: <1540697651-22993-12-git-send-email-tanhuazhong@huawei.com> (raw)
In-Reply-To: <1540697651-22993-1-git-send-email-tanhuazhong@huawei.com>

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 <tanhuazhong@huawei.com>
---
 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 b224f6a..085edb9 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
@@ -1170,6 +1170,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
 	 */
@@ -1181,12 +1183,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.7.4

      parent reply	other threads:[~2018-10-28 12:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-28  3:34 [Patch V3 net 00/11] Bugfix for the HNS3 driver Huazhong Tan
2018-10-28  3:34 ` [Patch V3 net 01/11] net: hns3: add error handler for hns3_nic_init_vector_data() Huazhong Tan
2018-10-28  3:34 ` [Patch V3 net 02/11] net: hns3: add error handler for hns3_get_ring_config/hns3_queue_to_ring Huazhong Tan
2018-10-28  3:34 ` [Patch V3 net 03/11] net: hns3: bugfix for reporting unknown vector0 interrupt repeatly problem Huazhong Tan
2018-10-28  3:34 ` [Patch V3 net 04/11] net: hns3: bugfix for the initialization of command queue's spin lock Huazhong Tan
2018-10-28  3:34 ` [Patch V3 net 05/11] net: hns3: remove unnecessary queue reset in the hns3_uninit_all_ring() Huazhong Tan
2018-10-28  8:09   ` Sergei Shtylyov
2018-10-29  0:54     ` tanhuazhong
2018-10-28  3:34 ` [Patch V3 net 06/11] net: hns3: bugfix for is_valid_csq_clean_head() Huazhong Tan
2018-10-28  3:34 ` [Patch V3 net 07/11] net: hns3: bugfix for hclge_mdio_write and hclge_mdio_read Huazhong Tan
2018-10-28  3:34 ` [Patch V3 net 08/11] net: hns3: fix incorrect return value/type of some functions Huazhong Tan
2018-10-28  3:34 ` [Patch V3 net 09/11] net: hns3: bugfix for handling mailbox while the command queue reinitialized Huazhong Tan
2018-10-28  3:34 ` [Patch V3 net 10/11] net: hns3: bugfix for rtnl_lock's range in the hclge_reset() Huazhong Tan
2018-10-28  3:34 ` Huazhong Tan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1540697651-22993-12-git-send-email-tanhuazhong@huawei.com \
    --to=tanhuazhong@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linuxarm@huawei.com \
    --cc=linyunsheng@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=sergei.shtylyov@cogentembedded.com \
    --cc=yisen.zhuang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.