summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorChandrakanth patil <chandrakanth.patil@broadcom.com>2023-11-26 11:01:32 +0530
committerMartin K. Petersen <martin.petersen@oracle.com>2023-12-05 21:38:48 -0500
commitc01d515687e358b22aa8414d6dac60d7defa6eb9 (patch)
tree0dc0842e77f737f233d6b7f6f02a6bfabe9ed639 /drivers/scsi
parente5aab848dfdf7996d20ece4d28d2733c732c5e5a (diff)
downloadlinux-stable-c01d515687e358b22aa8414d6dac60d7defa6eb9.tar.gz
linux-stable-c01d515687e358b22aa8414d6dac60d7defa6eb9.tar.bz2
linux-stable-c01d515687e358b22aa8414d6dac60d7defa6eb9.zip
scsi: mpi3mr: Clean up block devices post controller reset
After a controller reset, if the firmware changes the state of devices to "hide", then remove those devices from the OS. Cc: <stable@vger.kernel.org> # v6.6+ 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-3-chandrakanth.patil@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/mpi3mr/mpi3mr_os.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
index 561fe0857bc0..872d4b809d08 100644
--- a/drivers/scsi/mpi3mr/mpi3mr_os.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
@@ -1047,8 +1047,9 @@ void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc)
list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list,
list) {
if ((tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) &&
- tgtdev->host_exposed && tgtdev->starget &&
- tgtdev->starget->hostdata) {
+ tgtdev->is_hidden &&
+ tgtdev->host_exposed && tgtdev->starget &&
+ tgtdev->starget->hostdata) {
tgt_priv = tgtdev->starget->hostdata;
tgt_priv->dev_removed = 1;
atomic_set(&tgt_priv->block_io, 0);
@@ -1064,6 +1065,10 @@ void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc)
mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev);
mpi3mr_tgtdev_del_from_list(mrioc, tgtdev, true);
mpi3mr_tgtdev_put(tgtdev);
+ } else if (tgtdev->is_hidden & tgtdev->host_exposed) {
+ dprint_reset(mrioc, "hiding target device with perst_id(%d)\n",
+ tgtdev->perst_id);
+ mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev);
}
}