@@ -312,6 +312,12 @@ mpi3mr_get_drv_cmd(struct mpi3mr_ioc *mrioc, u16 host_tag,
312312 return & mrioc -> dev_rmhs_cmds [idx ];
313313 }
314314
315+ if (host_tag >= MPI3MR_HOSTTAG_EVTACKCMD_MIN &&
316+ host_tag <= MPI3MR_HOSTTAG_EVTACKCMD_MAX ) {
317+ idx = host_tag - MPI3MR_HOSTTAG_EVTACKCMD_MIN ;
318+ return & mrioc -> evtack_cmds [idx ];
319+ }
320+
315321 return NULL ;
316322}
317323
@@ -2691,6 +2697,13 @@ static int mpi3mr_alloc_reply_sense_bufs(struct mpi3mr_ioc *mrioc)
26912697 goto out_failed ;
26922698 }
26932699
2700+ for (i = 0 ; i < MPI3MR_NUM_EVTACKCMD ; i ++ ) {
2701+ mrioc -> evtack_cmds [i ].reply = kzalloc (mrioc -> reply_sz ,
2702+ GFP_KERNEL );
2703+ if (!mrioc -> evtack_cmds [i ].reply )
2704+ goto out_failed ;
2705+ }
2706+
26942707 mrioc -> host_tm_cmds .reply = kzalloc (mrioc -> reply_sz , GFP_KERNEL );
26952708 if (!mrioc -> host_tm_cmds .reply )
26962709 goto out_failed ;
@@ -2711,6 +2724,14 @@ static int mpi3mr_alloc_reply_sense_bufs(struct mpi3mr_ioc *mrioc)
27112724 if (!mrioc -> devrem_bitmap )
27122725 goto out_failed ;
27132726
2727+ mrioc -> evtack_cmds_bitmap_sz = MPI3MR_NUM_EVTACKCMD / 8 ;
2728+ if (MPI3MR_NUM_EVTACKCMD % 8 )
2729+ mrioc -> evtack_cmds_bitmap_sz ++ ;
2730+ mrioc -> evtack_cmds_bitmap = kzalloc (mrioc -> evtack_cmds_bitmap_sz ,
2731+ GFP_KERNEL );
2732+ if (!mrioc -> evtack_cmds_bitmap )
2733+ goto out_failed ;
2734+
27142735 mrioc -> num_reply_bufs = mrioc -> facts .max_reqs + MPI3MR_NUM_EVT_REPLIES ;
27152736 mrioc -> reply_free_qsz = mrioc -> num_reply_bufs + 1 ;
27162737 mrioc -> num_sense_bufs = mrioc -> facts .max_reqs / MPI3MR_SENSEBUF_FACTOR ;
@@ -3030,17 +3051,17 @@ static int mpi3mr_issue_event_notification(struct mpi3mr_ioc *mrioc)
30303051}
30313052
30323053/**
3033- * mpi3mr_send_event_ack - Send event acknowledgment
3054+ * mpi3mr_process_event_ack - Process event acknowledgment
30343055 * @mrioc: Adapter instance reference
30353056 * @event: MPI3 event ID
3036- * @event_ctx: Event context
3057+ * @event_ctx: event context
30373058 *
30383059 * Send event acknowledgment through admin queue and wait for
30393060 * it to complete.
30403061 *
30413062 * Return: 0 on success, non-zero on failures.
30423063 */
3043- int mpi3mr_send_event_ack (struct mpi3mr_ioc * mrioc , u8 event ,
3064+ int mpi3mr_process_event_ack (struct mpi3mr_ioc * mrioc , u8 event ,
30443065 u32 event_ctx )
30453066{
30463067 struct mpi3_event_ack_request evtack_req ;
@@ -3803,8 +3824,13 @@ void mpi3mr_memset_buffers(struct mpi3mr_ioc *mrioc)
38033824 for (i = 0 ; i < MPI3MR_NUM_DEVRMCMD ; i ++ )
38043825 memset (mrioc -> dev_rmhs_cmds [i ].reply , 0 ,
38053826 sizeof (* mrioc -> dev_rmhs_cmds [i ].reply ));
3827+ for (i = 0 ; i < MPI3MR_NUM_EVTACKCMD ; i ++ )
3828+ memset (mrioc -> evtack_cmds [i ].reply , 0 ,
3829+ sizeof (* mrioc -> evtack_cmds [i ].reply ));
38063830 memset (mrioc -> removepend_bitmap , 0 , mrioc -> dev_handle_bitmap_sz );
38073831 memset (mrioc -> devrem_bitmap , 0 , mrioc -> devrem_bitmap_sz );
3832+ memset (mrioc -> evtack_cmds_bitmap , 0 ,
3833+ mrioc -> evtack_cmds_bitmap_sz );
38083834 }
38093835
38103836 for (i = 0 ; i < mrioc -> num_queues ; i ++ ) {
@@ -3898,12 +3924,20 @@ void mpi3mr_free_mem(struct mpi3mr_ioc *mrioc)
38983924 kfree (mrioc -> host_tm_cmds .reply );
38993925 mrioc -> host_tm_cmds .reply = NULL ;
39003926
3927+ for (i = 0 ; i < MPI3MR_NUM_EVTACKCMD ; i ++ ) {
3928+ kfree (mrioc -> evtack_cmds [i ].reply );
3929+ mrioc -> evtack_cmds [i ].reply = NULL ;
3930+ }
3931+
39013932 kfree (mrioc -> removepend_bitmap );
39023933 mrioc -> removepend_bitmap = NULL ;
39033934
39043935 kfree (mrioc -> devrem_bitmap );
39053936 mrioc -> devrem_bitmap = NULL ;
39063937
3938+ kfree (mrioc -> evtack_cmds_bitmap );
3939+ mrioc -> evtack_cmds_bitmap = NULL ;
3940+
39073941 kfree (mrioc -> chain_bitmap );
39083942 mrioc -> chain_bitmap = NULL ;
39093943
@@ -4079,6 +4113,11 @@ static void mpi3mr_flush_drv_cmds(struct mpi3mr_ioc *mrioc)
40794113 cmdptr = & mrioc -> dev_rmhs_cmds [i ];
40804114 mpi3mr_drv_cmd_comp_reset (mrioc , cmdptr );
40814115 }
4116+
4117+ for (i = 0 ; i < MPI3MR_NUM_EVTACKCMD ; i ++ ) {
4118+ cmdptr = & mrioc -> evtack_cmds [i ];
4119+ mpi3mr_drv_cmd_comp_reset (mrioc , cmdptr );
4120+ }
40824121}
40834122
40844123/**
@@ -4176,10 +4215,11 @@ int mpi3mr_soft_reset_handler(struct mpi3mr_ioc *mrioc,
41764215 goto out ;
41774216 }
41784217
4179- mpi3mr_flush_delayed_rmhs_list (mrioc );
4218+ mpi3mr_flush_delayed_cmd_lists (mrioc );
41804219 mpi3mr_flush_drv_cmds (mrioc );
41814220 memset (mrioc -> devrem_bitmap , 0 , mrioc -> devrem_bitmap_sz );
41824221 memset (mrioc -> removepend_bitmap , 0 , mrioc -> dev_handle_bitmap_sz );
4222+ memset (mrioc -> evtack_cmds_bitmap , 0 , mrioc -> evtack_cmds_bitmap_sz );
41834223 mpi3mr_cleanup_fwevt_list (mrioc );
41844224 mpi3mr_flush_host_io (mrioc );
41854225 mpi3mr_invalidate_devhandles (mrioc );
0 commit comments