From: Rajendra Nayak <rnayak@codeaurora.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: vireshk@kernel.org, sboyd@kernel.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 2/2] opp: Manage empty OPP tables with clk handle
Date: Wed, 3 Jul 2019 16:17:15 +0530 [thread overview]
Message-ID: <c8e42b38-8ce0-c02c-98d3-6d6598dc3fad@codeaurora.org> (raw)
In-Reply-To: <20190703094746.l354nwp2gwuwhiu4@vireshk-i7>
On 7/3/2019 3:17 PM, Viresh Kumar wrote:
> On 03-07-19, 14:41, Rajendra Nayak wrote:
>> []..
>>>
>>> Explain the rationale behind this code here in a comment.
>>>
>>>> + if (!_get_opp_count(opp_table)) {
>>>> + ret = _generic_set_opp_clk_only(dev, clk, freq);
>>>> + goto put_opp_table;
>>>> + }
>>>> +
>>>> temp_freq = old_freq;
>>>> old_opp = _find_freq_ceil(opp_table, &temp_freq);
>>>> if (IS_ERR(old_opp)) {
>>>
>>> Also, rebase over the OPP branch please:
>>
>> thanks, I will fix/rebase and repost,
>> in the meantime while I was testing this a little more I realized I also need
>> something like the change below to avoid a refcount mismatch WARN when empty OPP
>> table is removed using dev_pm_opp_of_remove_table()
>>
>> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
>> index fa7d4d6d37b3..20128a88baf2 100644
>> --- a/drivers/opp/core.c
>> +++ b/drivers/opp/core.c
>> @@ -2118,7 +2118,8 @@ void _dev_pm_opp_find_and_remove_table(struct device *dev)
>> return;
>> }
>> - _put_opp_list_kref(opp_table);
>> + if (_get_opp_count(opp_table))
>> + _put_opp_list_kref(opp_table);
>> /* Drop reference taken by _find_opp_table() */
>> dev_pm_opp_put_opp_table(opp_table);
>>
>> Does this look like a good way to fix it?
>
> No. If an OPP table only has dynamic OPPs, this will still generate
> warning. Below is the fix I would suggest. Please test it, I haven't
> tested it at all :)
thanks, yes, this seems to work.
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
prev parent reply other threads:[~2019-07-03 10:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-02 4:36 [PATCH 1/2] opp: Export dev_pm_opp_set_genpd_virt_dev() Rajendra Nayak
2019-07-02 4:36 ` [PATCH 2/2] opp: Manage empty OPP tables with clk handle Rajendra Nayak
2019-07-03 8:50 ` Viresh Kumar
2019-07-03 9:11 ` Rajendra Nayak
2019-07-03 9:47 ` Viresh Kumar
2019-07-03 10:47 ` Rajendra Nayak [this message]
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=c8e42b38-8ce0-c02c-98d3-6d6598dc3fad@codeaurora.org \
--to=rnayak@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sboyd@kernel.org \
--cc=viresh.kumar@linaro.org \
--cc=vireshk@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).