Skip to content

Commit c01d515

Browse files
cp890582martinkpetersen
authored andcommitted
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>
1 parent e5aab84 commit c01d515

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

drivers/scsi/mpi3mr/mpi3mr_os.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,8 +1047,9 @@ void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc)
10471047
list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list,
10481048
list) {
10491049
if ((tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) &&
1050-
tgtdev->host_exposed && tgtdev->starget &&
1051-
tgtdev->starget->hostdata) {
1050+
tgtdev->is_hidden &&
1051+
tgtdev->host_exposed && tgtdev->starget &&
1052+
tgtdev->starget->hostdata) {
10521053
tgt_priv = tgtdev->starget->hostdata;
10531054
tgt_priv->dev_removed = 1;
10541055
atomic_set(&tgt_priv->block_io, 0);
@@ -1064,6 +1065,10 @@ void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc)
10641065
mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev);
10651066
mpi3mr_tgtdev_del_from_list(mrioc, tgtdev, true);
10661067
mpi3mr_tgtdev_put(tgtdev);
1068+
} else if (tgtdev->is_hidden & tgtdev->host_exposed) {
1069+
dprint_reset(mrioc, "hiding target device with perst_id(%d)\n",
1070+
tgtdev->perst_id);
1071+
mpi3mr_remove_tgtdev_from_host(mrioc, tgtdev);
10671072
}
10681073
}
10691074

0 commit comments

Comments
 (0)