@@ -4702,6 +4702,8 @@ static void nvme_fw_act_work(struct work_struct *work)
4702
4702
nvme_start_queues (ctrl );
4703
4703
/* read FW slot information to clear the AER */
4704
4704
nvme_get_fw_slot_info (ctrl );
4705
+
4706
+ queue_work (nvme_wq , & ctrl -> async_event_work );
4705
4707
}
4706
4708
4707
4709
static u32 nvme_aer_type (u32 result )
@@ -4714,9 +4716,10 @@ static u32 nvme_aer_subtype(u32 result)
4714
4716
return (result & 0xff00 ) >> 8 ;
4715
4717
}
4716
4718
4717
- static void nvme_handle_aen_notice (struct nvme_ctrl * ctrl , u32 result )
4719
+ static bool nvme_handle_aen_notice (struct nvme_ctrl * ctrl , u32 result )
4718
4720
{
4719
4721
u32 aer_notice_type = nvme_aer_subtype (result );
4722
+ bool requeue = true;
4720
4723
4721
4724
trace_nvme_async_event (ctrl , aer_notice_type );
4722
4725
@@ -4733,6 +4736,7 @@ static void nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
4733
4736
*/
4734
4737
if (nvme_change_ctrl_state (ctrl , NVME_CTRL_RESETTING )) {
4735
4738
nvme_auth_stop (ctrl );
4739
+ requeue = false;
4736
4740
queue_work (nvme_wq , & ctrl -> fw_act_work );
4737
4741
}
4738
4742
break ;
@@ -4749,6 +4753,7 @@ static void nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
4749
4753
default :
4750
4754
dev_warn (ctrl -> device , "async event result %08x\n" , result );
4751
4755
}
4756
+ return requeue ;
4752
4757
}
4753
4758
4754
4759
static void nvme_handle_aer_persistent_error (struct nvme_ctrl * ctrl )
@@ -4764,13 +4769,14 @@ void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
4764
4769
u32 result = le32_to_cpu (res -> u32 );
4765
4770
u32 aer_type = nvme_aer_type (result );
4766
4771
u32 aer_subtype = nvme_aer_subtype (result );
4772
+ bool requeue = true;
4767
4773
4768
4774
if (le16_to_cpu (status ) >> 1 != NVME_SC_SUCCESS )
4769
4775
return ;
4770
4776
4771
4777
switch (aer_type ) {
4772
4778
case NVME_AER_NOTICE :
4773
- nvme_handle_aen_notice (ctrl , result );
4779
+ requeue = nvme_handle_aen_notice (ctrl , result );
4774
4780
break ;
4775
4781
case NVME_AER_ERROR :
4776
4782
/*
@@ -4791,7 +4797,9 @@ void nvme_complete_async_event(struct nvme_ctrl *ctrl, __le16 status,
4791
4797
default :
4792
4798
break ;
4793
4799
}
4794
- queue_work (nvme_wq , & ctrl -> async_event_work );
4800
+
4801
+ if (requeue )
4802
+ queue_work (nvme_wq , & ctrl -> async_event_work );
4795
4803
}
4796
4804
EXPORT_SYMBOL_GPL (nvme_complete_async_event );
4797
4805
0 commit comments