mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: oe-kbuild@lists.linux.dev, James Morse <james.morse@arm.com>
Cc: lkp@intel.com, oe-kbuild-all@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	Catalin Marinas <catalin.marinas@arm.com>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Gavin Shan <gshan@redhat.com>,
	Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>,
	Fenghua Yu <fenghuay@nvidia.com>, Ben Horgan <ben.horgan@arm.com>
Subject: drivers/resctrl/mpam_devices.c:1042 __ris_msmon_read() error: uninitialized symbol 'now'.
Date: Tue, 9 Dec 2025 11:00:14 +0300	[thread overview]
Message-ID: <202512091519.RBwiJcSq-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   cfd4039213e7b5a828c5b78e1b5235cac91af53d
commit: 823e7c3712c584641b4ef890a8af34884c677197 arm_mpam: Add mpam_msmon_read() to read monitor value
config: arm64-randconfig-r072-20251208 (https://download.01.org/0day-ci/archive/20251209/202512091519.RBwiJcSq-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project a805147ac1ba123916de182babb0831fbb148756)

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>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202512091519.RBwiJcSq-lkp@intel.com/

smatch warnings:
drivers/resctrl/mpam_devices.c:1042 __ris_msmon_read() error: uninitialized symbol 'now'.

vim +/now +1042 drivers/resctrl/mpam_devices.c

823e7c3712c5846 James Morse 2025-11-19   988  static void __ris_msmon_read(void *arg)
823e7c3712c5846 James Morse 2025-11-19   989  {
823e7c3712c5846 James Morse 2025-11-19   990  	u64 now;
823e7c3712c5846 James Morse 2025-11-19   991  	bool nrdy = false;
823e7c3712c5846 James Morse 2025-11-19   992  	bool config_mismatch;
823e7c3712c5846 James Morse 2025-11-19   993  	struct mon_read *m = arg;
823e7c3712c5846 James Morse 2025-11-19   994  	struct mon_cfg *ctx = m->ctx;
823e7c3712c5846 James Morse 2025-11-19   995  	struct mpam_msc_ris *ris = m->ris;
823e7c3712c5846 James Morse 2025-11-19   996  	struct mpam_props *rprops = &ris->props;
823e7c3712c5846 James Morse 2025-11-19   997  	struct mpam_msc *msc = m->ris->vmsc->msc;
823e7c3712c5846 James Morse 2025-11-19   998  	u32 mon_sel, ctl_val, flt_val, cur_ctl, cur_flt;
823e7c3712c5846 James Morse 2025-11-19   999  
823e7c3712c5846 James Morse 2025-11-19  1000  	if (!mpam_mon_sel_lock(msc)) {
823e7c3712c5846 James Morse 2025-11-19  1001  		m->err = -EIO;
823e7c3712c5846 James Morse 2025-11-19  1002  		return;
823e7c3712c5846 James Morse 2025-11-19  1003  	}
823e7c3712c5846 James Morse 2025-11-19  1004  	mon_sel = FIELD_PREP(MSMON_CFG_MON_SEL_MON_SEL, ctx->mon) |
823e7c3712c5846 James Morse 2025-11-19  1005  		  FIELD_PREP(MSMON_CFG_MON_SEL_RIS, ris->ris_idx);
823e7c3712c5846 James Morse 2025-11-19  1006  	mpam_write_monsel_reg(msc, CFG_MON_SEL, mon_sel);
823e7c3712c5846 James Morse 2025-11-19  1007  
823e7c3712c5846 James Morse 2025-11-19  1008  	/*
823e7c3712c5846 James Morse 2025-11-19  1009  	 * Read the existing configuration to avoid re-writing the same values.
823e7c3712c5846 James Morse 2025-11-19  1010  	 * This saves waiting for 'nrdy' on subsequent reads.
823e7c3712c5846 James Morse 2025-11-19  1011  	 */
823e7c3712c5846 James Morse 2025-11-19  1012  	read_msmon_ctl_flt_vals(m, &cur_ctl, &cur_flt);
823e7c3712c5846 James Morse 2025-11-19  1013  	clean_msmon_ctl_val(&cur_ctl);
823e7c3712c5846 James Morse 2025-11-19  1014  	gen_msmon_ctl_flt_vals(m, &ctl_val, &flt_val);
823e7c3712c5846 James Morse 2025-11-19  1015  	config_mismatch = cur_flt != flt_val ||
823e7c3712c5846 James Morse 2025-11-19  1016  			  cur_ctl != (ctl_val | MSMON_CFG_x_CTL_EN);
823e7c3712c5846 James Morse 2025-11-19  1017  
823e7c3712c5846 James Morse 2025-11-19  1018  	if (config_mismatch)
823e7c3712c5846 James Morse 2025-11-19  1019  		write_msmon_ctl_flt_vals(m, ctl_val, flt_val);
823e7c3712c5846 James Morse 2025-11-19  1020  
823e7c3712c5846 James Morse 2025-11-19  1021  	switch (m->type) {
823e7c3712c5846 James Morse 2025-11-19  1022  	case mpam_feat_msmon_csu:
823e7c3712c5846 James Morse 2025-11-19  1023  		now = mpam_read_monsel_reg(msc, CSU);
823e7c3712c5846 James Morse 2025-11-19  1024  		if (mpam_has_feature(mpam_feat_msmon_csu_hw_nrdy, rprops))
823e7c3712c5846 James Morse 2025-11-19  1025  			nrdy = now & MSMON___NRDY;
823e7c3712c5846 James Morse 2025-11-19  1026  		break;
823e7c3712c5846 James Morse 2025-11-19  1027  	case mpam_feat_msmon_mbwu:
823e7c3712c5846 James Morse 2025-11-19  1028  		now = mpam_read_monsel_reg(msc, MBWU);
823e7c3712c5846 James Morse 2025-11-19  1029  		if (mpam_has_feature(mpam_feat_msmon_mbwu_hw_nrdy, rprops))
823e7c3712c5846 James Morse 2025-11-19  1030  			nrdy = now & MSMON___NRDY;
823e7c3712c5846 James Morse 2025-11-19  1031  		break;
823e7c3712c5846 James Morse 2025-11-19  1032  	default:
823e7c3712c5846 James Morse 2025-11-19  1033  		m->err = -EINVAL;

now isn't initialized on this path.

823e7c3712c5846 James Morse 2025-11-19  1034  	}
823e7c3712c5846 James Morse 2025-11-19  1035  	mpam_mon_sel_unlock(msc);
823e7c3712c5846 James Morse 2025-11-19  1036  
823e7c3712c5846 James Morse 2025-11-19  1037  	if (nrdy) {
823e7c3712c5846 James Morse 2025-11-19  1038  		m->err = -EBUSY;
823e7c3712c5846 James Morse 2025-11-19  1039  		return;
823e7c3712c5846 James Morse 2025-11-19  1040  	}
823e7c3712c5846 James Morse 2025-11-19  1041  
823e7c3712c5846 James Morse 2025-11-19 @1042  	now = FIELD_GET(MSMON___VALUE, now);
823e7c3712c5846 James Morse 2025-11-19  1043  	*m->val += now;
823e7c3712c5846 James Morse 2025-11-19  1044  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


                 reply	other threads:[~2025-12-09  8:00 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=202512091519.RBwiJcSq-lkp@intel.com \
    --to=dan.carpenter@linaro.org \
    --cc=ben.horgan@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=fenghuay@nvidia.com \
    --cc=gshan@redhat.com \
    --cc=james.morse@arm.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=oe-kbuild@lists.linux.dev \
    --cc=tan.shaopeng@jp.fujitsu.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

all inboxes | Powered by JetHome®