From: Dan Carpenter <dan.carpenter@oracle.com>
To: kbuild@lists.01.org, Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Cc: intel-gfx@lists.freedesktop.org, kbuild-all@lists.01.org,
dri-devel@lists.freedesktop.org,
Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [Intel-gfx] [drm-intel:for-linux-next-gt 1/1] drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c:497 intel_guc_slpc_set_min_freq() warn: inconsistent returns '&slpc->lock'.
Date: Tue, 30 Aug 2022 17:13:26 +0300 [thread overview]
Message-ID: <202208301957.uLAOt2oy-lkp@intel.com> (raw)
tree: git://anongit.freedesktop.org/drm-intel for-linux-next-gt
head: f54e515c91806288126f64b37da0c78baa2d8c1f
commit: 95ccf312a1e4f5a1150dd1a0a2d81c1043e33fb6 [1/1] drm/i915/guc/slpc: Allow SLPC to use efficient frequency
config: i386-randconfig-m021-20220829 (https://download.01.org/0day-ci/archive/20220830/202208301957.uLAOt2oy-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-5) 11.3.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>
New smatch warnings:
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c:497 intel_guc_slpc_set_min_freq() warn: inconsistent returns '&slpc->lock'.
vim +497 drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 457 int intel_guc_slpc_set_min_freq(struct intel_guc_slpc *slpc, u32 val)
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 458 {
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 459 struct drm_i915_private *i915 = slpc_to_i915(slpc);
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 460 intel_wakeref_t wakeref;
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 461 int ret;
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 462
025cb07bebfaf9 Vinay Belgaumkar 2021-07-30 463 if (val < slpc->min_freq ||
025cb07bebfaf9 Vinay Belgaumkar 2021-07-30 464 val > slpc->rp0_freq ||
025cb07bebfaf9 Vinay Belgaumkar 2021-07-30 465 val > slpc->max_freq_softlimit)
025cb07bebfaf9 Vinay Belgaumkar 2021-07-30 466 return -EINVAL;
025cb07bebfaf9 Vinay Belgaumkar 2021-07-30 467
493043feed006f Vinay Belgaumkar 2021-11-01 468 /* Need a lock now since waitboost can be modifying min as well */
493043feed006f Vinay Belgaumkar 2021-11-01 469 mutex_lock(&slpc->lock);
493043feed006f Vinay Belgaumkar 2021-11-01 470
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 471 with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
493043feed006f Vinay Belgaumkar 2021-11-01 472
95ccf312a1e4f5 Vinay Belgaumkar 2022-08-19 473 /* Ignore efficient freq if lower min freq is requested */
95ccf312a1e4f5 Vinay Belgaumkar 2022-08-19 474 ret = slpc_set_param(slpc,
95ccf312a1e4f5 Vinay Belgaumkar 2022-08-19 475 SLPC_PARAM_IGNORE_EFFICIENT_FREQUENCY,
95ccf312a1e4f5 Vinay Belgaumkar 2022-08-19 476 val < slpc->rp1_freq);
95ccf312a1e4f5 Vinay Belgaumkar 2022-08-19 477 if (unlikely(ret)) {
95ccf312a1e4f5 Vinay Belgaumkar 2022-08-19 478 i915_probe_error(i915, "Failed to toggle efficient freq (%pe)\n",
95ccf312a1e4f5 Vinay Belgaumkar 2022-08-19 479 ERR_PTR(ret));
95ccf312a1e4f5 Vinay Belgaumkar 2022-08-19 480 return ret;
mutex_unlock(&slpc->lock); before returning
95ccf312a1e4f5 Vinay Belgaumkar 2022-08-19 481 }
95ccf312a1e4f5 Vinay Belgaumkar 2022-08-19 482
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 483 ret = slpc_set_param(slpc,
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 484 SLPC_PARAM_GLOBAL_MIN_GT_UNSLICE_FREQ_MHZ,
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 485 val);
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 486
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 487 /* Return standardized err code for sysfs calls */
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 488 if (ret)
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 489 ret = -EIO;
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 490 }
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 491
025cb07bebfaf9 Vinay Belgaumkar 2021-07-30 492 if (!ret)
025cb07bebfaf9 Vinay Belgaumkar 2021-07-30 493 slpc->min_freq_softlimit = val;
025cb07bebfaf9 Vinay Belgaumkar 2021-07-30 494
493043feed006f Vinay Belgaumkar 2021-11-01 495 mutex_unlock(&slpc->lock);
493043feed006f Vinay Belgaumkar 2021-11-01 496
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 @497 return ret;
d41f6f82d319ca Vinay Belgaumkar 2021-07-30 498 }
--
0-DAY CI Kernel Test Service
https://01.org/lkp
reply other threads:[~2022-08-30 14:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=202208301957.uLAOt2oy-lkp@intel.com \
--to=dan.carpenter@oracle.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=rodrigo.vivi@intel.com \
--cc=vinay.belgaumkar@intel.com \
/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