linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Can Guo <cang@codeaurora.org>
To: Kiwoong Kim <kwmad.kim@samsung.com>
Cc: linux-scsi@vger.kernel.org, alim.akhtar@samsung.com,
	avri.altman@wdc.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, beanhuo@micron.com,
	asutoshd@codeaurora.org, bvanassche@acm.org,
	grant.jung@samsung.com, sc.suh@samsung.com, hy50.seo@samsung.com,
	sh425.lee@samsung.com, bhoon95.kim@samsung.com
Subject: Re: [RFC PATCH v1] ufs: relocate flush of exceptional event
Date: Sun, 20 Dec 2020 13:48:49 +0800	[thread overview]
Message-ID: <bd3f1db0170a5cc6badade2d5372ef19@codeaurora.org> (raw)
In-Reply-To: <1608360039-16390-1-git-send-email-kwmad.kim@samsung.com>

On 2020-12-19 14:40, Kiwoong Kim wrote:
> I found one case as follows and the current flush
> location doesn't guarantee disabling BKOPS in the
> case of requsting device power off.
> 1) The exceptional event handler is queued.
> 2) ufs suspend starts with a request of device power off
> 3) BKOPS is disabled in ufs suspend
> 4) The queued work for the handler is done and BKOPS
> is enabled again.
> 
> Signed-off-by: Kiwoong Kim <kwmad.kim@samsung.com>
> ---
>  drivers/scsi/ufs/ufshcd.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index 92d433d..414025c 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -8608,6 +8608,8 @@ static int ufshcd_suspend(struct ufs_hba *hba,
> enum ufs_pm_op pm_op)
>  			ufshcd_wb_need_flush(hba));
>  	}
> 
> +	flush_work(&hba->eeh_work);
> +
>  	if (req_dev_pwr_mode != hba->curr_dev_pwr_mode) {
>  		if ((ufshcd_is_runtime_pm(pm_op) && !hba->auto_bkops_enabled) ||
>  		    !ufshcd_is_runtime_pm(pm_op)) {
> @@ -8622,8 +8624,6 @@ static int ufshcd_suspend(struct ufs_hba *hba,
> enum ufs_pm_op pm_op)
>  		}
>  	}
> 
> -	flush_work(&hba->eeh_work);
> -
>  	/*
>  	 * In the case of DeepSleep, the device is expected to remain powered
>  	 * with the link off, so do not check for bkops.

Reviewed-by: Can Guo <cang@codeaurora.org>

  reply	other threads:[~2020-12-20  5:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20201219065127epcas2p4ee350f78ba75619dfd502dbb2e694a9b@epcas2p4.samsung.com>
2020-12-19  6:40 ` [RFC PATCH v1] ufs: relocate flush of exceptional event Kiwoong Kim
2020-12-20  5:48   ` Can Guo [this message]
2020-12-20 14:09   ` Stanley Chu
2021-01-08  4:19   ` Martin K. Petersen

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=bd3f1db0170a5cc6badade2d5372ef19@codeaurora.org \
    --to=cang@codeaurora.org \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=bhoon95.kim@samsung.com \
    --cc=bvanassche@acm.org \
    --cc=grant.jung@samsung.com \
    --cc=hy50.seo@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=kwmad.kim@samsung.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sc.suh@samsung.com \
    --cc=sh425.lee@samsung.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 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).