[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d8599b11-66dd-486b-89e4-52b82d90f04e@samsung.com>
Date: Tue, 26 Aug 2025 09:26:07 +0200
From: Marek Szyprowski <m.szyprowski@...sung.com>
To: Viresh Kumar <viresh.kumar@...aro.org>
Cc: Krishna Chaitanya Chundru <krishna.chundru@....qualcomm.com>, Viresh
Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>, Stephen Boyd
<sboyd@...nel.org>, "Rafael J. Wysocki" <rafael@...nel.org>, Manivannan
Sadhasivam <mani@...nel.org>, Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof Wilczyński <kwilczynski@...nel.org>, Rob Herring
<robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>, Bjorn Andersson
<andersson@...nel.org>, Konrad Dybcio <konradybcio@...nel.org>, Krzysztof
Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-pci@...r.kernel.org, linux-arm-msm@...r.kernel.org,
devicetree@...r.kernel.org
Subject: Re: [PATCH v4 2/7] OPP: Move refcount and key update for
readability in _opp_table_find_key()
On 26.08.2025 08:06, Viresh Kumar wrote:
> Marek,
>
> Thanks for the detailed logs. I would need a little more help from
> you.
>
> Can you give this a try over your failing branch (I have already
> dropped the patch from my tree for now):
>
> diff --git a/drivers/opp/core.c b/drivers/opp/core.c
> index 81fb7dd7f323..5b24255733b5 100644
> --- a/drivers/opp/core.c
> +++ b/drivers/opp/core.c
> @@ -554,10 +554,10 @@ static struct dev_pm_opp *_opp_table_find_key(struct opp_table *opp_table,
> list_for_each_entry(temp_opp, &opp_table->opp_list, node) {
> if (temp_opp->available == available) {
> if (compare(&opp, temp_opp, read(temp_opp, index), *key)) {
> - *key = read(opp, index);
> -
> - /* Increment the reference count of OPP */
> - dev_pm_opp_get(opp);
> + if (!IS_ERR(opp)) {
> + *key = read(opp, index);
> + dev_pm_opp_get(opp);
> + }
> break;
> }
> }
This doesn't help. I've stared a bit at that code and did some tests
and it looks that the issue is caused by _opp_table_find_key() returning
the last opp from opp_list without updating the *key and calling
opp_get() for it (happens when compare() returns false).
> ...
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
Powered by blists - more mailing lists