public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Primoz Fiser <primoz.fiser@norik.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Viresh Kumar <vireshk@kernel.org>, Nishanth Menon <nm@ti.com>,
	Stephen Boyd <sboyd@kernel.org>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	upstream@lists.phytec.de
Subject: Re: [PATCH] OPP: ti: Fix ti_opp_supply_probe wrong return values
Date: Thu, 6 Jun 2024 11:43:10 +0200	[thread overview]
Message-ID: <ed06bac9-6396-426a-b0ea-4932bc5fa7ed@norik.com> (raw)
In-Reply-To: <20240606085956.wsp3ecyfqck5tltt@vireshk-i7>

Hi Viresh,

On 6. 06. 24 10:59, Viresh Kumar wrote:
> On 06-06-24, 09:01, Primoz Fiser wrote:
>> Function ti_opp_supply_probe() since commit 6baee034cb55 ("OPP: ti:
>> Migrate to dev_pm_opp_set_config_regulators()") returns wrong values
>> when all goes well and hence driver probing eventually fails.
>>
>> Fixes: 6baee034cb55 ("OPP: ti: Migrate to dev_pm_opp_set_config_regulators()")
>> Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
>> ---
>>  drivers/opp/ti-opp-supply.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/opp/ti-opp-supply.c b/drivers/opp/ti-opp-supply.c
>> index e3b97cd1fbbf..ec0056a4bb13 100644
>> --- a/drivers/opp/ti-opp-supply.c
>> +++ b/drivers/opp/ti-opp-supply.c
>> @@ -393,10 +393,12 @@ static int ti_opp_supply_probe(struct platform_device *pdev)
>>  	}
>>  
>>  	ret = dev_pm_opp_set_config_regulators(cpu_dev, ti_opp_config_regulators);
>> -	if (ret < 0)
>> +	if (ret < 0) {
>>  		_free_optimized_voltages(dev, &opp_data);
>> +		return ret;
>> +	}
>>  
>> -	return ret;
>> +	return 0;
>>  }
>>  
>>  static struct platform_driver ti_opp_supply_driver = {
> 
> Not sure I understand the problem here. Can you please explain with an
> example ?

ti_opp_supply_probe
 -> dev_pm_opp_set_config_regulators
  -> dev_pm_opp_set_config (returns negative if error, otherwise >= 1)

Lets assume dev_pm_opp_set_config returns 1 (SUCCESS):

so now, without my patch:
ti_opp_supply_probe returns 1 -> FAILURE and hence error:

ti_opp_supply 4a003b20.opp-supply: probe with driver ti_opp_supply
failed with error 1

with my patch:
ti_opp_supply_probe returns 0 -> SUCCESS

BR,
Primoz


  reply	other threads:[~2024-06-06  9:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06  7:01 [PATCH] OPP: ti: Fix ti_opp_supply_probe wrong return values Primoz Fiser
2024-06-06  8:59 ` Viresh Kumar
2024-06-06  9:43   ` Primoz Fiser [this message]
2024-06-06  9:48     ` Viresh Kumar
2024-06-06 10:34       ` Primoz Fiser
2024-06-06 10:58         ` Viresh Kumar
2024-06-06 11:35           ` Primoz Fiser
2024-06-11  5:29 ` Viresh Kumar

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=ed06bac9-6396-426a-b0ea-4932bc5fa7ed@norik.com \
    --to=primoz.fiser@norik.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=sboyd@kernel.org \
    --cc=upstream@lists.phytec.de \
    --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