Linux-PM Archive on
 help / color / Atom feed
From: Viresh Kumar <>
To: Amit Kucheria <>
Cc: Rafael Wysocki <>,
	Andy Gross <>,
	Bjorn Andersson <>,
	Linux PM list <>,
	Vincent Guittot <>,,
	linux-arm-msm <>,
	LKML <>
Subject: Re: [PATCH] cpufreq: cached_resolved_idx can not be negative
Date: Thu, 30 Jul 2020 12:11:12 +0530
Message-ID: <20200730064112.lvbwas7zzqruvprk@vireshk-mac-ubuntu> (raw)
In-Reply-To: <>

On 30-07-20, 12:02, Amit Kucheria wrote:
> Looking at this more closely, I found another call site for
> cpufreq_frequency_table_target() in cpufreq.c that needs the index to
> be unsigned int.
> But then cpufreq_frequency_table_target() returns -EINVAL, so we

It returns -EINVAL only in the case where the relation is not valid,
which will never happen. Maybe that should be marked with WARN or BUG
and we should drop return value of -EINVAL.

Rafael ?

> should be able to handle int values.

And so no.

> I think you will need to fix the unconditional assignment of
>     policy->cached_resolved_idx = idx
> in cpufreq_driver_resolve_freq(). It doesn't check for -EINVAL, so the
> qcom driver is write in checking for a negative value.

Right, I don't want it to have that check for the reason stated above.

The point is I don't want code that verifies cached-idx at all, it is


  reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-30  4:08 Viresh Kumar
2020-07-30  5:59 ` Amit Kucheria
2020-07-30  6:10   ` Viresh Kumar
2020-07-30  6:32     ` Amit Kucheria
2020-07-30  6:41       ` Viresh Kumar [this message]
2020-07-30 16:25         ` Rafael J. Wysocki

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200730064112.lvbwas7zzqruvprk@vireshk-mac-ubuntu \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-PM Archive on

Archives are clonable:
	git clone --mirror linux-pm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-pm linux-pm/ \
	public-inbox-index linux-pm

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone