File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
drivers/net/ethernet/hisilicon/hns3/hns3pf Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,28 @@ static const struct hclge_hw_blk hw_blk[] = {
7
7
{ /* sentinel */ }
8
8
};
9
9
10
+ int hclge_hw_error_set_state (struct hclge_dev * hdev , bool state )
11
+ {
12
+ struct device * dev = & hdev -> pdev -> dev ;
13
+ int ret = 0 ;
14
+ int i = 0 ;
15
+
16
+ while (hw_blk [i ].name ) {
17
+ if (!hw_blk [i ].enable_error ) {
18
+ i ++ ;
19
+ continue ;
20
+ }
21
+ ret = hw_blk [i ].enable_error (hdev , state );
22
+ if (ret ) {
23
+ dev_err (dev , "fail(%d) to en/disable err int\n" , ret );
24
+ return ret ;
25
+ }
26
+ i ++ ;
27
+ }
28
+
29
+ return ret ;
30
+ }
31
+
10
32
pci_ers_result_t hclge_process_ras_hw_error (struct hnae3_ae_dev * ae_dev )
11
33
{
12
34
struct hclge_dev * hdev = ae_dev -> priv ;
Original file line number Diff line number Diff line change @@ -21,9 +21,11 @@ enum hclge_err_int_type {
21
21
struct hclge_hw_blk {
22
22
u32 msk ;
23
23
const char * name ;
24
+ int (* enable_error )(struct hclge_dev * hdev , bool en );
24
25
void (* process_error )(struct hclge_dev * hdev ,
25
26
enum hclge_err_int_type type );
26
27
};
27
28
29
+ int hclge_hw_error_set_state (struct hclge_dev * hdev , bool state );
28
30
pci_ers_result_t hclge_process_ras_hw_error (struct hnae3_ae_dev * ae_dev );
29
31
#endif
Original file line number Diff line number Diff line change @@ -6759,6 +6759,13 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
6759
6759
goto err_mdiobus_unreg ;
6760
6760
}
6761
6761
6762
+ ret = hclge_hw_error_set_state (hdev , true);
6763
+ if (ret ) {
6764
+ dev_err (& pdev -> dev ,
6765
+ "hw error interrupts enable failed, ret =%d\n" , ret );
6766
+ goto err_mdiobus_unreg ;
6767
+ }
6768
+
6762
6769
hclge_dcb_ops_set (hdev );
6763
6770
6764
6771
timer_setup (& hdev -> service_timer , hclge_service_timer , 0 );
@@ -6896,6 +6903,7 @@ static void hclge_uninit_ae_dev(struct hnae3_ae_dev *ae_dev)
6896
6903
hclge_enable_vector (& hdev -> misc_vector , false);
6897
6904
synchronize_irq (hdev -> misc_vector .vector_irq );
6898
6905
6906
+ hclge_hw_error_set_state (hdev , false);
6899
6907
hclge_destroy_cmd_queue (& hdev -> hw );
6900
6908
hclge_misc_irq_uninit (hdev );
6901
6909
hclge_pci_uninit (hdev );
You can’t perform that action at this time.
0 commit comments