Thread (26 messages) 26 messages, 1 author, 2021-12-20
STALE1649d LANDED

[PATCH 07/25] mpi3mr: Do access status validation before adding devices

From: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Date: 2021-12-20 14:04:21
Subsystem: broadcom mpi3 storage controller driver, scsi subsystem, the rest · Maintainers: Sathya Prakash Veerichetty, Kashyap Desai, Sumit Saxena, Sreekanth Reddy, "James E.J. Bottomley", "Martin K. Petersen", Linus Torvalds

Added validation for various access statuses
prior to exposing attached target device to
the operating system.

Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
---
 drivers/scsi/mpi3mr/mpi3mr_os.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 14621dc..2fe7fcb 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:
 	{
-- 
2.27.0

Attachments

  • smime.p7s [application/pkcs7-signature] 4218 bytes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help