This is a note to let you know that I've just added the patch titled scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: scsi-mpi3mr-block-pel-enable-command-on-controller-reset-and-unrecoverable-state.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From f8fb3f39148e8010479e4b2003ba4728818ec661 Mon Sep 17 00:00:00 2001 From: Chandrakanth patil <chandrakanth.patil@xxxxxxxxxxxx> Date: Sun, 26 Nov 2023 11:01:33 +0530 Subject: scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State From: Chandrakanth patil <chandrakanth.patil@xxxxxxxxxxxx> commit f8fb3f39148e8010479e4b2003ba4728818ec661 upstream. 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@xxxxxxxxxxxxxxx> # v6.1+ Co-developed-by: Sathya Prakash <sathya.prakash@xxxxxxxxxxxx> Signed-off-by: Sathya Prakash <sathya.prakash@xxxxxxxxxxxx> Signed-off-by: Chandrakanth patil <chandrakanth.patil@xxxxxxxxxxxx> Link: https://lore.kernel.org/r/20231126053134.10133-4-chandrakanth.patil@xxxxxxxxxxxx Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/scsi/mpi3mr/mpi3mr_app.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c index 08645a99ad6b..9dacbb8570c9 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_app.c +++ b/drivers/scsi/mpi3mr/mpi3mr_app.c @@ -223,6 +223,22 @@ static long mpi3mr_bsg_pel_enable(struct mpi3mr_ioc *mrioc, return rval; } + if (mrioc->unrecoverable) { + dprint_bsg_err(mrioc, "%s: unrecoverable controller\n", + __func__); + return -EFAULT; + } + + if (mrioc->reset_in_progress) { + dprint_bsg_err(mrioc, "%s: reset in progress\n", __func__); + return -EAGAIN; + } + + if (mrioc->stop_bsgs) { + dprint_bsg_err(mrioc, "%s: bsgs are blocked\n", __func__); + return -EAGAIN; + } + sg_copy_to_buffer(job->request_payload.sg_list, job->request_payload.sg_cnt, &pel_enable, sizeof(pel_enable)); -- 2.43.0 Patches currently in stable-queue which might be from chandrakanth.patil@xxxxxxxxxxxx are queue-6.1/scsi-mpi3mr-block-pel-enable-command-on-controller-reset-and-unrecoverable-state.patch queue-6.1/scsi-mpi3mr-refresh-sdev-queue-depth-after-controller-reset.patch