From: Can Guo <cang@codeaurora.org>
To: Lee Sang Hyun <sh425.lee@samsung.com>
Cc: linux-scsi@vger.kernel.org, alim.akhtar@samsung.com,
avri.altman@wdc.com, jejb@linux.ibm.com,
martin.petersen@oracle.com, beanhuo@micron.com,
asutoshd@codeaurora.org, bvanassche@acm.org,
grant.jung@samsung.com, sc.suh@samsung.com, hy50.seo@samsung.com,
kwmad.kim@samsung.com
Subject: Re: [PATCH] scsi: ufs: set STATE_ERROR when ufshcd_probe_hba() failed
Date: Sat, 18 Jul 2020 12:14:37 +0800 [thread overview]
Message-ID: <6e5669e589d874e4e142020ad37721bf@codeaurora.org> (raw)
In-Reply-To: <1594970896-36170-1-git-send-email-sh425.lee@samsung.com>
Hi Sang Hyun,
On 2020-07-17 15:28, Lee Sang Hyun wrote:
> set STATE_ERR like below to prevent a lockup(IO stuck)
> when ufshcd_probe_hba() returns error.
>
> Change-Id: I6c85ff290503cc9414d7f5fdd934295497b854ff
> Signed-off-by: Lee Sang Hyun <sh425.lee@samsung.com>
> ---
> drivers/scsi/ufs/ufshcd.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
> index ad4fc82..37e4105 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -7368,6 +7368,7 @@ static int ufshcd_probe_hba(struct ufs_hba *hba,
> bool async)
> {
> int ret;
> ktime_t start = ktime_get();
> + unsigned long flags;
>
> ret = ufshcd_link_startup(hba);
> if (ret)
> @@ -7439,6 +7440,11 @@ static int ufshcd_probe_hba(struct ufs_hba
> *hba, bool async)
> ufshcd_auto_hibern8_enable(hba);
>
> out:
> + if (ret) {
> + spin_lock_irqsave(hba->host->host_lock, flags);
> + hba->ufshcd_state = UFSHCD_STATE_ERROR;
> + spin_unlock_irqrestore(hba->host->host_lock, flags);
> + }
This change is included in my change
"scsi: ufs: Fix up and simplify error recovery mechanism",
please take a look if you are interested.
Thanks,
Can Guo.
>
> trace_ufshcd_init(dev_name(hba->dev), ret,
> ktime_to_us(ktime_sub(ktime_get(), start)),
prev parent reply other threads:[~2020-07-18 4:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20200717073633epcas2p21b8f5b5c64626b8ea299930193c6ad56@epcas2p2.samsung.com>
2020-07-17 7:28 ` [PATCH] scsi: ufs: set STATE_ERROR when ufshcd_probe_hba() failed Lee Sang Hyun
2020-07-18 4:14 ` Can Guo [this message]
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=6e5669e589d874e4e142020ad37721bf@codeaurora.org \
--to=cang@codeaurora.org \
--cc=alim.akhtar@samsung.com \
--cc=asutoshd@codeaurora.org \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=grant.jung@samsung.com \
--cc=hy50.seo@samsung.com \
--cc=jejb@linux.ibm.com \
--cc=kwmad.kim@samsung.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sc.suh@samsung.com \
--cc=sh425.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).