X86 platform drivers
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Derek J. Clark" <derekjohn.clark@gmail.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Hans de Goede" <hansg@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	Mark Pearson <mpearson-lenovo@squebb.ca>,
	Armin Wolf <W_Armin@gmx.de>, Jonathan Corbet <corbet@lwn.net>,
	Rong Zhang <i@rong.moe>, Kurt Borja <kuurtb@gmail.com>,
	"Derek J . Clark" <derekjohn.clark@gmail.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] platform/x86: lenovo-wmi-other: Add GPU tunable attributes
Date: Sat, 14 Feb 2026 03:26:22 +0800	[thread overview]
Message-ID: <202602140321.pfFQKWKX-lkp@intel.com> (raw)
In-Reply-To: <20260213081243.794288-5-derekjohn.clark@gmail.com>

Hi Derek,

kernel test robot noticed the following build warnings:

[auto build test WARNING on next-20260212]
[cannot apply to linus/master v6.19 v6.19-rc8 v6.19-rc7 v6.19]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Derek-J-Clark/platform-x86-lenovo-wmi-other-Add-LWMI_ATTR_ID-Macro/20260213-161603
base:   next-20260212
patch link:    https://lore.kernel.org/r/20260213081243.794288-5-derekjohn.clark%40gmail.com
patch subject: [PATCH 4/5] platform/x86: lenovo-wmi-other: Add GPU tunable attributes
config: x86_64-randconfig-011-20260214 (https://download.01.org/0day-ci/archive/20260214/202602140321.pfFQKWKX-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260214/202602140321.pfFQKWKX-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/202602140321.pfFQKWKX-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/platform/x86/lenovo/wmi-other.c:1202:1: warning: unused variable 'gpu_mode_attr_group' [-Wunused-const-variable]
    1202 | LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_mode, "gpu_mode",
         | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1203 |                               "Set the GPU mode by power limit");
         |                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/lenovo/wmi-other.c:1155:38: note: expanded from macro 'LWMI_ATTR_GROUP_TUNABLE_CAP01'
    1155 |         static const struct attribute_group _attrname##_attr_group = {    \
         |                                             ^~~~~~~~~~~~~~~~~~~~~~
   <scratch space>:155:1: note: expanded from here
     155 | gpu_mode_attr_group
         | ^~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +/gpu_mode_attr_group +1202 drivers/platform/x86/lenovo/wmi-other.c

  1081	
  1082	/* Lenovo WMI Other Mode Attribute macros */
  1083	#define __LWMI_ATTR_RO(_func, _name)                                  \
  1084		{                                                             \
  1085			.attr = { .name = __stringify(_name), .mode = 0444 }, \
  1086			.show = _func##_##_name##_show,                       \
  1087		}
  1088	
  1089	#define __LWMI_ATTR_RO_AS(_name, _show)                               \
  1090		{                                                             \
  1091			.attr = { .name = __stringify(_name), .mode = 0444 }, \
  1092			.show = _show,                                        \
  1093		}
  1094	
  1095	#define __LWMI_ATTR_RW(_func, _name) \
  1096		__ATTR(_name, 0644, _func##_##_name##_show, _func##_##_name##_store)
  1097	
  1098	/* Shows a formatted static variable */
  1099	#define __LWMI_ATTR_SHOW_FMT(_prop, _attrname, _fmt, _val)                     \
  1100		static ssize_t _attrname##_##_prop##_show(                             \
  1101			struct kobject *kobj, struct kobj_attribute *kattr, char *buf) \
  1102		{                                                                      \
  1103			return sysfs_emit(buf, _fmt, _val);                            \
  1104		}                                                                      \
  1105		static struct kobj_attribute attr_##_attrname##_##_prop =              \
  1106			__LWMI_ATTR_RO(_attrname, _prop)
  1107	
  1108	/* Attribute current value read/write */
  1109	#define __LWMI_TUNABLE_CURRENT_VALUE_CAP01(_attrname)                          \
  1110		static ssize_t _attrname##_current_value_store(                        \
  1111			struct kobject *kobj, struct kobj_attribute *kattr,            \
  1112			const char *buf, size_t count)                                 \
  1113		{                                                                      \
  1114			return attr_current_value_store(kobj, kattr, buf, count,       \
  1115							&_attrname);                   \
  1116		}                                                                      \
  1117		static ssize_t _attrname##_current_value_show(                         \
  1118			struct kobject *kobj, struct kobj_attribute *kattr, char *buf) \
  1119		{                                                                      \
  1120			return attr_current_value_show(kobj, kattr, buf, &_attrname);  \
  1121		}                                                                      \
  1122		static struct kobj_attribute attr_##_attrname##_current_value =        \
  1123			__LWMI_ATTR_RW(_attrname, current_value)
  1124	
  1125	/* Attribute property read only */
  1126	#define __LWMI_TUNABLE_RO_CAP01(_prop, _attrname, _prop_type)                  \
  1127		static ssize_t _attrname##_##_prop##_show(                             \
  1128			struct kobject *kobj, struct kobj_attribute *kattr, char *buf) \
  1129		{                                                                      \
  1130			return attr_capdata01_show(kobj, kattr, buf, &_attrname,       \
  1131						   _prop_type);                        \
  1132		}                                                                      \
  1133		static struct kobj_attribute attr_##_attrname##_##_prop =              \
  1134			__LWMI_ATTR_RO(_attrname, _prop)
  1135	
  1136	#define LWMI_ATTR_GROUP_TUNABLE_CAP01(_attrname, _fsname, _dispname)      \
  1137		__LWMI_TUNABLE_CURRENT_VALUE_CAP01(_attrname);                    \
  1138		__LWMI_TUNABLE_RO_CAP01(default_value, _attrname, DEFAULT_VAL);   \
  1139		__LWMI_ATTR_SHOW_FMT(display_name, _attrname, "%s\n", _dispname); \
  1140		__LWMI_TUNABLE_RO_CAP01(max_value, _attrname, MAX_VAL);           \
  1141		__LWMI_TUNABLE_RO_CAP01(min_value, _attrname, MIN_VAL);           \
  1142		__LWMI_TUNABLE_RO_CAP01(scalar_increment, _attrname, STEP_VAL);   \
  1143		static struct kobj_attribute attr_##_attrname##_type =            \
  1144			__LWMI_ATTR_RO_AS(type, int_type_show);                   \
  1145		static struct attribute *_attrname##_attrs[] = {                  \
  1146			&attr_##_attrname##_current_value.attr,                   \
  1147			&attr_##_attrname##_default_value.attr,                   \
  1148			&attr_##_attrname##_display_name.attr,                    \
  1149			&attr_##_attrname##_max_value.attr,                       \
  1150			&attr_##_attrname##_min_value.attr,                       \
  1151			&attr_##_attrname##_scalar_increment.attr,                \
  1152			&attr_##_attrname##_type.attr,                            \
  1153			NULL,                                                     \
  1154		};                                                                \
  1155		static const struct attribute_group _attrname##_attr_group = {    \
  1156			.name = _fsname, .attrs = _attrname##_attrs               \
  1157		}
  1158	
  1159	/* CPU tunable attributes */
  1160	LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_pl1_spl, "ppt_pl1_spl",
  1161				      "Set the CPU sustained power limit");
  1162	LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_pl1_spl_cl, "ppt_pl1_spl_cl",
  1163				      "Set the CPU cross loading sustained power limit");
  1164	LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_pl2_sppt, "ppt_pl2_sppt",
  1165				      "Set the CPU slow package power tracking limit");
  1166	LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_pl2_sppt_cl, "ppt_pl2_sppt_cl",
  1167				      "Set the CPU cross loading slow package power tracking limit");
  1168	LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_pl3_fppt, "ppt_pl3_fppt",
  1169				      "Set the CPU fast package power tracking limit");
  1170	LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_pl3_fppt_cl, "ppt_pl3_fppt_cl",
  1171				      "Set the CPU cross loading fast package power tracking limit");
  1172	LWMI_ATTR_GROUP_TUNABLE_CAP01(cpu_temp, "cpu_temp",
  1173				      "Set the CPU thermal load limit");
  1174	LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_pl1_apu_spl, "ppt_pl1_apu_spl",
  1175				      "Set the APU sustained power limit");
  1176	LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_cpu_cl, "ppt_cpu_cl",
  1177				      "Set the CPU cross loading power limit");
  1178	LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_pl1_tau, "ppt_pl1_tau",
  1179				      "Set the CPU sustained power limit exceed duration");
  1180	LWMI_ATTR_GROUP_TUNABLE_CAP01(cpu_oc_stat, "cpu_oc_stat",
  1181				      "Set the CPU overclocking status");
  1182	LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_pl4_ipl, "ppt_pl4_ipl",
  1183				      "Set the CPU instantaneous power limit");
  1184	LWMI_ATTR_GROUP_TUNABLE_CAP01(ppt_pl4_ipl_cl, "ppt_pl4_ipl_cl",
  1185				      "Set the CPU cross loading instantaneous power limit");
  1186	
  1187	/* GPU tunable attributes */
  1188	LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_nv_ppab, "gpu_nv_ppab",
  1189				      "Set the Nvidia GPU power performance aware boost limit");
  1190	LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_nv_ctgp, "gpu_nv_ctgp",
  1191				      "Set the GPU configurable total graphics power");
  1192	LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_temp, "gpu_temp",
  1193				      "Set the GPU thermal load limit");
  1194	LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_nv_ac_offset, "gpu_nv_ac_offset",
  1195				      "Set the Nvidia GPU AC total processing power baseline offset");
  1196	LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_oc_stat, "gpu_oc_stat",
  1197				      "Set the GPU overclocking status");
  1198	LWMI_ATTR_GROUP_TUNABLE_CAP01(dgpu_boost_clk, "gpu_boost_clk",
  1199				      "Set the dedicated GPU boost clock");
  1200	LWMI_ATTR_GROUP_TUNABLE_CAP01(dgpu_enable, "dgpu_enable",
  1201				      "Set the dedicated Nvidia GPU enabled status");
> 1202	LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_mode, "gpu_mode",
  1203				      "Set the GPU mode by power limit");
  1204	LWMI_ATTR_GROUP_TUNABLE_CAP01(dgpu_didvid, "gpu_didvid",
  1205				      "Get the GPU device identifier and vendor identifier");
  1206	LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_nv_bpl, "gpu_nv_bpl",
  1207				      "Set the Nvidia GPU base power limit");
  1208	LWMI_ATTR_GROUP_TUNABLE_CAP01(gpu_nv_cpu_boost, "gpu_nv_cpu_boost",
  1209				      "Set the Nvidia GPU to CPU dynamic boost limit");
  1210	

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

  reply	other threads:[~2026-02-13 19:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-13  8:02 [PATCH 0/5] platform-x86: lenovo-wmi: Add fixes and enhancement Derek J. Clark
2026-02-13  8:02 ` [PATCH 1/5] platform/x86: lenovo-wmi-other: Add LWMI_ATTR_ID Macro Derek J. Clark
2026-02-13  8:02 ` [PATCH 2/5] platform/x86: lenovo-wmi-other: Limit adding attributes to supported devices Derek J. Clark
2026-02-13  8:02 ` [PATCH 3/5] platform/x86: lenovo-wmi-other: Add missing CPU tunable attributes Derek J. Clark
2026-02-13  8:02 ` [PATCH 4/5] platform/x86: lenovo-wmi-other: Add GPU " Derek J. Clark
2026-02-13 19:26   ` kernel test robot [this message]
2026-02-13 20:28   ` kernel test robot
2026-02-13  8:02 ` [PATCH 5/5] platform/x86: lenovo-wmi-other: Add WMI battery charge limiting Derek J. Clark
2026-02-13 22:59   ` kernel test robot

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=202602140321.pfFQKWKX-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=W_Armin@gmx.de \
    --cc=corbet@lwn.net \
    --cc=derekjohn.clark@gmail.com \
    --cc=hansg@kernel.org \
    --cc=i@rong.moe \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kuurtb@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mpearson-lenovo@squebb.ca \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=platform-driver-x86@vger.kernel.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