diff options
author | Chandrakanth patil <chandrakanth.patil@broadcom.com> | 2023-11-26 11:01:33 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-25 15:45:14 -0800 |
commit | 997348517edb0c3b431a06293d88f2bc50434c24 (patch) | |
tree | 327c733a90efcd460b348f9ee7f73660bb2583a7 /drivers/scsi | |
parent | 28804a6ec6f0863ddea9fb0b471982763d1161c1 (diff) | |
download | linux-stable-997348517edb0c3b431a06293d88f2bc50434c24.tar.gz linux-stable-997348517edb0c3b431a06293d88f2bc50434c24.tar.bz2 linux-stable-997348517edb0c3b431a06293d88f2bc50434c24.zip |
scsi: mpi3mr: Block PEL Enable Command on Controller Reset and Unrecoverable State
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@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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/mpi3mr/mpi3mr_app.c | 16 |
1 files changed, 16 insertions, 0 deletions
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)); |