Skip to content

Commit f8fb3f3

Browse files
cp890582martinkpetersen
authored andcommitted
scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State
If a controller reset is underway or the controller is in an unrecoverable state, the PEL enable management command will be returned as EAGAIN or EFAULT. Cc: <stable@vger.kernel.org> # v6.1+ Co-developed-by: Sathya Prakash <sathya.prakash@broadcom.com> Signed-off-by: Sathya Prakash <sathya.prakash@broadcom.com> Signed-off-by: Chandrakanth patil <chandrakanth.patil@broadcom.com> Link: https://lore.kernel.org/r/20231126053134.10133-4-chandrakanth.patil@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent c01d515 commit f8fb3f3

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

drivers/scsi/mpi3mr/mpi3mr_app.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,22 @@ static long mpi3mr_bsg_pel_enable(struct mpi3mr_ioc *mrioc,
223223
return rval;
224224
}
225225

226+
if (mrioc->unrecoverable) {
227+
dprint_bsg_err(mrioc, "%s: unrecoverable controller\n",
228+
__func__);
229+
return -EFAULT;
230+
}
231+
232+
if (mrioc->reset_in_progress) {
233+
dprint_bsg_err(mrioc, "%s: reset in progress\n", __func__);
234+
return -EAGAIN;
235+
}
236+
237+
if (mrioc->stop_bsgs) {
238+
dprint_bsg_err(mrioc, "%s: bsgs are blocked\n", __func__);
239+
return -EAGAIN;
240+
}
241+
226242
sg_copy_to_buffer(job->request_payload.sg_list,
227243
job->request_payload.sg_cnt,
228244
&pel_enable, sizeof(pel_enable));

0 commit comments

Comments
 (0)