linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bean Huo <huobean@gmail.com>
To: 이승희 <sh043.lee@samsung.com>,
	alim.akhtar@samsung.com, avri.altman@wdc.com, bvanassche@acm.org,
	James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	sdriver.sec@samsung.com
Subject: Re: [PATCH] ufs: core: Use link recovery when the h8 exit failure during runtime resume
Date: Tue, 15 Jul 2025 14:47:15 +0200	[thread overview]
Message-ID: <f2f221d00bf5d2c83628a098eda72f29a6503f87.camel@gmail.com> (raw)
In-Reply-To: <000901dbf52f$63a69090$2af3b1b0$@samsung.com>

On Tue, 2025-07-15 at 11:23 +0900, 이승희 wrote:
> 2> if eh_in_progress, err EBUSY return in ufshcd_runtime_suspend to guarantee the error handling done.
> -> It doesn't work as well.
> 
> --- a/common/drivers/ufs/core/ufshcd.c
> +++ b/common/drivers/ufs/core/ufshcd.c
> @@ -10371,6 +10371,9 @@ int ufshcd_runtime_suspend(struct device *dev)
>         int ret;
>         ktime_t start = ktime_get();
>  
> +       if (ufshcd_eh_in_progress(hba))
> +               return -EBUSY;
> +
>         ret = ufshcd_suspend(hba);
>  
>         trace_ufshcd_runtime_suspend(hba, ret,
> 
> [   63.010841] [4:    kworker/4:0:   52] ufshcd-qcom 1d84000.ufshc: ufshcd_uic_hibern8_exit: hibern8 exit failed. ret = -110
> [   63.010844] [4:    kworker/4:0:   52] ufshcd-qcom 1d84000.ufshc: __ufshcd_wl_resume: hibern8 exit failed -110
> 
> [   63.010845] [0: kworker/u32:10:13604] ufshcd-qcom 1d84000.ufshc: ufshcd_err_handler started; HBA state eh_fatal; powered 1; shutting down 0; saved_err = 0; saved_uic_err = 0; force_reset = 0;
> link is broken
> 
> [   63.011430] [4:    kworker/4:0:   52] ufs_device_wlun 0:0:0:49488: ufshcd_wl_runtime_resume failed: -110
> [   63.011433] [4:    kworker/4:0:   52] ufs_device_wlun 0:0:0:49488: ufshcd_wl_runtime_resume: 574917us, pwr_mode(1), link state(3)
> -> ufshcd_wl_runtime_resume failed done.
>    -> ufshcd_rpm_get_sync() in ufshcd_err_handling_prepare()
> 
> [   63.011457] [4:    kworker/4:0:   52] ufshcd-qcom 1d84000.ufshc: ufshcd_runtime_suspend: eh_in_progress
> -> EBUSY return in ufshcd_runtime_suspend due to eh_in_progress
> 
> [   63.011464]I[0: kworker/u32:10:13604] ufshcd-qcom 1d84000.ufshc: ufshcd_check_errors: Auto Hibern8 Exit failed - status: 0x00000020, upmcrs: 0x00000001
> [   63.011468]I[0: kworker/u32:10:13604] ufshcd-qcom 1d84000.ufshc: ufshcd_check_errors: saved_err 0x20 saved_uic_err 0x0
> 
> [   63.039824] [0: kworker/u32:10:13604] ufshcd-qcom 1d84000.ufshc: ufs_qcom_device_reset: Waiting for device internal cache flush
> 
> [   65.084604] [0: kworker/u32:10:13604] ufshcd-qcom 1d84000.ufshc: ESI configured
> [   65.084728] [0: kworker/u32:10:13604] ufshcd-qcom 1d84000.ufshc: MCQ configured, nr_queues=9, io_queues=8, read_queue=0, poll_queues=1, queue_depth=64
> -> ufshcd_reset_and_restore() works well.
> 
> [   65.105186] [1: kworker/u32:10:13604] ufs_device_wlun 0:0:0:49488: runtime PM trying to activate child device 0:0:0:49488 but parent (target0:0:0) is not active
> -> ufschd_recover_pm_err()
>    -> Because of this error, pm_request_resume doesn't call here.
>    
> [   65.105305] [1: kworker/u32:10:13604] ufshcd-qcom 1d84000.ufshc: ufshcd_err_handler finished; HBA state operational
> [   65.105310] [1: kworker/u32:10:13604] ufshcd-qcom 1d84000.ufshc: ufshcd_err_handler started; HBA state operational; powered 1; shutting down 0; saved_err = 0; saved_uic_err = 0; force_reset = 


Thanks for updating the logs — I can now see the issue clearly.
Please add the appropriate Fixes tag to the patch.

By the way, I prefer the second approach as well and would rather handle recovery in a single interface.
It’s strange that it's not working as expected.
However, I don’t see ufschd_recover_pm_err() being invoked in my code either.

kind regards,
Bean

  reply	other threads:[~2025-07-15 12:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20250714090630epcas1p28ab8afec11bbab4d256dfe6649d3b00b@epcas1p2.samsung.com>
2025-07-14  9:06 ` [PATCH] ufs: core: Use link recovery when the h8 exit failure during runtime resume Seunghui Lee
2025-07-14 11:21   ` Bean Huo
2025-07-15  2:23     ` 이승희
2025-07-15 12:47       ` Bean Huo [this message]
2025-07-15 15:21       ` Bean Huo
2025-07-16  7:01         ` Seunghui Lee
2025-07-16  7:49           ` Seunghui Lee
2025-07-16 13:35             ` Bean Huo
2025-07-16 15:02               ` Bart Van Assche
2025-07-17  6:12               ` Seunghui Lee
2025-07-16 15:14           ` Bart Van Assche
2025-07-17  6:01             ` Seunghui Lee

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=f2f221d00bf5d2c83628a098eda72f29a6503f87.camel@gmail.com \
    --to=huobean@gmail.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=sdriver.sec@samsung.com \
    --cc=sh043.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).