public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Stanley Chu <stanley.chu@mediatek.com>
To: <peter.wang@mediatek.com>
Cc: <linux-scsi@vger.kernel.org>, <martin.petersen@oracle.com>,
	<avri.altman@wdc.com>, <alim.akhtar@samsung.com>,
	<jejb@linux.ibm.com>, <wsd_upstream@mediatek.com>,
	<chun-hung.wu@mediatek.com>, <alice.chao@mediatek.com>,
	<cc.chou@mediatek.com>, <chaotian.jing@mediatek.com>,
	<jiajie.hao@mediatek.com>
Subject: Re: [PATCH v4] scsi: ufs-mediatek: fix ufs power down specs violation
Date: Wed, 12 May 2021 18:11:38 +0800	[thread overview]
Message-ID: <1620814298.21674.5.camel@mtkswgap22> (raw)
In-Reply-To: <1620813706-25331-1-git-send-email-peter.wang@mediatek.com>

Hi Peter,

On Wed, 2021-05-12 at 18:01 +0800, peter.wang@mediatek.com wrote:
> From: Peter Wang <peter.wang@mediatek.com>
> 
> As per specs, e.g, JESD220E chapter 7.2, while powering off
> the ufs device, RST_N signal should be between VSS(Ground)
> and VCCQ/VCCQ2. The power down sequence after fixing as below:
> 
> Power down:
> 1. Assert RST_N low
> 2. Turn-off VCC
> 3. Turn-off VCCQ/VCCQ2
> 
> Signed-off-by: Peter Wang <peter.wang@mediatek.com>
> ---
>  drivers/scsi/ufs/ufs-mediatek.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
> index c55202b..47b4066 100644
> --- a/drivers/scsi/ufs/ufs-mediatek.c
> +++ b/drivers/scsi/ufs/ufs-mediatek.c
> @@ -922,6 +922,7 @@ static void ufs_mtk_vreg_set_lpm(struct ufs_hba *hba, bool lpm)
>  static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
>  {
>  	int err;
> +	struct arm_smccc_res res;
>  
>  	if (ufshcd_is_link_hibern8(hba)) {
>  		err = ufs_mtk_link_set_lpm(hba);
> @@ -941,6 +942,9 @@ static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
>  			goto fail;
>  	}
>  
> +	if (ufshcd_is_link_off(hba))
> +		ufs_mtk_device_reset_ctrl(0, res);
> +

For the case "linkoff @ suspend", HW reset pin can be de-asserted via
ufshcd_resume() -> ufshcd_reset_and_restore() ->
ufshcd_vops_device_reset(), so this looks good to me.

Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>



  parent reply	other threads:[~2021-05-12 10:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 10:01 [PATCH v4] scsi: ufs-mediatek: fix ufs power down specs violation peter.wang
2021-05-12 10:01 ` [PATCH] " peter.wang
2021-05-12 10:11 ` Stanley Chu [this message]
2021-05-13  6:45 ` [PATCH v4] " Avri Altman
2021-05-13  7:58   ` Peter Wang
2021-05-13  8:15     ` Avri Altman
2021-05-15  3:13 ` 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=1620814298.21674.5.camel@mtkswgap22 \
    --to=stanley.chu@mediatek.com \
    --cc=alice.chao@mediatek.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=cc.chou@mediatek.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=chun-hung.wu@mediatek.com \
    --cc=jejb@linux.ibm.com \
    --cc=jiajie.hao@mediatek.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=peter.wang@mediatek.com \
    --cc=wsd_upstream@mediatek.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