From: "hoyoung seo" <hy50.seo@samsung.com>
To: "'Bart Van Assche'" <bvanassche@acm.org>,
<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<alim.akhtar@samsung.com>, <avri.altman@wdc.com>,
<jejb@linux.ibm.com>, <martin.petersen@oracle.com>,
<beanhuo@micron.com>, <kwangwon.min@samsung.com>,
<kwmad.kim@samsung.com>, <sh425.lee@samsung.com>,
<sc.suh@samsung.com>, <quic_nguyenb@quicinc.com>,
<cpgs@samsung.com>, <grant.jung@samsung.com>,
<junwoo80.lee@samsung.com>
Subject: RE: [PATCH v1] scsi: ufs: core: Remove the ufshcd_release in ufshcd_err_handling_prepare
Date: Wed, 31 Jan 2024 17:23:12 +0900 [thread overview]
Message-ID: <000001da541e$bb358590$31a090b0$@samsung.com> (raw)
In-Reply-To: <92463403-ea32-4545-a466-21243cd454e2@acm.org>
> -----Original Message-----
> From: Bart Van Assche <bvanassche@acm.org>
> Sent: Thursday, January 25, 2024 1:17 AM
> To: hoyoung seo <hy50.seo@samsung.com>; linux-scsi@vger.kernel.org; linux-
> kernel@vger.kernel.org; alim.akhtar@samsung.com; avri.altman@wdc.com;
> jejb@linux.ibm.com; martin.petersen@oracle.com; beanhuo@micron.com;
> kwangwon.min@samsung.com; kwmad.kim@samsung.com; sh425.lee@samsung.com;
> sc.suh@samsung.com; quic_nguyenb@quicinc.com; cpgs@samsung.com;
> grant.jung@samsung.com; junwoo80.lee@samsung.com
> Subject: Re: [PATCH v1] scsi: ufs: core: Remove the ufshcd_release in
> ufshcd_err_handling_prepare
>
> On 1/22/24 18:38, hoyoung seo wrote:
> > When err_handler is completed, active_reqs becomes negative because
> > ufshcd_release() is called again in ufshcd_err_handling_unprepare().
> > I tested it while printing the log, and if I misanalyzed it, let me know.
>
> Please repeat your analysis. I think this patch is wrong.
>
> Thanks,
>
> Bart.
Hi,
I do not understand. why you said my patch is wrong.
If ufs entered suspend with hibern8 state then the hba->clk_gating.active_reqs is 1.
After that run wl_resume(), ufs drvier send hibern8 exit command.
At that time, if the command timeout or error occurs, the err_handler is activated.
Then the active_reqs pair may not fit.
So to sum up, ufs_release() is performed 3 time.
(wl_resume(), ufshcd_err_handling_prepare(), ufshcd_err_handling_unprepare())
And the ufshcd_hold() is performed 2 time(__ufshcd_wl_suspend(), ufshcd_err_handling_prepare())
So the paire of active_reqs is not correct.
So I deleted the ufshcd_release() in ufshcd_err_handling_prepare().
The ufshcd_release() was not called again even in the pm_op_in_progress state in 4.xx version of the kernel.
But now if is_sys_suspended is 1, then ufshcd_release() is called once more.
I don't understand why this is added and the pair doesn't fit.
Please check it again.
Thanks.
Seo.
next prev parent reply other threads:[~2024-01-31 8:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20240122083204epcas2p26a1bca522e201972ca072e0b24d23a52@epcas2p2.samsung.com>
2024-01-22 8:33 ` [PATCH v1] scsi: ufs: core: Remove the ufshcd_release in ufshcd_err_handling_prepare SEO HOYOUNG
2024-01-22 20:36 ` Bart Van Assche
2024-01-23 2:38 ` hoyoung seo
2024-01-24 16:17 ` Bart Van Assche
2024-01-31 8:23 ` hoyoung seo [this message]
2024-01-31 17:40 ` Bart Van Assche
2024-01-31 17:44 ` Bart Van Assche
2024-02-01 3:36 ` Can Guo
2024-02-06 2:08 ` 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='000001da541e$bb358590$31a090b0$@samsung.com' \
--to=hy50.seo@samsung.com \
--cc=alim.akhtar@samsung.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=cpgs@samsung.com \
--cc=grant.jung@samsung.com \
--cc=jejb@linux.ibm.com \
--cc=junwoo80.lee@samsung.com \
--cc=kwangwon.min@samsung.com \
--cc=kwmad.kim@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=quic_nguyenb@quicinc.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