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] [thread-next>] [day] [month] [year] [list]
Message-ID: <6e37f0b5-a9b3-7b62-96f9-6bd8f1594fa6@codeaurora.org>
Date:   Wed, 29 Apr 2020 19:49:30 +0530
From:   Rajendra Nayak <rnayak@...eaurora.org>
To:     Matthias Kaehlcke <mka@...omium.org>
Cc:     viresh.kumar@...aro.org, sboyd@...nel.org,
        bjorn.andersson@...aro.org, agross@...nel.org,
        linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Stanimir Varbanov <stanimir.varbanov@...aro.org>,
        linux-media@...r.kernel.org
Subject: Re: [PATCH v3 12/17] media: venus: core: Add support for opp
 tables/perf voting


On 4/29/2020 6:09 AM, Matthias Kaehlcke wrote:
> On Tue, Apr 28, 2020 at 07:03:00PM +0530, Rajendra Nayak wrote:
>> Add support to add OPP tables and perf voting on the OPP powerdomain.
>> This is needed so venus votes on the corresponding performance state
>> for the OPP powerdomain along with setting the core clock rate.
>>
>> Signed-off-by: Rajendra Nayak <rnayak@...eaurora.org>
>> Cc: Stanimir Varbanov <stanimir.varbanov@...aro.org>
>> Cc: linux-media@...r.kernel.org
>> ---
>>   drivers/media/platform/qcom/venus/core.c       | 28 +++++++++++++++++++
>>   drivers/media/platform/qcom/venus/core.h       |  5 ++++
>>   drivers/media/platform/qcom/venus/pm_helpers.c | 37 +++++++++++++++++++++++---
>>   3 files changed, 66 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
>> index 194b10b9..e98fea92 100644
>> --- a/drivers/media/platform/qcom/venus/core.c
>> +++ b/drivers/media/platform/qcom/venus/core.c
>> @@ -12,6 +12,7 @@
>>   #include <linux/platform_device.h>
>>   #include <linux/slab.h>
>>   #include <linux/types.h>
>> +#include <linux/pm_opp.h>
>>   #include <linux/pm_runtime.h>
>>   #include <media/videobuf2-v4l2.h>
>>   #include <media/v4l2-mem2mem.h>
>> @@ -214,6 +215,20 @@ static int venus_probe(struct platform_device *pdev)
>>   	if (!core->pm_ops)
>>   		return -ENODEV;
>>   
>> +	core->opp_table = dev_pm_opp_set_clkname(dev, "core");
>> +	if (IS_ERR(core->opp_table))
>> +		return PTR_ERR(core->opp_table);
>> +
>> +	if (core->res->opp_pmdomain) {
>> +		ret = dev_pm_opp_of_add_table(dev);
>> +		if (!ret) {
>> +			core->has_opp_table = true;
>> +		} else if (ret != -ENODEV) {
>> +			dev_err(dev, "Invalid OPP table in Device tree\n");
>> +			return ret;
>> +		}
>> +	}
>> +
>>   	if (core->pm_ops->core_get) {
>>   		ret = core->pm_ops->core_get(dev);
>>   		if (ret)
>> @@ -301,6 +316,9 @@ static int venus_probe(struct platform_device *pdev)
>>   err_venus_shutdown:
>>   	venus_shutdown(core);
>>   err_runtime_disable:
>> +	if (core->res->opp_pmdomain && core->has_opp_table)
> 
> the check for 'core->res->opp_pmdomain' is not needed, 'core->has_opp_table'
> can only be true when 'core->res->opp_pmdomain' is not NULL.

ah, that's right, will fix. Thanks.

> 
>> +		dev_pm_opp_of_remove_table(dev);
>> +	dev_pm_opp_put_clkname(core->opp_table);
>>   	pm_runtime_set_suspended(dev);
>>   	pm_runtime_disable(dev);
>>   	hfi_destroy(core);
>> @@ -326,6 +344,10 @@ static int venus_remove(struct platform_device *pdev)
>>   
>>   	venus_firmware_deinit(core);
>>   
>> +	if (core->res->opp_pmdomain && core->has_opp_table)
> 
> ditto
> 

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ