Skip to content

Commit aa39eb7

Browse files
zhangjiarangregkh
authored andcommitted
net: hns3: fix the timing issue of VF clearing interrupt sources
commit 427900d upstream. Currently, the VF does not clear the interrupt source immediately after receiving the interrupt. As a result, if the second interrupt task is triggered when processing the first interrupt task, clearing the interrupt source before exiting will clear the interrupt sources of the two tasks at the same time. As a result, no interrupt is triggered for the second task. The VF detects the missed message only when the next interrupt is generated. Clearing it immediately after executing check_evt_cause ensures that: 1. Even if two interrupt tasks are triggered at the same time, they can be processed. 2. If the second task is triggered during the processing of the first task and the interrupt source is not cleared, the interrupt is reported after vector0 is enabled. Fixes: b90fcc5 ("net: hns3: add reset handling for VF when doing Core/Global/IMP reset") Signed-off-by: Jiaran Zhang <zhangjiaran@huawei.com> Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ad47e09 commit aa39eb7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,6 +2352,8 @@ static irqreturn_t hclgevf_misc_irq_handle(int irq, void *data)
23522352

23532353
hclgevf_enable_vector(&hdev->misc_vector, false);
23542354
event_cause = hclgevf_check_evt_cause(hdev, &clearval);
2355+
if (event_cause != HCLGEVF_VECTOR0_EVENT_OTHER)
2356+
hclgevf_clear_event_cause(hdev, clearval);
23552357

23562358
switch (event_cause) {
23572359
case HCLGEVF_VECTOR0_EVENT_RST:
@@ -2364,10 +2366,8 @@ static irqreturn_t hclgevf_misc_irq_handle(int irq, void *data)
23642366
break;
23652367
}
23662368

2367-
if (event_cause != HCLGEVF_VECTOR0_EVENT_OTHER) {
2368-
hclgevf_clear_event_cause(hdev, clearval);
2369+
if (event_cause != HCLGEVF_VECTOR0_EVENT_OTHER)
23692370
hclgevf_enable_vector(&hdev->misc_vector, true);
2370-
}
23712371

23722372
return IRQ_HANDLED;
23732373
}

0 commit comments

Comments
 (0)