From: Greg KH <gregkh@linuxfoundation.org>
To: peter.wang@mediatek.com
Cc: stanley.chu@mediatek.com, 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, 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, powen.kao@mediatek.com,
qilin.tan@mediatek.com, lin.gui@mediatek.com,
tun-yu.yu@mediatek.com, eddie.huang@mediatek.com,
naomi.chu@mediatek.com, stable@vger.kernel.org
Subject: Re: [PATCH v6] ufs: core: wlun suspend SSU/enter hibern8 fail recovery
Date: Thu, 8 Dec 2022 09:02:53 +0100 [thread overview]
Message-ID: <Y5GaLX6AYEtHFU9F@kroah.com> (raw)
In-Reply-To: <20221208072520.26210-1-peter.wang@mediatek.com>
On Thu, Dec 08, 2022 at 03:25:20PM +0800, peter.wang@mediatek.com wrote:
> From: Peter Wang <peter.wang@mediatek.com>
>
> When SSU/enter hibern8 fail in wlun suspend flow, trigger error
> handler and return busy to break the suspend.
> If not, wlun runtime pm status become error and the consumer will
> stuck in runtime suspend status.
>
> Fixes: b294ff3e3449 ("scsi: ufs: core: Enable power management for wlun")
> Cc: stable@vger.kernel.org
> Signed-off-by: Peter Wang <peter.wang@mediatek.com>
> Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
> Reviewed-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/ufs/core/ufshcd.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index b1f59a5fe632..31ed3fdb5266 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -6070,6 +6070,14 @@ void ufshcd_schedule_eh_work(struct ufs_hba *hba)
> }
> }
>
> +static void ufshcd_force_error_recovery(struct ufs_hba *hba)
> +{
> + spin_lock_irq(hba->host->host_lock);
> + hba->force_reset = true;
> + ufshcd_schedule_eh_work(hba);
> + spin_unlock_irq(hba->host->host_lock);
> +}
> +
> static void ufshcd_clk_scaling_allow(struct ufs_hba *hba, bool allow)
> {
> down_write(&hba->clk_scaling_lock);
> @@ -9049,6 +9057,15 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
>
> if (!hba->dev_info.b_rpm_dev_flush_capable) {
> ret = ufshcd_set_dev_pwr_mode(hba, req_dev_pwr_mode);
> + if (ret && pm_op != UFS_SHUTDOWN_PM) {
> + /*
> + * If return err in suspend flow, IO will hang.
> + * Trigger error handler and break suspend for
> + * error recovery.
> + */
> + ufshcd_force_error_recovery(hba);
> + ret = -EBUSY;
> + }
> if (ret)
> goto enable_scaling;
> }
> @@ -9060,6 +9077,15 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
> */
> check_for_bkops = !ufshcd_is_ufs_dev_deepsleep(hba);
> ret = ufshcd_link_state_transition(hba, req_link_state, check_for_bkops);
> + if (ret && pm_op != UFS_SHUTDOWN_PM) {
> + /*
> + * If return err in suspend flow, IO will hang.
> + * Trigger error handler and break suspend for
> + * error recovery.
> + */
> + ufshcd_force_error_recovery(hba);
> + ret = -EBUSY;
> + }
> if (ret)
> goto set_dev_active;
>
> --
> 2.18.0
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- This looks like a new version of a previously submitted patch, but you
did not list below the --- line any changes from the previous version.
Please read the section entitled "The canonical patch format" in the
kernel file, Documentation/SubmittingPatches for what needs to be done
here to properly describe this.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
next prev parent reply other threads:[~2022-12-08 8:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-08 7:25 [PATCH v6] ufs: core: wlun suspend SSU/enter hibern8 fail recovery peter.wang
2022-12-08 8:02 ` Greg KH [this message]
2022-12-14 3:16 ` Martin K. Petersen
2022-12-20 21:00 ` Daniil Lunev
2022-12-21 5:59 ` Peter Wang (王信友)
2023-01-02 22:05 ` Daniil Lunev
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=Y5GaLX6AYEtHFU9F@kroah.com \
--to=gregkh@linuxfoundation.org \
--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=eddie.huang@mediatek.com \
--cc=jejb@linux.ibm.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=powen.kao@mediatek.com \
--cc=qilin.tan@mediatek.com \
--cc=stable@vger.kernel.org \
--cc=stanley.chu@mediatek.com \
--cc=tun-yu.yu@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