[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <06e0ae57-f567-4b90-ad68-4ae73909c29e@acm.org>
Date: Mon, 22 Jan 2024 12:36:30 -0800
From: Bart Van Assche <bvanassche@....org>
To: SEO HOYOUNG <hy50.seo@...sung.com>, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org, alim.akhtar@...sung.com, avri.altman@....com,
jejb@...ux.ibm.com, martin.petersen@...cle.com, beanhuo@...ron.com,
kwangwon.min@...sung.com, kwmad.kim@...sung.com, sh425.lee@...sung.com,
sc.suh@...sung.com, quic_nguyenb@...cinc.com, cpgs@...sung.com,
grant.jung@...sung.com, junwoo80.lee@...sung.com
Subject: Re: [PATCH v1] scsi: ufs: core: Remove the ufshcd_release in
ufshcd_err_handling_prepare
On 1/22/24 00:33, SEO HOYOUNG wrote:
> If err_handler is performed in the suspend/resume situation, ufs_release
> can be called twice and active_reqs valid can be negative.
> This is because ufshcd_errhandling_prepare() and
> ufshcd_err_handling_unprepare() repeatedly release calls.
> Eventually, active_reqs have a value different from the intention.
> To prevent this, release duplication processing was removed.
>
> Signed-off-by: SEO HOYOUNG <hy50.seo@...sung.com>
> ---
> drivers/ufs/core/ufshcd.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 7c59d7a02243..423e83074a20 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -6351,7 +6351,6 @@ static void ufshcd_err_handling_prepare(struct ufs_hba *hba)
> ufshcd_hold(hba);
> if (!ufshcd_is_clkgating_allowed(hba))
> ufshcd_setup_clocks(hba, true);
> - ufshcd_release(hba);
> pm_op = hba->is_sys_suspended ? UFS_SYSTEM_PM : UFS_RUNTIME_PM;
> ufshcd_vops_resume(hba, pm_op);
> } else {
I think that the above ufshcd_release() call pairs with the ufshcd_hold()
call three lines above it and hence that removing that call would be
wrong.
Thanks,
Bart.
Powered by blists - more mailing lists