From: kernel test robot <lkp@intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
linux-acpi@vger.kernel.org, devel@acpica.org,
linux-pm@vger.kernel.org
Subject: [rafael-pm:intel_pstate-testing 4/14] drivers/cpufreq/intel_pstate.c:1655:25: warning: variable 'cpudata' is uninitialized when used here
Date: Thu, 28 Mar 2024 20:00:40 +0800 [thread overview]
Message-ID: <202403281955.LhZVDhXg-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git intel_pstate-testing
head: 16303764deedb814defe7e69712edec6a09b50ad
commit: ac9f58c46515ad482d972d5a65c127241c4751b9 [4/14] cpufreq: intel_pstate: Get rid of unnecessary READ_ONCE() annotations
config: x86_64-rhel-8.3-bpf (https://download.01.org/0day-ci/archive/20240328/202403281955.LhZVDhXg-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240328/202403281955.LhZVDhXg-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403281955.LhZVDhXg-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> drivers/cpufreq/intel_pstate.c:1655:25: warning: variable 'cpudata' is uninitialized when used here [-Wuninitialized]
1655 | schedule_delayed_work(&cpudata->hwp_notify_work, msecs_to_jiffies(10));
| ^~~~~~~
drivers/cpufreq/intel_pstate.c:1639:25: note: initialize the variable 'cpudata' to silence this warning
1639 | struct cpudata *cpudata;
| ^
| = NULL
1 warning generated.
vim +/cpudata +1655 drivers/cpufreq/intel_pstate.c
57577c996d731c Srinivas Pandruvada 2021-09-28 1635
57577c996d731c Srinivas Pandruvada 2021-09-28 1636 void notify_hwp_interrupt(void)
57577c996d731c Srinivas Pandruvada 2021-09-28 1637 {
57577c996d731c Srinivas Pandruvada 2021-09-28 1638 unsigned int this_cpu = smp_processor_id();
57577c996d731c Srinivas Pandruvada 2021-09-28 1639 struct cpudata *cpudata;
57577c996d731c Srinivas Pandruvada 2021-09-28 1640 unsigned long flags;
57577c996d731c Srinivas Pandruvada 2021-09-28 1641 u64 value;
57577c996d731c Srinivas Pandruvada 2021-09-28 1642
ac9f58c46515ad Rafael J. Wysocki 2024-03-25 1643 if (!hwp_active || !boot_cpu_has(X86_FEATURE_HWP_NOTIFY))
57577c996d731c Srinivas Pandruvada 2021-09-28 1644 return;
57577c996d731c Srinivas Pandruvada 2021-09-28 1645
57577c996d731c Srinivas Pandruvada 2021-09-28 1646 rdmsrl_safe(MSR_HWP_STATUS, &value);
57577c996d731c Srinivas Pandruvada 2021-09-28 1647 if (!(value & 0x01))
57577c996d731c Srinivas Pandruvada 2021-09-28 1648 return;
57577c996d731c Srinivas Pandruvada 2021-09-28 1649
57577c996d731c Srinivas Pandruvada 2021-09-28 1650 spin_lock_irqsave(&hwp_notify_lock, flags);
57577c996d731c Srinivas Pandruvada 2021-09-28 1651
57577c996d731c Srinivas Pandruvada 2021-09-28 1652 if (!cpumask_test_cpu(this_cpu, &hwp_intr_enable_mask))
57577c996d731c Srinivas Pandruvada 2021-09-28 1653 goto ack_intr;
57577c996d731c Srinivas Pandruvada 2021-09-28 1654
57577c996d731c Srinivas Pandruvada 2021-09-28 @1655 schedule_delayed_work(&cpudata->hwp_notify_work, msecs_to_jiffies(10));
57577c996d731c Srinivas Pandruvada 2021-09-28 1656
57577c996d731c Srinivas Pandruvada 2021-09-28 1657 spin_unlock_irqrestore(&hwp_notify_lock, flags);
57577c996d731c Srinivas Pandruvada 2021-09-28 1658
57577c996d731c Srinivas Pandruvada 2021-09-28 1659 return;
57577c996d731c Srinivas Pandruvada 2021-09-28 1660
57577c996d731c Srinivas Pandruvada 2021-09-28 1661 ack_intr:
57577c996d731c Srinivas Pandruvada 2021-09-28 1662 wrmsrl_safe(MSR_HWP_STATUS, 0);
57577c996d731c Srinivas Pandruvada 2021-09-28 1663 spin_unlock_irqrestore(&hwp_notify_lock, flags);
57577c996d731c Srinivas Pandruvada 2021-09-28 1664 }
57577c996d731c Srinivas Pandruvada 2021-09-28 1665
:::::: The code at line 1655 was first introduced by commit
:::::: 57577c996d731ce1e5a4a488e64e6e201b360847 cpufreq: intel_pstate: Process HWP Guaranteed change notification
:::::: TO: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
:::::: CC: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2024-03-28 12:01 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=202403281955.LhZVDhXg-lkp@intel.com \
--to=lkp@intel.com \
--cc=devel@acpica.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=rjw@rjwysocki.net \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).