]> git.itanic.dy.fi Git - linux-stable/commitdiff
net: hns3: fix incorrect configuration for igu_egu_hw_err
authorYufeng Mo <moyufeng@huawei.com>
Thu, 29 Apr 2021 08:34:50 +0000 (16:34 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 May 2021 08:08:26 +0000 (10:08 +0200)
[ Upstream commit 2867298dd49ee84214b8721521dc7a5a6382520c ]

According to the UM, the type and enable status of igu_egu_hw_err
should be configured separately. Currently, the type field is
incorrect when disable this error. So fix it by configuring these
two fields separately.

Fixes: bf1faf9415dd ("net: hns3: Add enable and process hw errors from IGU, EGU and NCSI")
Signed-off-by: Yufeng Mo <moyufeng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_err.h

index 87dece0e745dd1417fae2701272a89ae0de42fdc..53fd6e4d9e2d66f2e34ca03a1370a843b09a5a02 100644 (file)
@@ -753,8 +753,9 @@ static int hclge_config_igu_egu_hw_err_int(struct hclge_dev *hdev, bool en)
 
        /* configure IGU,EGU error interrupts */
        hclge_cmd_setup_basic_desc(&desc, HCLGE_IGU_COMMON_INT_EN, false);
+       desc.data[0] = cpu_to_le32(HCLGE_IGU_ERR_INT_TYPE);
        if (en)
-               desc.data[0] = cpu_to_le32(HCLGE_IGU_ERR_INT_EN);
+               desc.data[0] |= cpu_to_le32(HCLGE_IGU_ERR_INT_EN);
 
        desc.data[1] = cpu_to_le32(HCLGE_IGU_ERR_INT_EN_MASK);
 
index 876fd81ad2f17cf25d945254a6c87972d7f83f33..8eccdb651a3ca262293e5072ab4081a7af2d7894 100644 (file)
@@ -33,7 +33,8 @@
 #define HCLGE_TQP_ECC_ERR_INT_EN_MASK  0x0FFF
 #define HCLGE_MSIX_SRAM_ECC_ERR_INT_EN_MASK    0x0F000000
 #define HCLGE_MSIX_SRAM_ECC_ERR_INT_EN 0x0F000000
-#define HCLGE_IGU_ERR_INT_EN   0x0000066F
+#define HCLGE_IGU_ERR_INT_EN   0x0000000F
+#define HCLGE_IGU_ERR_INT_TYPE 0x00000660
 #define HCLGE_IGU_ERR_INT_EN_MASK      0x000F
 #define HCLGE_IGU_TNL_ERR_INT_EN    0x0002AABF
 #define HCLGE_IGU_TNL_ERR_INT_EN_MASK  0x003F