From 49053b1c8fb25bc913a1fce54c837028363f1414 Mon Sep 17 00:00:00 2001 From: Huazhong Tan Date: Thu, 20 Jun 2019 16:52:44 +0800 Subject: [PATCH] net: hns3: fixes wrong place enabling ROCE HW error when loading The ROCE HW errors should only be enabled when initializing ROCE's client, the current code enable it no matter initializing NIC or ROCE client. So this patch fixes it. Fixes: c37c96a62413 ("net: hns3: delay and separate enabling of NIC and ROCE HW errors") Signed-off-by: Huazhong Tan Signed-off-by: David S. Miller --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 53dbef9ba7718..b0a99c30a3843 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -8349,6 +8349,14 @@ static int hclge_init_roce_client_instance(struct hnae3_ae_dev *ae_dev, goto init_roce_err; } + /* Enable roce ras interrupts */ + ret = hclge_config_rocee_ras_interrupt(hdev, true); + if (ret) { + dev_err(&ae_dev->pdev->dev, + "fail(%d) to enable roce ras interrupts\n", ret); + goto init_roce_err; + } + hnae3_set_client_init_flag(client, ae_dev, 1); return 0; @@ -8403,12 +8411,6 @@ static int hclge_init_client_instance(struct hnae3_client *client, } } - /* Enable roce ras interrupts */ - ret = hclge_config_rocee_ras_interrupt(hdev, true); - if (ret) - dev_err(&ae_dev->pdev->dev, - "fail(%d) to enable roce ras interrupts\n", ret); - return ret; clear_nic: -- 2.39.5