From: "Chun-Hung Wu (巫駿宏)" <Chun-hung.Wu@mediatek.com>
To: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"avri.altman@wdc.com" <avri.altman@wdc.com>,
"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
"Peter Wang (王信友)" <peter.wang@mediatek.com>,
"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"Jiajie Hao (郝加节)" <jiajie.hao@mediatek.com>,
"CC Chou (周志杰)" <cc.chou@mediatek.com>,
"Eddie Huang (黃智傑)" <eddie.huang@mediatek.com>,
"Alice Chao (趙珮均)" <Alice.Chao@mediatek.com>,
wsd_upstream <wsd_upstream@mediatek.com>,
"Lin Gui (桂林)" <Lin.Gui@mediatek.com>,
"Tun-yu Yu (游敦聿)" <Tun-yu.Yu@mediatek.com>,
"chu.stanley@gmail.com" <chu.stanley@gmail.com>,
"Chaotian Jing (井朝天)" <Chaotian.Jing@mediatek.com>,
"Powen Kao (高伯文)" <Powen.Kao@mediatek.com>,
"Naomi Chu (朱詠田)" <Naomi.Chu@mediatek.com>,
"Qilin Tan (谭麒麟)" <Qilin.Tan@mediatek.com>
Subject: Re: [PATCH v1 1/3] ufs: host: mediatek: check link status after exit hibern8
Date: Mon, 25 Dec 2023 07:20:15 +0000 [thread overview]
Message-ID: <2899fb4f036ec3087b98d608f2c30134d9f619aa.camel@mediatek.com> (raw)
In-Reply-To: <20231221110416.16176-2-peter.wang@mediatek.com>
On Thu, 2023-12-21 at 19:04 +0800, peter.wang@mediatek.com wrote:
> From: Peter Wang <peter.wang@mediatek.com>
>
> To prevent SSU(Active) error, check link status after exit hibern8.
> If link is not VS_LINK_UP, return error and do ufshcd_link_recovery.
>
> Signed-off-by: Peter Wang <peter.wang@mediatek.com>
> ---
> drivers/ufs/host/ufs-mediatek.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-
> mediatek.c
> index fc61790d289b..104354a4d899 100644
> --- a/drivers/ufs/host/ufs-mediatek.c
> +++ b/drivers/ufs/host/ufs-mediatek.c
> @@ -1208,11 +1208,18 @@ static int ufs_mtk_link_set_hpm(struct
> ufs_hba *hba)
> return err;
>
> err = ufshcd_uic_hibern8_exit(hba);
> - if (!err)
> - ufshcd_set_link_active(hba);
> - else
> + if (err)
> return err;
>
> + /* Check link state to make sure exit h8 success */
> + ufs_mtk_wait_idle_state(hba, 5);
> + err = ufs_mtk_wait_link_state(hba, VS_LINK_UP, 100);
> + if (err) {
> + dev_warn(hba->dev, "exit h8 state fail, err=%d\n",
> err);
> + return err;
> + }
> + ufshcd_set_link_active(hba);
> +
> if (!hba->mcq_enabled) {
> err = ufshcd_make_hba_operational(hba);
> } else {
Reviewed-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Chun-Hung
next prev parent reply other threads:[~2023-12-25 7:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-21 11:04 [PATCH v1 0/3] ufs: host: mediatek: Provide fixes in MediaTek platforms peter.wang
2023-12-21 11:04 ` [PATCH v1 1/3] ufs: host: mediatek: check link status after exit hibern8 peter.wang
2023-12-25 7:20 ` Chun-Hung Wu (巫駿宏) [this message]
2023-12-21 11:04 ` [PATCH v1 2/3] ufs: host: mediatek: fix mcq mode tm cmd timeout peter.wang
2023-12-25 7:20 ` Chun-Hung Wu (巫駿宏)
2023-12-21 11:04 ` [PATCH v1 3/3] ufs: host: mediatek: disable mcq irq when clock off peter.wang
2023-12-25 7:22 ` Chun-Hung Wu (巫駿宏)
2024-01-24 2:06 ` [PATCH v1 0/3] ufs: host: mediatek: Provide fixes in MediaTek platforms Martin K. Petersen
2024-01-30 2:27 ` 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=2899fb4f036ec3087b98d608f2c30134d9f619aa.camel@mediatek.com \
--to=chun-hung.wu@mediatek.com \
--cc=Alice.Chao@mediatek.com \
--cc=Chaotian.Jing@mediatek.com \
--cc=Lin.Gui@mediatek.com \
--cc=Naomi.Chu@mediatek.com \
--cc=Powen.Kao@mediatek.com \
--cc=Qilin.Tan@mediatek.com \
--cc=Tun-yu.Yu@mediatek.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=cc.chou@mediatek.com \
--cc=chu.stanley@gmail.com \
--cc=eddie.huang@mediatek.com \
--cc=jejb@linux.ibm.com \
--cc=jiajie.hao@mediatek.com \
--cc=linux-mediatek@lists.infradead.org \
--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