lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 1 Feb 2024 11:36:18 +0800
From: Can Guo <quic_cang@...cinc.com>
To: Bart Van Assche <bvanassche@....org>, 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 2/1/2024 1:44 AM, Bart Van Assche wrote:
> On 1/22/24 00:33, SEO HOYOUNG wrote:
>> This is because ufshcd_errhandling_prepare() and
>> ufshcd_err_handling_unprepare() repeatedly release calls.
> 
> It would have been much more clear if it would have been mentioned that
> ufshcd_err_handling_prepare() should call ufshcd_hold() once and
> also that ufshcd_err_handling_unprepare() should call ufshcd_release()
> once.
> 
> Additionally, a Fixes: tag is missing. Is this patch perhaps a fix for 
> commit
> c72e79c0ad2b ("scsi: ufs: Recover HBA runtime PM error in error handler")?
> Can Guo, since you wrote that patch, can you please take a look at this 
> patch?
> 
>> 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);

When we are here, it means runtime resume has failed.

When I wrote the code (in older kernel), ufshcd_runtime_resume(), if 
fails, bails without calling ufshcd_release(), eventually 
ufshcd_err_handling_unprepare() would call ufshcd_release() to balance.

But now, I see that if __ufshcd_wl_resume() fails, ufshcd_release() is 
called anyways, so ufshcd_release() is not required here. Hence,

Reviewed-by: Can Guo <quic_cang@...cinc.com>

>>           pm_op = hba->is_sys_suspended ? UFS_SYSTEM_PM : UFS_RUNTIME_PM;
>>           ufshcd_vops_resume(hba, pm_op);
>>       } else {
> 
> Reviewed-by: Bart Van Assche <bvanassche@....org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ