forked from mirrors/linux
		
	scsi: mpi3mr: Block I/Os while refreshing target dev objects
Block the I/Os on the target devices until corresponding target device's target dev objects are refreshed as part of post controller reset operation. Link: https://lore.kernel.org/r/20220804131226.16653-16-sreekanth.reddy@broadcom.com Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
		
							parent
							
								
									2745ce0e6d
								
							
						
					
					
						commit
						7f90bc70d1
					
				
					 1 changed files with 15 additions and 10 deletions
				
			
		|  | @ -424,6 +424,8 @@ void mpi3mr_invalidate_devhandles(struct mpi3mr_ioc *mrioc) | ||||||
| 			tgt_priv->io_throttle_enabled = 0; | 			tgt_priv->io_throttle_enabled = 0; | ||||||
| 			tgt_priv->io_divert = 0; | 			tgt_priv->io_divert = 0; | ||||||
| 			tgt_priv->throttle_group = NULL; | 			tgt_priv->throttle_group = NULL; | ||||||
|  | 			if (tgtdev->host_exposed) | ||||||
|  | 				atomic_set(&tgt_priv->block_io, 1); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | @ -827,6 +829,7 @@ void mpi3mr_remove_tgtdev_from_host(struct mpi3mr_ioc *mrioc, | ||||||
| 	    __func__, tgtdev->dev_handle, (unsigned long long)tgtdev->wwid); | 	    __func__, tgtdev->dev_handle, (unsigned long long)tgtdev->wwid); | ||||||
| 	if (tgtdev->starget && tgtdev->starget->hostdata) { | 	if (tgtdev->starget && tgtdev->starget->hostdata) { | ||||||
| 		tgt_priv = tgtdev->starget->hostdata; | 		tgt_priv = tgtdev->starget->hostdata; | ||||||
|  | 		atomic_set(&tgt_priv->block_io, 0); | ||||||
| 		tgt_priv->dev_handle = MPI3MR_INVALID_DEV_HANDLE; | 		tgt_priv->dev_handle = MPI3MR_INVALID_DEV_HANDLE; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | @ -1069,6 +1072,8 @@ static void mpi3mr_update_tgtdev(struct mpi3mr_ioc *mrioc, | ||||||
| 		scsi_tgt_priv_data->dev_type = tgtdev->dev_type; | 		scsi_tgt_priv_data->dev_type = tgtdev->dev_type; | ||||||
| 		scsi_tgt_priv_data->io_throttle_enabled = | 		scsi_tgt_priv_data->io_throttle_enabled = | ||||||
| 		    tgtdev->io_throttle_enabled; | 		    tgtdev->io_throttle_enabled; | ||||||
|  | 		if (is_added == true) | ||||||
|  | 			atomic_set(&scsi_tgt_priv_data->block_io, 0); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	switch (dev_pg0->access_status) { | 	switch (dev_pg0->access_status) { | ||||||
|  | @ -4569,6 +4574,16 @@ static int mpi3mr_qcmd(struct Scsi_Host *shost, | ||||||
| 
 | 
 | ||||||
| 	stgt_priv_data = sdev_priv_data->tgt_priv_data; | 	stgt_priv_data = sdev_priv_data->tgt_priv_data; | ||||||
| 
 | 
 | ||||||
|  | 	if (atomic_read(&stgt_priv_data->block_io)) { | ||||||
|  | 		if (mrioc->stop_drv_processing) { | ||||||
|  | 			scmd->result = DID_NO_CONNECT << 16; | ||||||
|  | 			scsi_done(scmd); | ||||||
|  | 			goto out; | ||||||
|  | 		} | ||||||
|  | 		retval = SCSI_MLQUEUE_DEVICE_BUSY; | ||||||
|  | 		goto out; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	dev_handle = stgt_priv_data->dev_handle; | 	dev_handle = stgt_priv_data->dev_handle; | ||||||
| 	if (dev_handle == MPI3MR_INVALID_DEV_HANDLE) { | 	if (dev_handle == MPI3MR_INVALID_DEV_HANDLE) { | ||||||
| 		scmd->result = DID_NO_CONNECT << 16; | 		scmd->result = DID_NO_CONNECT << 16; | ||||||
|  | @ -4581,16 +4596,6 @@ static int mpi3mr_qcmd(struct Scsi_Host *shost, | ||||||
| 		goto out; | 		goto out; | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (atomic_read(&stgt_priv_data->block_io)) { |  | ||||||
| 		if (mrioc->stop_drv_processing) { |  | ||||||
| 			scmd->result = DID_NO_CONNECT << 16; |  | ||||||
| 			scsi_done(scmd); |  | ||||||
| 			goto out; |  | ||||||
| 		} |  | ||||||
| 		retval = SCSI_MLQUEUE_DEVICE_BUSY; |  | ||||||
| 		goto out; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	if (stgt_priv_data->dev_type == MPI3_DEVICE_DEVFORM_PCIE) | 	if (stgt_priv_data->dev_type == MPI3_DEVICE_DEVFORM_PCIE) | ||||||
| 		is_pcie_dev = 1; | 		is_pcie_dev = 1; | ||||||
| 	if ((scmd->cmnd[0] == UNMAP) && is_pcie_dev && | 	if ((scmd->cmnd[0] == UNMAP) && is_pcie_dev && | ||||||
|  |  | ||||||
		Loading…
	
		Reference in a new issue
	
	 Sreekanth Reddy
						Sreekanth Reddy