linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: remove unnecessary UFSHCD_STATE_ERROR set
@ 2016-11-15 12:25 Zang Leigang
  2016-11-15 19:00 ` Subhash Jadavani
  0 siblings, 1 reply; 3+ messages in thread
From: Zang Leigang @ 2016-11-15 12:25 UTC (permalink / raw)
  To: vinholikatti, jejb, martin.petersen, linux-scsi

We set ufshcd_state to UFSHCD_STATE_ERROR when an err handler
fails. So I think UFSHCD_STATE_ERROR means host not works any more.
Set it before schedule eh_work is not 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..a7724ad 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -4158,7 +4158,6 @@ 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;
 			schedule_work(&hba->eh_work);
 		}
 	}
-- 
2.9.3


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

* Re: [PATCH] scsi: ufs: remove unnecessary UFSHCD_STATE_ERROR set
  2016-11-15 12:25 [PATCH] scsi: ufs: remove unnecessary UFSHCD_STATE_ERROR set Zang Leigang
@ 2016-11-15 19:00 ` Subhash Jadavani
  2016-11-16  3:13   ` Zang Leigang
  0 siblings, 1 reply; 3+ messages in thread
From: Subhash Jadavani @ 2016-11-15 19:00 UTC (permalink / raw)
  To: Zang Leigang
  Cc: vinholikatti, jejb, martin.petersen, linux-scsi, linux-scsi-owner

On 2016-11-15 04:25, Zang Leigang wrote:
> We set ufshcd_state to UFSHCD_STATE_ERROR when an err handler
> fails. So I think UFSHCD_STATE_ERROR means host not works any more.
> Set it before schedule eh_work is not 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..a7724ad 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -4158,7 +4158,6 @@ 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;

But we may still want to stop the new requests from being issued (via 
ufshcd_queuecommand) until error handler (ufshcd_err_handler()) gets 
chance to run. May be a new intermediate state like 
UFSHCD_STATE_EH_SCHEDULED should be added and set here, we have to check 
the same in ufshcd_queuecommand() to return busy if ufshcd_state is 
UFSHCD_STATE_EH_SCHEDULED.

>  			schedule_work(&hba->eh_work);
>  		}
>  	}

-- 
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: remove unnecessary UFSHCD_STATE_ERROR set
  2016-11-15 19:00 ` Subhash Jadavani
@ 2016-11-16  3:13   ` Zang Leigang
  0 siblings, 0 replies; 3+ messages in thread
From: Zang Leigang @ 2016-11-16  3:13 UTC (permalink / raw)
  To: Subhash Jadavani
  Cc: vinholikatti, jejb, martin.petersen, linux-scsi, linux-scsi-owner

Ok, got it.
I will resend a new patch.

On Tue, Nov 15, 2016 at 11:00:12AM -0800, Subhash Jadavani wrote:
> On 2016-11-15 04:25, Zang Leigang wrote:
> >We set ufshcd_state to UFSHCD_STATE_ERROR when an err handler
> >fails. So I think UFSHCD_STATE_ERROR means host not works any more.
> >Set it before schedule eh_work is not 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..a7724ad 100644
> >--- a/drivers/scsi/ufs/ufshcd.c
> >+++ b/drivers/scsi/ufs/ufshcd.c
> >@@ -4158,7 +4158,6 @@ 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;
> 
> But we may still want to stop the new requests from being issued
> (via ufshcd_queuecommand) until error handler (ufshcd_err_handler())
> gets chance to run. May be a new intermediate state like
> UFSHCD_STATE_EH_SCHEDULED should be added and set here, we have to
> check the same in ufshcd_queuecommand() to return busy if
> ufshcd_state is UFSHCD_STATE_EH_SCHEDULED.
> 
> > 			schedule_work(&hba->eh_work);
> > 		}
> > 	}
> 
> -- 
> 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

end of thread, other threads:[~2016-11-16  3:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-15 12:25 [PATCH] scsi: ufs: remove unnecessary UFSHCD_STATE_ERROR set Zang Leigang
2016-11-15 19:00 ` Subhash Jadavani
2016-11-16  3:13   ` Zang Leigang

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).