linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: peter.wang@mediatek.com, linux-scsi@vger.kernel.org,
	martin.petersen@oracle.com
Cc: wsd_upstream@mediatek.com, linux-mediatek@lists.infradead.org,
	chun-hung.wu@mediatek.com, alice.chao@mediatek.com,
	cc.chou@mediatek.com, chaotian.jing@mediatek.com,
	jiajie.hao@mediatek.com, yi-fan.peng@mediatek.com,
	qilin.tan@mediatek.com, lin.gui@mediatek.com,
	tun-yu.yu@mediatek.com, eddie.huang@mediatek.com,
	naomi.chu@mediatek.com, ed.tsai@mediatek.com,
	sanjeev.y@mediatek.com
Subject: Re: [PATCH v1 01/10] ufs: host: mediatek: Enhance recovery on hibernation exit failure
Date: Mon, 25 Aug 2025 08:46:32 -0700	[thread overview]
Message-ID: <5f3c62fb-ed35-428c-8862-ad1fe607daa0@acm.org> (raw)
In-Reply-To: <20250825101815.2891905-2-peter.wang@mediatek.com>

On 8/25/25 3:10 AM, peter.wang@mediatek.com wrote:
> @@ -1697,8 +1698,20 @@ static void ufs_mtk_auto_hibern8_disable(struct ufs_hba *hba)
>   	ufs_mtk_wait_idle_state(hba, 5);
>   
>   	ret = ufs_mtk_wait_link_state(hba, VS_LINK_UP, 100);
> -	if (ret)
> +	if (ret) {
>   		dev_warn(hba->dev, "exit h8 state fail, ret=%d\n", ret);
> +
> +		spin_lock_irqsave(hba->host->host_lock, flags);
> +		hba->force_reset = true;
> +		hba->ufshcd_state = UFSHCD_STATE_EH_SCHEDULED_FATAL;
> +		schedule_work(&hba->eh_work);
> +		spin_unlock_irqrestore(hba->host->host_lock, flags);
> +
> +		/* trigger error handler and break suspend */
> +		ret = -EBUSY;
> +	}
> +
> +	return ret;
>   }

Hi Peter,

UFS host drivers shouldn't touch hba->force_reset, hba->ufshcd_state nor 
hba->eh_work. Please add a helper function in the UFS driver core and 
export it.

Thanks,

Bart.


  reply	other threads:[~2025-08-25 16:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-25 10:10 [PATCH v1 00/10] ufs: host: mediatek: Power Management and Stability Enhancements peter.wang
2025-08-25 10:10 ` [PATCH v1 01/10] ufs: host: mediatek: Enhance recovery on hibernation exit failure peter.wang
2025-08-25 15:46   ` Bart Van Assche [this message]
2025-08-26  3:04     ` Peter Wang (王信友)
2025-08-25 10:10 ` [PATCH v1 02/10] ufs: host: mediatek: Enhance recovery on resume failure peter.wang
2025-08-25 10:10 ` [PATCH v1 03/10] ufs: host: mediatek: Correct system PM flow peter.wang
2025-08-25 10:10 ` [PATCH v1 04/10] ufs: host: mediatek: Correct resume flow for LPM and MTCMOS peter.wang
2025-08-25 10:10 ` [PATCH v1 05/10] ufs: host: mediatek: Support UFS PHY runtime PM and correct sequence peter.wang
2025-08-25 10:10 ` [PATCH v1 06/10] ufs: host: mediatek: Disable auto-hibern8 during power mode changes peter.wang
2025-08-25 10:10 ` [PATCH v1 07/10] ufs: host: mediatek: Return error directly on idle wait timeout peter.wang
2025-08-25 10:10 ` [PATCH v1 08/10] ufs: host: mediatek: Fix adapt issue after PA_Init peter.wang
2025-08-25 10:10 ` [PATCH v1 09/10] ufs: host: mediatek: Fix unbalanced IRQ enable issue peter.wang
2025-08-25 10:10 ` [PATCH v1 10/10] ufs: host: mediatek: Fix device power control peter.wang

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=5f3c62fb-ed35-428c-8862-ad1fe607daa0@acm.org \
    --to=bvanassche@acm.org \
    --cc=alice.chao@mediatek.com \
    --cc=cc.chou@mediatek.com \
    --cc=chaotian.jing@mediatek.com \
    --cc=chun-hung.wu@mediatek.com \
    --cc=ed.tsai@mediatek.com \
    --cc=eddie.huang@mediatek.com \
    --cc=jiajie.hao@mediatek.com \
    --cc=lin.gui@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=naomi.chu@mediatek.com \
    --cc=peter.wang@mediatek.com \
    --cc=qilin.tan@mediatek.com \
    --cc=sanjeev.y@mediatek.com \
    --cc=tun-yu.yu@mediatek.com \
    --cc=wsd_upstream@mediatek.com \
    --cc=yi-fan.peng@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;
as well as URLs for NNTP newsgroup(s).