Skip to content

Commit d9a5ab0

Browse files
Ranjan Kumarmartinkpetersen
authored andcommitted
scsi: mpi3mr: Enhance handling of devices removed after controller reset
Mark all of the devices that are exposed to the OS prior to a controller reset and not detected by the controller after the reset as removed devices and the I/Os to those devices are unblocked (and returned with DID_NO_CONNECT) prior to removing the devices one after the other. Signed-off-by: Ranjan Kumar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent e7a8648 commit d9a5ab0

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/scsi/mpi3mr/mpi3mr_os.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,19 @@ mpi3mr_update_sdev(struct scsi_device *sdev, void *data)
10411041
void mpi3mr_rfresh_tgtdevs(struct mpi3mr_ioc *mrioc)
10421042
{
10431043
struct mpi3mr_tgt_dev *tgtdev, *tgtdev_next;
1044+
struct mpi3mr_stgt_priv_data *tgt_priv;
1045+
1046+
dprint_reset(mrioc, "refresh target devices: check for removals\n");
1047+
list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list,
1048+
list) {
1049+
if ((tgtdev->dev_handle == MPI3MR_INVALID_DEV_HANDLE) &&
1050+
tgtdev->host_exposed && tgtdev->starget &&
1051+
tgtdev->starget->hostdata) {
1052+
tgt_priv = tgtdev->starget->hostdata;
1053+
tgt_priv->dev_removed = 1;
1054+
atomic_set(&tgt_priv->block_io, 0);
1055+
}
1056+
}
10441057

10451058
list_for_each_entry_safe(tgtdev, tgtdev_next, &mrioc->tgtdev_list,
10461059
list) {

0 commit comments

Comments
 (0)