linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: introduce a new ufshcd_statea UFSHCD_STATE_EH_SCHEDULED
@ 2016-11-16  3:29 Zang Leigang
  2016-11-16 18:48 ` Subhash Jadavani
  2016-11-17  1:29 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Zang Leigang @ 2016-11-16  3:29 UTC (permalink / raw)
  To: vinholikatti, jejb, martin.petersen, linux-scsi

Add a new ufshcd_state, indicats that an err handler may get to run
immediately. Use UFSHCD_STATE_ERROR here looks not literaly correct.

Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 05c7456..59d4130 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -123,6 +123,7 @@ enum {
 	UFSHCD_STATE_RESET,
 	UFSHCD_STATE_ERROR,
 	UFSHCD_STATE_OPERATIONAL,
+	UFSHCD_STATE_EH_SCHEDULED,
 };
 
 /* UFSHCD error handling flags */
@@ -1410,6 +1411,7 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
 	switch (hba->ufshcd_state) {
 	case UFSHCD_STATE_OPERATIONAL:
 		break;
+	case UFSHCD_STATE_EH_SCHEDULED:
 	case UFSHCD_STATE_RESET:
 		err = SCSI_MLQUEUE_HOST_BUSY;
 		goto out_unlock;
@@ -4158,7 +4160,7 @@ static void ufshcd_check_errors(struct ufs_hba *hba)
 			/* block commands from scsi mid-layer */
 			scsi_block_requests(hba->host);
 
-			hba->ufshcd_state = UFSHCD_STATE_ERROR;
+			hba->ufshcd_state = UFSHCD_STATE_EH_SCHEDULED;
 			schedule_work(&hba->eh_work);
 		}
 	}
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: ufs: introduce a new ufshcd_statea UFSHCD_STATE_EH_SCHEDULED
  2016-11-16  3:29 [PATCH] scsi: ufs: introduce a new ufshcd_statea UFSHCD_STATE_EH_SCHEDULED Zang Leigang
@ 2016-11-16 18:48 ` Subhash Jadavani
  2016-11-17  1:29 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Subhash Jadavani @ 2016-11-16 18:48 UTC (permalink / raw)
  To: Zang Leigang
  Cc: vinholikatti, jejb, martin.petersen, linux-scsi, linux-scsi-owner

On 2016-11-15 19:29, Zang Leigang wrote:
> Add a new ufshcd_state, indicats that an err handler may get to run
> immediately. Use UFSHCD_STATE_ERROR here looks not literaly correct.
> 
> Signed-off-by: Zang Leigang <zangleigang@hisilicon.com>
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 05c7456..59d4130 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -123,6 +123,7 @@ enum {
>  	UFSHCD_STATE_RESET,
>  	UFSHCD_STATE_ERROR,
>  	UFSHCD_STATE_OPERATIONAL,
> +	UFSHCD_STATE_EH_SCHEDULED,
>  };
> 
>  /* UFSHCD error handling flags */
> @@ -1410,6 +1411,7 @@ static int ufshcd_queuecommand(struct Scsi_Host
> *host, struct scsi_cmnd *cmd)
>  	switch (hba->ufshcd_state) {
>  	case UFSHCD_STATE_OPERATIONAL:
>  		break;
> +	case UFSHCD_STATE_EH_SCHEDULED:
>  	case UFSHCD_STATE_RESET:
>  		err = SCSI_MLQUEUE_HOST_BUSY;
>  		goto out_unlock;
> @@ -4158,7 +4160,7 @@ static void ufshcd_check_errors(struct ufs_hba 
> *hba)
>  			/* block commands from scsi mid-layer */
>  			scsi_block_requests(hba->host);
> 
> -			hba->ufshcd_state = UFSHCD_STATE_ERROR;
> +			hba->ufshcd_state = UFSHCD_STATE_EH_SCHEDULED;
>  			schedule_work(&hba->eh_work);
>  		}
>  	}


LGTM.
Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>


-- 
The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: ufs: introduce a new ufshcd_statea UFSHCD_STATE_EH_SCHEDULED
  2016-11-16  3:29 [PATCH] scsi: ufs: introduce a new ufshcd_statea UFSHCD_STATE_EH_SCHEDULED Zang Leigang
  2016-11-16 18:48 ` Subhash Jadavani
@ 2016-11-17  1:29 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2016-11-17  1:29 UTC (permalink / raw)
  To: Zang Leigang; +Cc: vinholikatti, jejb, martin.petersen, linux-scsi

>>>>> "Zang" == Zang Leigang <zangleigang@hisilicon.com> writes:

Zang> Add a new ufshcd_state, indicats that an err handler may get to
Zang> run immediately. Use UFSHCD_STATE_ERROR here looks not literaly
Zang> correct.

Applied to 4.10/scsi-queue.

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-17  1:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-16  3:29 [PATCH] scsi: ufs: introduce a new ufshcd_statea UFSHCD_STATE_EH_SCHEDULED Zang Leigang
2016-11-16 18:48 ` Subhash Jadavani
2016-11-17  1:29 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).