]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: hns3: Fix for VF mailbox cannot receiving PF response
authorXi Wang <wangxi11@huawei.com>
Wed, 6 Jun 2018 13:07:51 +0000 (14:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:47:36 +0000 (07:47 +0200)
[ Upstream commit 1819e40908ee76c7219287224c22c772556c927e ]

When the VF frequently switches the CMDQ interrupt, if the CMDQ_SRC is not
cleared, the VF will not receive the new PF response after the interrupt
is re-enabled, the corresponding log is as follows:

[  317.482222] hns3 0000:00:03.0: VF could not get mbx resp(=0) from PF
in 500 tries
[  317.483137] hns3 0000:00:03.0: VF request to get tqp info from PF
failed -5

This patch fixes this problem by clearing CMDQ_SRC before enabling
interrupt and syncing pending IRQ handlers after disabling interrupt.

Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support")
Signed-off-by: Xi Wang <wangxi11@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

index 2b8426412cc9ae504b24423601a539c8502f2573..0e4eb2770cbc5a23c78c9b891768ba4b39464ced 100644 (file)
@@ -1441,6 +1441,8 @@ static int hclgevf_misc_irq_init(struct hclgevf_dev *hdev)
                return ret;
        }
 
+       hclgevf_clear_event_cause(hdev, 0);
+
        /* enable misc. vector(vector 0) */
        hclgevf_enable_vector(&hdev->misc_vector, true);
 
@@ -1451,6 +1453,7 @@ static void hclgevf_misc_irq_uninit(struct hclgevf_dev *hdev)
 {
        /* disable misc vector(vector 0) */
        hclgevf_enable_vector(&hdev->misc_vector, false);
+       synchronize_irq(hdev->misc_vector.vector_irq);
        free_irq(hdev->misc_vector.vector_irq, hdev);
        hclgevf_free_vector(hdev, 0);
 }