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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cecf35ca445e175aacb1c2942a74951e@codeaurora.org>
Date:   Fri, 11 Dec 2020 19:13:01 +0800
From:   Can Guo <cang@...eaurora.org>
To:     Bean Huo <huobean@...il.com>
Cc:     asutoshd@...eaurora.org, nguyenb@...eaurora.org,
        hongwus@...eaurora.org, rnayak@...eaurora.org,
        linux-scsi@...r.kernel.org, kernel-team@...roid.com,
        saravanak@...gle.com, salyzyn@...gle.com,
        Alim Akhtar <alim.akhtar@...sung.com>,
        Avri Altman <avri.altman@....com>,
        "James E.J. Bottomley" <jejb@...ux.ibm.com>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        Stanley Chu <stanley.chu@...iatek.com>,
        Bean Huo <beanhuo@...ron.com>,
        Bart Van Assche <bvanassche@....org>,
        Satya Tangirala <satyat@...gle.com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 1/2] scsi: ufs: Protect some contexts from unexpected
 clock scaling

On 2020-12-11 09:36, Can Guo wrote:
> On 2020-12-11 01:34, Bean Huo wrote:
>> Hi Can
>> 
>> On Wed, 2020-12-09 at 05:35 -0800, Can Guo wrote:
>>> 
>>> 
>>> @@ -1160,6 +1166,7 @@ static void
>>> ufshcd_clock_scaling_unprepare(struct ufs_hba *hba)
>>>  {
>>>  	up_write(&hba->clk_scaling_lock);
>>>  	ufshcd_scsi_unblock_requests(hba);
>>> +	ufshcd_release(hba);
>>>  }
>>> 
>>>  /**
>>> @@ -1175,12 +1182,9 @@ static int ufshcd_devfreq_scale(struct ufs_hba
>>> *hba, bool scale_up)
>>>  {
>>>  	int ret = 0;
>>> 
>>> -	/* let's not get into low power until clock scaling is
>>> completed */
>>> -	ufshcd_hold(hba, false);
>>> -
>>>  	ret = ufshcd_clock_scaling_prepare(hba);
>>>  	if (ret)
>>> -		goto out;
>>> +		return ret;
>>> 
>>>  	/* scale down the gear before scaling down clocks */
>>>  	if (!scale_up) {
>>> @@ -1212,8 +1216,6 @@ static int ufshcd_devfreq_scale(struct ufs_hba
>>> *hba, bool scale_up)
>>> 
>>>  out_unprepare:
>>>  	ufshcd_clock_scaling_unprepare(hba);
>>> -out:
>>> -	ufshcd_release(hba);
>>>  	return ret;
>>>  }
>> 
>> I didn't understand why moving ufshcd_hold/ufshcd_release into
>> ufshcd_clock_scaling_prepare()/ufshcd_clock_scaling_unprepare().
>> 
>> 
>>> 
>>> @@ -1294,15 +1296,8 @@ static int ufshcd_devfreq_target(struct device
>>> *dev,
>>>  	}
>>>  	spin_unlock_irqrestore(hba->host->host_lock, irq_flags);
>>> 
>>> -	pm_runtime_get_noresume(hba->dev);
>>> -	if (!pm_runtime_active(hba->dev)) {
>>> -		pm_runtime_put_noidle(hba->dev);
>>> -		ret = -EAGAIN;
>>> -		goto out;
>>> -	}
>>>  	start = ktime_get();
>>>  	ret = ufshcd_devfreq_scale(hba, scale_up);
>>> -	pm_runtime_put(hba->dev);
>>> 
>> 
>> which branch are you working on?  I didn't see this part codes in the
>> branch 5.11/scsi-queue and 5.11/scsi-staging.
>> 
>> Bean
> 
> As I mentioned in my cover-letter, this is based on 5.11/scsi-fixes.
> These codes came from one of my earlier changes, but since this change
> can cover the old change's functionality, so I removed the codes.
> 
> Can Guo.

Hi Bean,

Sorry for the typo, it is branch 5.10/scsi-fixes.

Thanks,

Can Guo.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ