All of lore.kernel.org
 help / color / mirror / Atom feed
From: Himanshu Madhani <himanshu.madhani@oracle.com>
To: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
	Martin Petersen <martin.petersen@oracle.com>
Subject: Re: [PATCH 15/15] mpi3mr: Block IOs while refreshing target dev objects
Date: Tue, 2 Aug 2022 21:12:29 +0000	[thread overview]
Message-ID: <615133A3-CFE0-4134-AAC4-4ECEC5682384@oracle.com> (raw)
In-Reply-To: <20220729131627.15019-16-sreekanth.reddy@broadcom.com>



> On Jul 29, 2022, at 6:16 AM, Sreekanth Reddy <sreekanth.reddy@broadcom.com> wrote:
> 
> Block the IOs on the target devices until corresponding
> target device's target dev objects are refreshed as part
> of post controller reset operation.
> 
> Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
> ---
> drivers/scsi/mpi3mr/mpi3mr_os.c | 25 +++++++++++++++----------
> 1 file changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/scsi/mpi3mr/mpi3mr_os.c b/drivers/scsi/mpi3mr/mpi3mr_os.c
> index d4f37b1..c7d9e46 100644
> --- a/drivers/scsi/mpi3mr/mpi3mr_os.c
> +++ b/drivers/scsi/mpi3mr/mpi3mr_os.c
> @@ -424,6 +424,8 @@ void mpi3mr_invalidate_devhandles(struct mpi3mr_ioc *mrioc)
> 			tgt_priv->io_throttle_enabled = 0;
> 			tgt_priv->io_divert = 0;
> 			tgt_priv->throttle_group = NULL;
> +			if (tgtdev->host_exposed)
> +				atomic_set(&tgt_priv->block_io, 1);
> 		}
> 	}
> }
> @@ -835,6 +837,7 @@ void mpi3mr_remove_tgtdev_from_host(struct mpi3mr_ioc *mrioc,
> 	    __func__, tgtdev->dev_handle, (unsigned long long)tgtdev->wwid);
> 	if (tgtdev->starget && tgtdev->starget->hostdata) {
> 		tgt_priv = tgtdev->starget->hostdata;
> +		atomic_set(&tgt_priv->block_io, 0);
> 		tgt_priv->dev_handle = MPI3MR_INVALID_DEV_HANDLE;
> 	}
> 
> @@ -1077,6 +1080,8 @@ static void mpi3mr_update_tgtdev(struct mpi3mr_ioc *mrioc,
> 		scsi_tgt_priv_data->dev_type = tgtdev->dev_type;
> 		scsi_tgt_priv_data->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) {
> @@ -4576,6 +4581,16 @@ static int mpi3mr_qcmd(struct Scsi_Host *shost,
> 
> 	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;
> 	if (dev_handle == MPI3MR_INVALID_DEV_HANDLE) {
> 		scmd->result = DID_NO_CONNECT << 16;
> @@ -4588,16 +4603,6 @@ static int mpi3mr_qcmd(struct Scsi_Host *shost,
> 		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)
> 		is_pcie_dev = 1;
> 	if ((scmd->cmnd[0] == UNMAP) && is_pcie_dev &&
> -- 
> 2.27.0
> 

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	Oracle Linux Engineering


      reply	other threads:[~2022-08-02 21:12 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29 13:16 [PATCH 00/15] mpi3mr: Added Support for SAS Transport Sreekanth Reddy
2022-07-29 13:16 ` [PATCH 01/15] mpi3mr: Add config and transport related debug flags Sreekanth Reddy
2022-07-29 16:59   ` Himanshu Madhani
2022-07-29 13:16 ` [PATCH 02/15] mpi3mr: Add framework to issue cnfg requests Sreekanth Reddy
2022-07-29 17:00   ` Himanshu Madhani
2022-08-01  7:40     ` Sreekanth Reddy
2022-08-01 16:37       ` Himanshu Madhani
2022-07-29 13:16 ` [PATCH 03/15] mpi3mr: Added helper functions to retrieve cnfg pages Sreekanth Reddy
2022-07-29 18:13   ` Himanshu Madhani
2022-07-29 13:16 ` [PATCH 04/15] mpi3mr: Enable Enclosure device add event Sreekanth Reddy
2022-07-29 18:33   ` Himanshu Madhani
2022-07-29 13:16 ` [PATCH 05/15] mpi3mr: Add framework to add phys to STL Sreekanth Reddy
2022-07-29 19:42   ` Himanshu Madhani
2022-08-01  7:46     ` Sreekanth Reddy
2022-07-29 13:16 ` [PATCH 06/15] mpi3mr: Add helper functions to retrieve device objects Sreekanth Reddy
2022-07-29 20:11   ` Himanshu Madhani
2022-08-01  7:48     ` Sreekanth Reddy
2022-07-29 13:16 ` [PATCH 07/15] mpi3mr: Add helper functions to manage device's port Sreekanth Reddy
2022-08-01 19:07   ` Himanshu Madhani
2022-07-29 13:16 ` [PATCH 08/15] mpi3mr: Enable STL on HBAs where multipath is disabled Sreekanth Reddy
2022-08-01 19:12   ` Himanshu Madhani
2022-07-29 13:16 ` [PATCH 09/15] mpi3mr: Add expander devices to STL Sreekanth Reddy
2022-08-01 20:50   ` Himanshu Madhani
2022-07-29 13:16 ` [PATCH 10/15] mpi3mr: Get target object based on rphy Sreekanth Reddy
2022-08-01 21:27   ` Himanshu Madhani
2022-07-29 13:16 ` [PATCH 11/15] mpi3mr: Add SAS SATA end devices to STL Sreekanth Reddy
2022-07-29 17:32   ` kernel test robot
2022-07-29 13:16 ` [PATCH 12/15] mpi3mr: Add framework to issue MPT transport cmds Sreekanth Reddy
2022-08-02  0:13   ` Himanshu Madhani
2022-07-29 13:16 ` [PATCH 13/15] mpi3mr: Support sas transport class callbacks Sreekanth Reddy
2022-08-02 18:11   ` Himanshu Madhani
2022-07-29 13:16 ` [PATCH 14/15] mpi3mr: Refresh sas ports during soft reset Sreekanth Reddy
2022-08-02 21:00   ` Himanshu Madhani
2022-07-29 13:16 ` [PATCH 15/15] mpi3mr: Block IOs while refreshing target dev objects Sreekanth Reddy
2022-08-02 21:12   ` Himanshu Madhani [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=615133A3-CFE0-4134-AAC4-4ECEC5682384@oracle.com \
    --to=himanshu.madhani@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sreekanth.reddy@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.