diff options
author | Sreekanth Reddy <sreekanth.reddy@broadcom.com> | 2021-12-20 19:41:41 +0530 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-12-23 00:04:22 -0500 |
commit | ba68779a518d9ebe734c1fca9f5e199826723b5b (patch) | |
tree | 43e448a4c2fd7edd1d06467d8ac445bc07f82ecb /drivers/scsi/mpi3mr | |
parent | 17d6b9cf89cfdb5a52298bb4abe7f1621f92ba93 (diff) | |
download | lwn-ba68779a518d9ebe734c1fca9f5e199826723b5b.tar.gz lwn-ba68779a518d9ebe734c1fca9f5e199826723b5b.zip |
scsi: mpi3mr: Do access status validation before adding devices
Add validation for various access statuses prior to exposing attached
target device to the operating system.
Link: https://lore.kernel.org/r/20211220141159.16117-8-sreekanth.reddy@broadcom.com
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/mpi3mr')
-rw-r--r-- | drivers/scsi/mpi3mr/mpi3mr_os.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c index 14621dc604ce..2fe7fcbe21d1 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_os.c +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c @@ -831,6 +831,17 @@ static void mpi3mr_update_tgtdev(struct mpi3mr_ioc *mrioc, scsi_tgt_priv_data->dev_type = tgtdev->dev_type; } + switch (dev_pg0->access_status) { + case MPI3_DEVICE0_ASTATUS_NO_ERRORS: + case MPI3_DEVICE0_ASTATUS_PREPARE: + case MPI3_DEVICE0_ASTATUS_NEEDS_INITIALIZATION: + case MPI3_DEVICE0_ASTATUS_DEVICE_MISSING_DELAY: + break; + default: + tgtdev->is_hidden = 1; + break; + } + switch (tgtdev->dev_type) { case MPI3_DEVICE_DEVFORM_SAS_SATA: { |