mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: lkp@intel.com, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>
Subject: drivers/cpufreq/qcom-cpufreq-hw.c:333 qcom_lmh_dcvs_notify() error: uninitialized symbol 'throttled_freq'.
Date: Mon, 19 Sep 2022 11:50:11 +0300	[thread overview]
Message-ID: <202209181024.rhoJMAL1-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a335366bad1364a07f49df9da1fdfa6d411a5f39
commit: 6240aaad75e1a623872a830d13393d7aabf1052c cpufreq: qcom-hw: fix the opp entries refcounting
config: arm-randconfig-m041-20220918 (https://download.01.org/0day-ci/archive/20220918/202209181024.rhoJMAL1-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/cpufreq/qcom-cpufreq-hw.c:333 qcom_lmh_dcvs_notify() error: uninitialized symbol 'throttled_freq'.

vim +/throttled_freq +333 drivers/cpufreq/qcom-cpufreq-hw.c

275157b367f479 Thara Gopinath   2021-08-09  290  static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data)
275157b367f479 Thara Gopinath   2021-08-09  291  {
275157b367f479 Thara Gopinath   2021-08-09  292  	struct cpufreq_policy *policy = data->policy;
5e4f009da6be56 Dmitry Baryshkov 2022-03-26  293  	int cpu = cpumask_first(policy->related_cpus);
275157b367f479 Thara Gopinath   2021-08-09  294  	struct device *dev = get_cpu_device(cpu);
0258cb19c77deb Lukasz Luba      2021-11-09  295  	unsigned long freq_hz, throttled_freq;
275157b367f479 Thara Gopinath   2021-08-09  296  	struct dev_pm_opp *opp;
275157b367f479 Thara Gopinath   2021-08-09  297  	unsigned int freq;
275157b367f479 Thara Gopinath   2021-08-09  298  
275157b367f479 Thara Gopinath   2021-08-09  299  	/*
275157b367f479 Thara Gopinath   2021-08-09  300  	 * Get the h/w throttled frequency, normalize it using the
275157b367f479 Thara Gopinath   2021-08-09  301  	 * registered opp table and use it to calculate thermal pressure.
275157b367f479 Thara Gopinath   2021-08-09  302  	 */
275157b367f479 Thara Gopinath   2021-08-09  303  	freq = qcom_lmh_get_throttle_freq(data);
275157b367f479 Thara Gopinath   2021-08-09  304  	freq_hz = freq * HZ_PER_KHZ;
275157b367f479 Thara Gopinath   2021-08-09  305  
275157b367f479 Thara Gopinath   2021-08-09  306  	opp = dev_pm_opp_find_freq_floor(dev, &freq_hz);
275157b367f479 Thara Gopinath   2021-08-09  307  	if (IS_ERR(opp) && PTR_ERR(opp) == -ERANGE)
6240aaad75e1a6 Dmitry Baryshkov 2022-03-26  308  		opp = dev_pm_opp_find_freq_ceil(dev, &freq_hz);
275157b367f479 Thara Gopinath   2021-08-09  309  
6240aaad75e1a6 Dmitry Baryshkov 2022-03-26  310  	if (IS_ERR(opp)) {
6240aaad75e1a6 Dmitry Baryshkov 2022-03-26  311  		dev_warn(dev, "Can't find the OPP for throttling: %pe!\n", opp);

throttled_freq not set on this path.  Just return?

6240aaad75e1a6 Dmitry Baryshkov 2022-03-26  312  	} else {
275157b367f479 Thara Gopinath   2021-08-09  313  		throttled_freq = freq_hz / HZ_PER_KHZ;
275157b367f479 Thara Gopinath   2021-08-09  314  
0258cb19c77deb Lukasz Luba      2021-11-09  315  		/* Update thermal pressure (the boost frequencies are accepted) */
0258cb19c77deb Lukasz Luba      2021-11-09  316  		arch_update_thermal_pressure(policy->related_cpus, throttled_freq);
275157b367f479 Thara Gopinath   2021-08-09  317  
6240aaad75e1a6 Dmitry Baryshkov 2022-03-26  318  		dev_pm_opp_put(opp);
6240aaad75e1a6 Dmitry Baryshkov 2022-03-26  319  	}
6240aaad75e1a6 Dmitry Baryshkov 2022-03-26  320  
275157b367f479 Thara Gopinath   2021-08-09  321  	/*
275157b367f479 Thara Gopinath   2021-08-09  322  	 * In the unlikely case policy is unregistered do not enable
275157b367f479 Thara Gopinath   2021-08-09  323  	 * polling or h/w interrupt
275157b367f479 Thara Gopinath   2021-08-09  324  	 */
275157b367f479 Thara Gopinath   2021-08-09  325  	mutex_lock(&data->throttle_lock);
275157b367f479 Thara Gopinath   2021-08-09  326  	if (data->cancel_throttle)
275157b367f479 Thara Gopinath   2021-08-09  327  		goto out;
275157b367f479 Thara Gopinath   2021-08-09  328  
275157b367f479 Thara Gopinath   2021-08-09  329  	/*
275157b367f479 Thara Gopinath   2021-08-09  330  	 * If h/w throttled frequency is higher than what cpufreq has requested
275157b367f479 Thara Gopinath   2021-08-09  331  	 * for, then stop polling and switch back to interrupt mechanism.
275157b367f479 Thara Gopinath   2021-08-09  332  	 */
275157b367f479 Thara Gopinath   2021-08-09 @333  	if (throttled_freq >= qcom_cpufreq_hw_get(cpu))


Uninitialized.

275157b367f479 Thara Gopinath   2021-08-09  334  		enable_irq(data->throttle_irq);
275157b367f479 Thara Gopinath   2021-08-09  335  	else
275157b367f479 Thara Gopinath   2021-08-09  336  		mod_delayed_work(system_highpri_wq, &data->throttle_work,
275157b367f479 Thara Gopinath   2021-08-09  337  				 msecs_to_jiffies(10));
275157b367f479 Thara Gopinath   2021-08-09  338  
275157b367f479 Thara Gopinath   2021-08-09  339  out:
275157b367f479 Thara Gopinath   2021-08-09  340  	mutex_unlock(&data->throttle_lock);
275157b367f479 Thara Gopinath   2021-08-09  341  }

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp


             reply	other threads:[~2022-09-19  8:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19  8:50 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-06-06 11:13 Dan Carpenter

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=202209181024.rhoJMAL1-lkp@intel.com \
    --to=dan.carpenter@oracle.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=kbuild-all@lists.01.org \
    --cc=kbuild@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=viresh.kumar@linaro.org \
    --cc=vladimir.zapolskiy@linaro.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

Powered by JetHome