[sashal-linux-stable:pending-4.19 145/319] drivers/media/platform/sh_vou.c:1147:9: error: implicit declaration of function 'pm_runtime_resume_and_get'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git pending-4.19
head: 7a22a15b233112e0df833d0bc9b0b99cc0c226ba
commit: d11e537f3222e51269fd973fafbdcc69d47394f0 [145/319] media: sh_vou: fix pm_runtime_get_sync() usage count
config: x86_64-randconfig-r003-20210711 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 8d69635ed9ecf36fd0ca85906bfde17949671cbe)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable pending-4.19
git checkout d11e537f3222e51269fd973fafbdcc69d47394f0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> drivers/media/platform/sh_vou.c:1147:9: error: implicit declaration of function 'pm_runtime_resume_and_get' [-Werror,-Wimplicit-function-declaration]
err = pm_runtime_resume_and_get(vou_dev->v4l2_dev.dev);
^
drivers/media/platform/sh_vou.c:1147:9: note: did you mean 'pm_runtime_resume'?
include/linux/pm_runtime.h:198:19: note: 'pm_runtime_resume' declared here
static inline int pm_runtime_resume(struct device *dev)
^
1 error generated.
vim +/pm_runtime_resume_and_get +1147 drivers/media/platform/sh_vou.c
1131
1132 /* File operations */
1133 static int sh_vou_open(struct file *file)
1134 {
1135 struct sh_vou_device *vou_dev = video_drvdata(file);
1136 int err;
1137
1138 if (mutex_lock_interruptible(&vou_dev->fop_lock))
1139 return -ERESTARTSYS;
1140
1141 err = v4l2_fh_open(file);
1142 if (err)
1143 goto done_open;
1144 if (v4l2_fh_is_singular_file(file) &&
1145 vou_dev->status == SH_VOU_INITIALISING) {
1146 /* First open */
> 1147 err = pm_runtime_resume_and_get(vou_dev->v4l2_dev.dev);
1148 if (err < 0) {
1149 v4l2_fh_release(file);
1150 goto done_open;
1151 }
1152 err = sh_vou_hw_init(vou_dev);
1153 if (err < 0) {
1154 pm_runtime_put(vou_dev->v4l2_dev.dev);
1155 v4l2_fh_release(file);
1156 } else {
1157 vou_dev->status = SH_VOU_IDLE;
1158 }
1159 }
1160 done_open:
1161 mutex_unlock(&vou_dev->fop_lock);
1162 return err;
1163 }
1164
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[sashal-linux-stable:pending-5.10 331/598] drivers/gpu/drm/vc4/vc4_crtc.c:538:27: error: 'state' undeclared; did you mean 'statx'?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git pending-5.10
head: b2dc84ee261d4651c10723b81720792ff6db40fb
commit: 1f621b79eec3b97b8577c30a8b5311d8a3a74967 [331/598] drm/vc4: crtc: Pass the drm_atomic_state to config_pv
config: nios2-allyesconfig (attached as .config)
compiler: nios2-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git fetch --no-tags sashal-linux-stable pending-5.10
git checkout 1f621b79eec3b97b8577c30a8b5311d8a3a74967
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=nios2 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/vc4/vc4_crtc.c: In function 'vc4_crtc_atomic_enable':
>> drivers/gpu/drm/vc4/vc4_crtc.c:538:27: error: 'state' undeclared (first use in this function); did you mean 'statx'?
538 | vc4_crtc_config_pv(crtc, state);
| ^~~~~
| statx
drivers/gpu/drm/vc4/vc4_crtc.c:538:27: note: each undeclared identifier is reported only once for each function it appears in
vim +538 drivers/gpu/drm/vc4/vc4_crtc.c
517
518 static void vc4_crtc_atomic_enable(struct drm_crtc *crtc,
519 struct drm_crtc_state *old_state)
520 {
521 struct drm_device *dev = crtc->dev;
522 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
523 struct drm_encoder *encoder = vc4_get_crtc_encoder(crtc);
524 struct vc4_encoder *vc4_encoder = to_vc4_encoder(encoder);
525
526 require_hvs_enabled(dev);
527
528 /* Enable vblank irq handling before crtc is started otherwise
529 * drm_crtc_get_vblank() fails in vc4_crtc_update_dlist().
530 */
531 drm_crtc_vblank_on(crtc);
532
533 vc4_hvs_atomic_enable(crtc, old_state);
534
535 if (vc4_encoder->pre_crtc_configure)
536 vc4_encoder->pre_crtc_configure(encoder);
537
> 538 vc4_crtc_config_pv(crtc, state);
539
540 CRTC_WRITE(PV_CONTROL, CRTC_READ(PV_CONTROL) | PV_CONTROL_EN);
541
542 if (vc4_encoder->pre_crtc_enable)
543 vc4_encoder->pre_crtc_enable(encoder);
544
545 /* When feeding the transposer block the pixelvalve is unneeded and
546 * should not be enabled.
547 */
548 CRTC_WRITE(PV_V_CONTROL,
549 CRTC_READ(PV_V_CONTROL) | PV_VCONTROL_VIDEN);
550
551 if (vc4_encoder->post_crtc_enable)
552 vc4_encoder->post_crtc_enable(encoder);
553 }
554
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[ti:ti-linux-5.10.y 6302/6309] drivers/net/ethernet/ti/prueth_lre.c:120:6: warning: no previous prototype for 'pru_spin_lock'
by kernel test robot
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux-5.10.y
head: 31b50abb3ee1c8f78cb2d61c6fbbf074c7f5d99f
commit: d2e8eb5a46ec7216223407be3d3840648f554be0 [6302/6309] net: ti: prueth_core: hsr/prp: add HSR/PRP driver
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-linux-5.10.y
git checkout d2e8eb5a46ec7216223407be3d3840648f554be0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/net/ethernet/ti/prueth_lre.c:120:6: warning: no previous prototype for 'pru_spin_lock' [-Wmissing-prototypes]
120 | void pru_spin_lock(struct node_tbl *nt)
| ^~~~~~~~~~~~~
>> drivers/net/ethernet/ti/prueth_lre.c:267:6: warning: no previous prototype for 'node_table_update_time' [-Wmissing-prototypes]
267 | void node_table_update_time(struct node_tbl *nt)
| ^~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/ti/prueth_lre.c:470:6: warning: no previous prototype for 'node_table_check_and_remove' [-Wmissing-prototypes]
470 | void node_table_check_and_remove(struct node_tbl *nt, u16 forget_time)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/net/ethernet/ti/prueth_lre.c:530:6: warning: no previous prototype for 'pop_queue_process' [-Wmissing-prototypes]
530 | void pop_queue_process(struct prueth *prueth, spinlock_t *lock)
| ^~~~~~~~~~~~~~~~~
drivers/net/ethernet/ti/prueth_lre.c: In function 'prueth_lre_emac_rx_packets':
>> drivers/net/ethernet/ti/prueth_lre.c:706:36: warning: variable 'queue_desc_p' set but not used [-Wunused-but-set-variable]
706 | struct prueth_queue_desc __iomem *queue_desc_p;
| ^~~~~~~~~~~~
>> drivers/net/ethernet/ti/prueth_lre.c:705:43: warning: variable 'status_o' set but not used [-Wunused-but-set-variable]
705 | u8 overflow_cnt, overflow_cnt_o, status, status_o;
| ^~~~~~~~
>> drivers/net/ethernet/ti/prueth_lre.c:705:35: warning: variable 'status' set but not used [-Wunused-but-set-variable]
705 | u8 overflow_cnt, overflow_cnt_o, status, status_o;
| ^~~~~~
vim +/pru_spin_lock +120 drivers/net/ethernet/ti/prueth_lre.c
119
> 120 void pru_spin_lock(struct node_tbl *nt)
121 {
122 while (1) {
123 nt->nt_info->arm_lock = 1;
124 if (!nt->nt_info->fw_lock)
125 break;
126 nt->nt_info->arm_lock = 0;
127 }
128 }
129
130 static inline void pru_spin_unlock(struct node_tbl *nt)
131 {
132 nt->nt_info->arm_lock = 0;
133 }
134
135 int prueth_lre_nt_insert(struct prueth *prueth,
136 u8 *mac, int port, int sv_frame, int proto)
137 {
138 struct nt_queue_t *q = prueth->mac_queue;
139 unsigned long flags;
140 int ret = LRE_OK;
141
142 /* Will encounter a null mac_queue if we are in the middle of
143 * ndo_close. So check and return. Otherwise a kernel crash is
144 * seen when doing ifdown continuously.
145 */
146 if (!q)
147 return ret;
148
149 spin_lock_irqsave(&prueth->nt_lock, flags);
150 if (q->full) {
151 ret = LRE_ERR;
152 } else {
153 memcpy(q->nt_queue[q->wr_ind].mac, mac, ETH_ALEN);
154 q->nt_queue[q->wr_ind].sv_frame = sv_frame;
155 q->nt_queue[q->wr_ind].port_id = port;
156 q->nt_queue[q->wr_ind].proto = proto;
157
158 q->wr_ind++;
159 q->wr_ind &= (PRUETH_MAC_QUEUE_MAX - 1);
160 if (q->wr_ind == q->rd_ind)
161 q->full = true;
162 }
163 spin_unlock_irqrestore(&prueth->nt_lock, flags);
164
165 return ret;
166 }
167
168 static inline bool node_expired(struct node_tbl *nt, u16 node, u16 forget_time)
169 {
170 struct node_tbl_t nt_node = nt->nt_array->node_tbl[node];
171
172 return ((nt_node.time_last_seen_s > forget_time ||
173 nt_node.status & ICSS_LRE_NT_REM_NODE_TYPE_SANAB) &&
174 nt_node.time_last_seen_a > forget_time &&
175 nt_node.time_last_seen_b > forget_time);
176 }
177
178 #define IND_BIN_NO(x) nt->index_array->index_tbl[x].bin_no_entries
179 #define IND_BINOFS(x) nt->index_array->index_tbl[x].bin_offset
180 #define BIN_NODEOFS(x) nt->bin_array->bin_tbl[x].node_tbl_offset
181
182 static void _prueth_lre_init_node_table(struct prueth *prueth)
183 {
184 struct nt_queue_t *q = prueth->mac_queue;
185 struct node_tbl *nt = prueth->nt;
186 int j;
187
188 const struct prueth_fw_offsets *fw_offsets = prueth->fw_offsets;
189
190 nt->nt_array = prueth->mem[fw_offsets->nt_array_loc].va +
191 fw_offsets->nt_array_offset;
192 memset_io(nt->nt_array, 0, sizeof(struct node_tbl_t) *
193 fw_offsets->nt_array_max_entries);
194
195 nt->bin_array = prueth->mem[fw_offsets->bin_array_loc].va +
196 fw_offsets->bin_array_offset;
197 memset_io(nt->bin_array, 0, sizeof(struct bin_tbl_t) *
198 fw_offsets->bin_array_max_entries);
199
200 nt->index_array = prueth->mem[fw_offsets->index_array_loc].va +
201 fw_offsets->index_array_offset;
202 memset_io(nt->index_array, 0, sizeof(struct node_index_tbl_t) *
203 fw_offsets->index_array_max_entries);
204
205 nt->nt_info = prueth->mem[fw_offsets->nt_array_loc].va +
206 fw_offsets->nt_array_offset +
207 (sizeof(struct node_tbl_t) *
208 fw_offsets->nt_array_max_entries);
209 memset_io(nt->nt_info, 0, sizeof(struct node_tbl_info_t));
210
211 nt->nt_lre_cnt =
212 prueth->mem[PRUETH_MEM_SHARED_RAM].va + ICSS_LRE_CNT_NODES;
213 memset_io(nt->nt_lre_cnt, 0, sizeof(struct node_tbl_lre_cnt_t));
214
215 nt->nt_array_max_entries = fw_offsets->nt_array_max_entries;
216 nt->bin_array_max_entries = fw_offsets->bin_array_max_entries;
217 nt->index_array_max_entries = fw_offsets->index_array_max_entries;
218 nt->hash_mask = fw_offsets->hash_mask;
219
220 for (j = 0; j < fw_offsets->index_array_max_entries; j++)
221 IND_BINOFS(j) = fw_offsets->bin_array_max_entries;
222 for (j = 0; j < fw_offsets->bin_array_max_entries; j++)
223 BIN_NODEOFS(j) = fw_offsets->nt_array_max_entries;
224 for (j = 0; j < fw_offsets->nt_array_max_entries; j++)
225 nt->nt_array->node_tbl[j].entry_state = ICSS_LRE_NODE_FREE;
226
227 q->rd_ind = 0;
228 q->wr_ind = 0;
229 q->full = false;
230 }
231
232 static u16 find_free_bin(struct node_tbl *nt)
233 {
234 u16 j;
235
236 for (j = 0; j < nt->bin_array_max_entries; j++)
237 if (BIN_NODEOFS(j) == nt->nt_array_max_entries)
238 break;
239
240 return j;
241 }
242
243 /* find first free node table slot and write it to the next_free_slot */
244 static u16 next_free_slot_update(struct node_tbl *nt)
245 {
246 int j;
247
248 nt->nt_info->next_free_slot = nt->nt_array_max_entries;
249 for (j = 0; j < nt->nt_array_max_entries; j++) {
250 if (nt->nt_array->node_tbl[j].entry_state ==
251 ICSS_LRE_NODE_FREE) {
252 nt->nt_info->next_free_slot = j;
253 break;
254 }
255 }
256
257 return nt->nt_info->next_free_slot;
258 }
259
260 static void inc_time(u16 *t)
261 {
262 *t += 1;
263 if (*t > ICSS_LRE_MAX_FORGET_TIME)
264 *t = ICSS_LRE_MAX_FORGET_TIME;
265 }
266
> 267 void node_table_update_time(struct node_tbl *nt)
268 {
269 int j;
270 u16 ofs;
271 struct nt_array_t *nt_arr = nt->nt_array;
272 struct node_tbl_t *node;
273
274 for (j = 0; j < nt->bin_array_max_entries; j++) {
275 ofs = nt->bin_array->bin_tbl[j].node_tbl_offset;
276 if (ofs < nt->nt_array_max_entries) {
277 node = &nt_arr->node_tbl[ofs];
278 inc_time(&node->time_last_seen_a);
279 inc_time(&node->time_last_seen_b);
280 /* increment time_last_seen_s if nod is not SAN */
281 if ((node->status &
282 ICSS_LRE_NT_REM_NODE_TYPE_SANAB) == 0)
283 inc_time(&node->time_last_seen_s);
284 }
285 }
286 }
287
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
Re: [PATCH] drivers:edac: Use DEVICE_ATTR helper macros
by kernel test robot
Hi Dwaipayan,
I love your patch! Yet something to improve:
[auto build test ERROR on ras/edac-for-next]
[also build test ERROR on v5.13 next-20210709]
[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]
url: https://github.com/0day-ci/linux/commits/Dwaipayan-Ray/drivers-edac-Use-D...
base: https://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git edac-for-next
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/adad6ecbf0efe710fee1495b85d840ad5...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Dwaipayan-Ray/drivers-edac-Use-DEVICE_ATTR-helper-macros/20210711-152925
git checkout adad6ecbf0efe710fee1495b85d840ad53825124
# save the attached .config to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/edac/amd64_edac.c: In function 'dbam_show':
>> drivers/edac/amd64_edac.c:570:20: error: 'struct amd64_pvt' has no member named 'dbam'; did you mean 'dbam0'?
570 | EDAC_DCT_ATTR_SHOW(dbam);
| ^~~~
drivers/edac/amd64_edac.c:566:48: note: in definition of macro 'EDAC_DCT_ATTR_SHOW'
566 | return sprintf(data, "0x%016llx\n", (u64)pvt->reg); \
| ^~~
drivers/edac/amd64_edac.c: In function 'topmem_show':
>> drivers/edac/amd64_edac.c:571:20: error: 'struct amd64_pvt' has no member named 'topmem'; did you mean 'top_mem'?
571 | EDAC_DCT_ATTR_SHOW(topmem);
| ^~~~~~
drivers/edac/amd64_edac.c:566:48: note: in definition of macro 'EDAC_DCT_ATTR_SHOW'
566 | return sprintf(data, "0x%016llx\n", (u64)pvt->reg); \
| ^~~
drivers/edac/amd64_edac.c: In function 'topmem2_show':
>> drivers/edac/amd64_edac.c:572:20: error: 'struct amd64_pvt' has no member named 'topmem2'; did you mean 'top_mem2'?
572 | EDAC_DCT_ATTR_SHOW(topmem2);
| ^~~~~~~
drivers/edac/amd64_edac.c:566:48: note: in definition of macro 'EDAC_DCT_ATTR_SHOW'
566 | return sprintf(data, "0x%016llx\n", (u64)pvt->reg); \
| ^~~
drivers/edac/amd64_edac.c:567:1: error: control reaches end of non-void function [-Werror=return-type]
567 | }
| ^
drivers/edac/amd64_edac.c:572:1: note: in expansion of macro 'EDAC_DCT_ATTR_SHOW'
572 | EDAC_DCT_ATTR_SHOW(topmem2);
| ^~~~~~~~~~~~~~~~~~
drivers/edac/amd64_edac.c: In function 'topmem_show':
drivers/edac/amd64_edac.c:567:1: error: control reaches end of non-void function [-Werror=return-type]
567 | }
| ^
drivers/edac/amd64_edac.c:571:1: note: in expansion of macro 'EDAC_DCT_ATTR_SHOW'
571 | EDAC_DCT_ATTR_SHOW(topmem);
| ^~~~~~~~~~~~~~~~~~
drivers/edac/amd64_edac.c: In function 'dbam_show':
drivers/edac/amd64_edac.c:567:1: error: control reaches end of non-void function [-Werror=return-type]
567 | }
| ^
drivers/edac/amd64_edac.c:570:1: note: in expansion of macro 'EDAC_DCT_ATTR_SHOW'
570 | EDAC_DCT_ATTR_SHOW(dbam);
| ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +570 drivers/edac/amd64_edac.c
568
569 EDAC_DCT_ATTR_SHOW(dhar);
> 570 EDAC_DCT_ATTR_SHOW(dbam);
> 571 EDAC_DCT_ATTR_SHOW(topmem);
> 572 EDAC_DCT_ATTR_SHOW(topmem2);
573
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[ti:ti-rt-linux-5.10.y 6651/6677] net/core/sock.c:3179:28: error: 'SCM_REDUNDANT' undeclared
by kernel test robot
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.10.y
head: db1fc3876dcb4c685815a7c7ce518724ffd9d8b8
commit: 89b354a68fd094a218c79af743e60299045f33b5 [6651/6677] net: socket: Pass on redundant net info to sock_recv_errqueue
config: parisc-buildonly-randconfig-r002-20210711 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-rt-linux-5.10.y
git checkout 89b354a68fd094a218c79af743e60299045f33b5
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=parisc SHELL=/bin/bash net/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/net/inet_sock.h:22,
from include/net/ip.h:28,
from include/linux/errqueue.h:6,
from net/core/sock.c:91:
include/net/sock.h: In function 'sock_recv_redundant_info':
include/net/sock.h:2525:29: error: 'SCM_REDUNDANT' undeclared (first use in this function)
2525 | put_cmsg(msg, SOL_SOCKET, SCM_REDUNDANT, sizeof(*sred), sred);
| ^~~~~~~~~~~~~
include/net/sock.h:2525:29: note: each undeclared identifier is reported only once for each function it appears in
net/core/sock.c: In function 'sock_recv_errqueue':
>> net/core/sock.c:3179:28: error: 'SCM_REDUNDANT' undeclared (first use in this function)
3179 | put_cmsg(msg, SOL_SOCKET, SCM_REDUNDANT, sizeof(*sred), sred);
| ^~~~~~~~~~~~~
vim +/SCM_REDUNDANT +3179 net/core/sock.c
3153
3154 int sock_recv_errqueue(struct sock *sk, struct msghdr *msg, int len,
3155 int level, int type)
3156 {
3157 struct sock_exterr_skb *serr;
3158 struct sk_buff *skb;
3159 int copied, err;
3160 struct skb_redundant_info *sred;
3161
3162 err = -EAGAIN;
3163 skb = sock_dequeue_err_skb(sk);
3164 if (skb == NULL)
3165 goto out;
3166
3167 copied = skb->len;
3168 if (copied > len) {
3169 msg->msg_flags |= MSG_TRUNC;
3170 copied = len;
3171 }
3172 err = skb_copy_datagram_msg(skb, 0, msg, copied);
3173 if (err)
3174 goto out_free_skb;
3175
3176 sock_recv_timestamp(msg, sk, skb);
3177
3178 sred = skb_redinfo(skb);
> 3179 put_cmsg(msg, SOL_SOCKET, SCM_REDUNDANT, sizeof(*sred), sred);
3180
3181 serr = SKB_EXT_ERR(skb);
3182 put_cmsg(msg, level, type, sizeof(serr->ee), &serr->ee);
3183
3184 msg->msg_flags |= MSG_ERRQUEUE;
3185 err = copied;
3186
3187 out_free_skb:
3188 kfree_skb(skb);
3189 out:
3190 return err;
3191 }
3192 EXPORT_SYMBOL(sock_recv_errqueue);
3193
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[ti:ti-rt-linux-5.10.y 6650/6677] net/socket.c:861:5: error: 'SCM_RED_TIMESTAMPING' undeclared
by kernel test robot
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.10.y
head: db1fc3876dcb4c685815a7c7ce518724ffd9d8b8
commit: b98f7ec080e0de442e0be84994ec8d26bdc39eeb [6650/6677] net: socket: Forward extra timestamp of received skb to user space
config: parisc-buildonly-randconfig-r002-20210711 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-rt-linux-5.10.y
git checkout b98f7ec080e0de442e0be84994ec8d26bdc39eeb
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=parisc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/net/cls_cgroup.h:14,
from net/socket.c:95:
include/net/sock.h: In function 'sock_recv_redundant_info':
include/net/sock.h:2525:29: error: 'SCM_REDUNDANT' undeclared (first use in this function)
2525 | put_cmsg(msg, SOL_SOCKET, SCM_REDUNDANT, sizeof(*sred), sred);
| ^~~~~~~~~~~~~
include/net/sock.h:2525:29: note: each undeclared identifier is reported only once for each function it appears in
net/socket.c: In function '__sock_recv_redinfo_timestamp':
>> net/socket.c:861:5: error: 'SCM_RED_TIMESTAMPING' undeclared (first use in this function)
861 | SCM_RED_TIMESTAMPING, sizeof(tss), &tss);
| ^~~~~~~~~~~~~~~~~~~~
net/socket.c: In function '__sys_getsockopt':
net/socket.c:2174:6: warning: variable 'max_optlen' set but not used [-Wunused-but-set-variable]
2174 | int max_optlen;
| ^~~~~~~~~~
vim +/SCM_RED_TIMESTAMPING +861 net/socket.c
845
846 void __sock_recv_redinfo_timestamp(struct msghdr *msg, struct sock *sk,
847 struct sk_buff *skb)
848 {
849 struct scm_timestamping_internal tss;
850 int empty = 1;
851 struct skb_shared_hwtstamps *red_shhwtstamps =
852 skb_redinfo_hwtstamps(skb);
853
854 if (red_shhwtstamps &&
855 (sk->sk_tsflags & SOF_TIMESTAMPING_RAW_HARDWARE) &&
856 ktime_to_timespec64_cond(red_shhwtstamps->hwtstamp, tss.ts + 2))
857 empty = 0;
858
859 if (!empty)
860 put_cmsg(msg, SOL_SOCKET,
> 861 SCM_RED_TIMESTAMPING, sizeof(tss), &tss);
862 }
863 EXPORT_SYMBOL_GPL(__sock_recv_redinfo_timestamp);
864
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[ti:ti-rt-linux-5.10.y 6649/6677] include/net/sock.h:2523:29: error: 'SCM_REDUNDANT' undeclared
by kernel test robot
tree: git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-rt-linux-5.10.y
head: db1fc3876dcb4c685815a7c7ce518724ffd9d8b8
commit: e355bf097bb11257afeadf6665e51f224eeb93a7 [6649/6677] net: packet: Pass on redundant net info in packet_recvmsg
config: sparc64-buildonly-randconfig-r003-20210711 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add ti git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git
git fetch --no-tags ti ti-rt-linux-5.10.y
git checkout e355bf097bb11257afeadf6665e51f224eeb93a7
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=sparc64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from include/linux/tcp.h:19,
from include/linux/ipv6.h:87,
from include/net/ipv6.h:12,
from include/linux/sunrpc/clnt.h:28,
from include/linux/nfs_fs.h:32,
from init/do_mounts.c:23:
include/net/sock.h: In function 'sock_recv_redundant_info':
>> include/net/sock.h:2523:29: error: 'SCM_REDUNDANT' undeclared (first use in this function)
2523 | put_cmsg(msg, SOL_SOCKET, SCM_REDUNDANT, sizeof(*sred), sred);
| ^~~~~~~~~~~~~
include/net/sock.h:2523:29: note: each undeclared identifier is reported only once for each function it appears in
--
In file included from fs/io_uring.c:64:
include/net/sock.h: In function 'sock_recv_redundant_info':
>> include/net/sock.h:2523:29: error: 'SCM_REDUNDANT' undeclared (first use in this function)
2523 | put_cmsg(msg, SOL_SOCKET, SCM_REDUNDANT, sizeof(*sred), sred);
| ^~~~~~~~~~~~~
include/net/sock.h:2523:29: note: each undeclared identifier is reported only once for each function it appears in
fs/io_uring.c: In function 'io_prep_async_work':
fs/io_uring.c:1431:22: warning: variable 'id' set but not used [-Wunused-but-set-variable]
1431 | struct io_identity *id;
| ^~
--
In file included from include/linux/skmsg.h:12,
from kernel/bpf/btf.c:22:
include/net/sock.h: In function 'sock_recv_redundant_info':
>> include/net/sock.h:2523:29: error: 'SCM_REDUNDANT' undeclared (first use in this function)
2523 | put_cmsg(msg, SOL_SOCKET, SCM_REDUNDANT, sizeof(*sred), sred);
| ^~~~~~~~~~~~~
include/net/sock.h:2523:29: note: each undeclared identifier is reported only once for each function it appears in
kernel/bpf/btf.c: In function 'btf_seq_show':
kernel/bpf/btf.c:5328:22: warning: function 'btf_seq_show' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
5328 | seq_vprintf((struct seq_file *)show->target, fmt, args);
| ^~~~~~~~
kernel/bpf/btf.c: In function 'btf_snprintf_show':
kernel/bpf/btf.c:5365:2: warning: function 'btf_snprintf_show' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
5365 | len = vsnprintf(show->target, ssnprintf->len_left, fmt, args);
| ^~~
--
In file included from include/linux/tcp.h:19,
from include/linux/ipv6.h:87,
from include/net/addrconf.h:50,
from lib/vsprintf.c:40:
include/net/sock.h: In function 'sock_recv_redundant_info':
>> include/net/sock.h:2523:29: error: 'SCM_REDUNDANT' undeclared (first use in this function)
2523 | put_cmsg(msg, SOL_SOCKET, SCM_REDUNDANT, sizeof(*sred), sred);
| ^~~~~~~~~~~~~
include/net/sock.h:2523:29: note: each undeclared identifier is reported only once for each function it appears in
lib/vsprintf.c: In function 'va_format':
lib/vsprintf.c:1663:2: warning: function 'va_format' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
1663 | buf += vsnprintf(buf, end > buf ? end - buf : 0, va_fmt->fmt, va);
| ^~~
vim +/SCM_REDUNDANT +2523 include/net/sock.h
2514
2515 DECLARE_STATIC_KEY_FALSE(tcp_rx_skb_cache_key);
2516 static inline void sock_recv_redundant_info(struct msghdr *msg, struct sock *sk,
2517 struct sk_buff *skb)
2518 {
2519 struct skb_redundant_info *sred;
2520
2521 sred = skb_redinfo(skb);
2522 if (sred->lsdu_size)
> 2523 put_cmsg(msg, SOL_SOCKET, SCM_REDUNDANT, sizeof(*sred), sred);
2524 }
2525
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
crypto/async_tx/raid6test.c:44:13: error: 'disk_type' redeclared as different kind of symbol
by kernel test robot
Hi Boris,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: de5540965853e514a85d3b775e9049deb85a2ff3
commit: ef45fe470e1e5410db4af87abc5d5055427945ac blk-cgroup: show global disk stats in root cgroup io.stat
date: 12 months ago
config: mips-randconfig-r035-20210711 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout ef45fe470e1e5410db4af87abc5d5055427945ac
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross O=build_dir ARCH=mips SHELL=/bin/bash crypto/async_tx/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> crypto/async_tx/raid6test.c:44:13: error: 'disk_type' redeclared as different kind of symbol
44 | static char disk_type(int d, int disks)
| ^~~~~~~~~
In file included from arch/mips/include/asm/mach-rc32434/rb.h:10,
from arch/mips/include/asm/mach-rc32434/irq.h:8,
from arch/mips/include/asm/irq.h:18,
from include/linux/irq.h:23,
from include/asm-generic/hardirq.h:13,
from arch/mips/include/asm/hardirq.h:16,
from include/linux/hardirq.h:10,
from include/linux/interrupt.h:11,
from include/linux/async_tx.h:9,
from crypto/async_tx/raid6test.c:9:
include/linux/genhd.h:27:33: note: previous declaration of 'disk_type' was here
27 | extern const struct device_type disk_type;
| ^~~~~~~~~
vim +/disk_type +44 crypto/async_tx/raid6test.c
cb3c82992f62f8 Dan Williams 2009-07-14 43
cb3c82992f62f8 Dan Williams 2009-07-14 @44 static char disk_type(int d, int disks)
cb3c82992f62f8 Dan Williams 2009-07-14 45 {
cb3c82992f62f8 Dan Williams 2009-07-14 46 if (d == disks - 2)
cb3c82992f62f8 Dan Williams 2009-07-14 47 return 'P';
cb3c82992f62f8 Dan Williams 2009-07-14 48 else if (d == disks - 1)
cb3c82992f62f8 Dan Williams 2009-07-14 49 return 'Q';
cb3c82992f62f8 Dan Williams 2009-07-14 50 else
cb3c82992f62f8 Dan Williams 2009-07-14 51 return 'D';
cb3c82992f62f8 Dan Williams 2009-07-14 52 }
cb3c82992f62f8 Dan Williams 2009-07-14 53
:::::: The code at line 44 was first introduced by commit
:::::: cb3c82992f62f838e6476a0bff12909158007fc6 async_tx: raid6 recovery self test
:::::: TO: Dan Williams <dan.j.williams(a)intel.com>
:::::: CC: Dan Williams <dan.j.williams(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
[linux-stable-rc:linux-5.10.y 4305/4974] resctrlfs.c:641:28: error: 'CMT_STR' undeclared; did you mean 'CAT_STR'?
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y
head: 77806d1ee43e1bea3aa5095445eb7a69f02ec8d3
commit: 19eaad1400eab34e97ec4467cd2ab694d1caf20c [4305/4974] selftests/resctrl: Use resctrl/info for feature detection
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gi...
git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-5.10.y
git checkout 19eaad1400eab34e97ec4467cd2ab694d1caf20c
# save the attached .config to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash -C tools/testing/selftests/resctrl install
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
resctrlfs.c: In function 'validate_resctrl_feature_request':
>> resctrlfs.c:641:28: error: 'CMT_STR' undeclared (first use in this function); did you mean 'CAT_STR'?
641 | !strncmp(resctrl_val, CMT_STR, sizeof(CMT_STR))) {
| ^~~~~~~
| CAT_STR
resctrlfs.c:641:28: note: each undeclared identifier is reported only once for each function it appears in
--
/usr/bin/ld: /tmp/ccDCv7Po.o: warning: relocation against `tests_run' in read-only section `.text.startup'
/usr/bin/ld: /tmp/ccDCv7Po.o: in function `detect_amd':
>> tools/testing/selftests/resctrl/resctrl_tests.c:26: undefined reference to `fgrep'
/usr/bin/ld: /tmp/ccDCv7Po.o: in function `tests_cleanup':
>> tools/testing/selftests/resctrl/resctrl_tests.c:51: undefined reference to `mbm_test_cleanup'
>> /usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:52: undefined reference to `mba_test_cleanup'
>> /usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:53: undefined reference to `cqm_test_cleanup'
>> /usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:54: undefined reference to `cat_test_cleanup'
/usr/bin/ld: /tmp/ccDCv7Po.o: in function `main':
>> tools/testing/selftests/resctrl/resctrl_tests.c:158: undefined reference to `check_resctrlfs_support'
>> /usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:159: undefined reference to `filter_dmesg'
/usr/bin/ld: /tmp/ccDCv7Po.o: in function `printf':
>> /usr/include/x86_64-linux-gnu/bits/stdio2.h:107: undefined reference to `tests_run'
/usr/bin/ld: /tmp/ccDCv7Po.o: in function `main':
>> tools/testing/selftests/resctrl/resctrl_tests.c:158: undefined reference to `check_resctrlfs_support'
>> /usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:159: undefined reference to `filter_dmesg'
>> /usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:165: undefined reference to `mbm_bw_change'
>> /usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:167: undefined reference to `mbm_test_cleanup'
>> /usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:168: undefined reference to `tests_run'
>> /usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:193: undefined reference to `cat_perf_miss_val'
/usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:195: undefined reference to `tests_run'
/usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:196: undefined reference to `cat_test_cleanup'
>> /usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:185: undefined reference to `cqm_resctrl_val'
/usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:187: undefined reference to `cqm_test_cleanup'
/usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:188: undefined reference to `tests_run'
>> /usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:175: undefined reference to `mba_schemata_change'
/usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:177: undefined reference to `mba_test_cleanup'
/usr/bin/ld: tools/testing/selftests/resctrl/resctrl_tests.c:178: undefined reference to `tests_run'
/usr/bin/ld: warning: creating DT_TEXTREL in a PIE
collect2: error: ld returned 1 exit status
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months
Re: [PATCH] powerpc/perf: Enable PMU counters post partition migration if PMU is active
by kernel test robot
Hi Athira,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on powerpc/next]
[also build test WARNING on v5.13 next-20210709]
[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]
url: https://github.com/0day-ci/linux/commits/Athira-Rajeev/powerpc-perf-Enabl...
base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/2050c82afb3abd9eaa57fee45e71e7fcc...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Athira-Rajeev/powerpc-perf-Enable-PMU-counters-post-partition-migration-if-PMU-is-active/20210711-150741
git checkout 2050c82afb3abd9eaa57fee45e71e7fccabfb81f
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> arch/powerpc/perf/core-book3s.c:1343:6: warning: no previous prototype for 'mobility_pmu_disable' [-Wmissing-prototypes]
1343 | void mobility_pmu_disable(void)
| ^~~~~~~~~~~~~~~~~~~~
>> arch/powerpc/perf/core-book3s.c:1537:6: warning: no previous prototype for 'mobility_pmu_enable' [-Wmissing-prototypes]
1537 | void mobility_pmu_enable(void)
| ^~~~~~~~~~~~~~~~~~~
vim +/mobility_pmu_disable +1343 arch/powerpc/perf/core-book3s.c
1337
1338 /*
1339 * Called from powerpc mobility code
1340 * before migration to disable counters
1341 * if the PMU is active.
1342 */
> 1343 void mobility_pmu_disable(void)
1344 {
1345 struct cpu_hw_events *cpuhw;
1346
1347 cpuhw = this_cpu_ptr(&cpu_hw_events);
1348 if (cpuhw->n_events != 0) {
1349 power_pmu_disable(NULL);
1350 cpuhw->migrate = 1;
1351 }
1352 }
1353
1354 /*
1355 * Re-enable all events if disable == 0.
1356 * If we were previously disabled and events were added, then
1357 * put the new config on the PMU.
1358 */
1359 static void power_pmu_enable(struct pmu *pmu)
1360 {
1361 struct perf_event *event;
1362 struct cpu_hw_events *cpuhw;
1363 unsigned long flags;
1364 long i;
1365 unsigned long val, mmcr0;
1366 s64 left;
1367 unsigned int hwc_index[MAX_HWEVENTS];
1368 int n_lim;
1369 int idx;
1370 bool ebb;
1371
1372 if (!ppmu)
1373 return;
1374 local_irq_save(flags);
1375
1376 cpuhw = this_cpu_ptr(&cpu_hw_events);
1377 if (!cpuhw->disabled)
1378 goto out;
1379
1380 if (cpuhw->n_events == 0) {
1381 ppc_set_pmu_inuse(0);
1382 goto out;
1383 }
1384
1385 cpuhw->disabled = 0;
1386
1387 /*
1388 * EBB requires an exclusive group and all events must have the EBB
1389 * flag set, or not set, so we can just check a single event. Also we
1390 * know we have at least one event.
1391 */
1392 ebb = is_ebb_event(cpuhw->event[0]);
1393
1394 /*
1395 * If we didn't change anything, or only removed events,
1396 * no need to recalculate MMCR* settings and reset the PMCs.
1397 * Just reenable the PMU with the current MMCR* settings
1398 * (possibly updated for removal of events).
1399 * While reenabling PMU during partition migration, continue
1400 * with normal flow.
1401 */
1402 if (!cpuhw->n_added && !cpuhw->migrate) {
1403 mtspr(SPRN_MMCRA, cpuhw->mmcr.mmcra & ~MMCRA_SAMPLE_ENABLE);
1404 mtspr(SPRN_MMCR1, cpuhw->mmcr.mmcr1);
1405 if (ppmu->flags & PPMU_ARCH_31)
1406 mtspr(SPRN_MMCR3, cpuhw->mmcr.mmcr3);
1407 goto out_enable;
1408 }
1409
1410 /*
1411 * Clear all MMCR settings and recompute them for the new set of events.
1412 */
1413 memset(&cpuhw->mmcr, 0, sizeof(cpuhw->mmcr));
1414
1415 if (ppmu->compute_mmcr(cpuhw->events, cpuhw->n_events, hwc_index,
1416 &cpuhw->mmcr, cpuhw->event, ppmu->flags)) {
1417 /* shouldn't ever get here */
1418 printk(KERN_ERR "oops compute_mmcr failed\n");
1419 goto out;
1420 }
1421
1422 if (!(ppmu->flags & PPMU_ARCH_207S)) {
1423 /*
1424 * Add in MMCR0 freeze bits corresponding to the attr.exclude_*
1425 * bits for the first event. We have already checked that all
1426 * events have the same value for these bits as the first event.
1427 */
1428 event = cpuhw->event[0];
1429 if (event->attr.exclude_user)
1430 cpuhw->mmcr.mmcr0 |= MMCR0_FCP;
1431 if (event->attr.exclude_kernel)
1432 cpuhw->mmcr.mmcr0 |= freeze_events_kernel;
1433 if (event->attr.exclude_hv)
1434 cpuhw->mmcr.mmcr0 |= MMCR0_FCHV;
1435 }
1436
1437 /*
1438 * Write the new configuration to MMCR* with the freeze
1439 * bit set and set the hardware events to their initial values.
1440 * Then unfreeze the events.
1441 */
1442 ppc_set_pmu_inuse(1);
1443 mtspr(SPRN_MMCRA, cpuhw->mmcr.mmcra & ~MMCRA_SAMPLE_ENABLE);
1444 mtspr(SPRN_MMCR1, cpuhw->mmcr.mmcr1);
1445 mtspr(SPRN_MMCR0, (cpuhw->mmcr.mmcr0 & ~(MMCR0_PMC1CE | MMCR0_PMCjCE))
1446 | MMCR0_FC);
1447 if (ppmu->flags & PPMU_ARCH_207S)
1448 mtspr(SPRN_MMCR2, cpuhw->mmcr.mmcr2);
1449
1450 if (ppmu->flags & PPMU_ARCH_31)
1451 mtspr(SPRN_MMCR3, cpuhw->mmcr.mmcr3);
1452
1453 /*
1454 * Read off any pre-existing events that need to move
1455 * to another PMC.
1456 * While enabling PMU during partition migration,
1457 * skip power_pmu_read since all event count settings
1458 * needs to be re-initialised after migration.
1459 */
1460 for (i = 0; i < cpuhw->n_events; ++i) {
1461 event = cpuhw->event[i];
1462 if ((event->hw.idx && event->hw.idx != hwc_index[i] + 1) || (cpuhw->migrate)) {
1463 if (!cpuhw->migrate)
1464 power_pmu_read(event);
1465 write_pmc(event->hw.idx, 0);
1466 event->hw.idx = 0;
1467 }
1468 }
1469
1470 /*
1471 * Initialize the PMCs for all the new and moved events.
1472 */
1473 cpuhw->n_limited = n_lim = 0;
1474 for (i = 0; i < cpuhw->n_events; ++i) {
1475 event = cpuhw->event[i];
1476 if (event->hw.idx)
1477 continue;
1478 idx = hwc_index[i] + 1;
1479 if (is_limited_pmc(idx)) {
1480 cpuhw->limited_counter[n_lim] = event;
1481 cpuhw->limited_hwidx[n_lim] = idx;
1482 ++n_lim;
1483 continue;
1484 }
1485
1486 if (ebb)
1487 val = local64_read(&event->hw.prev_count);
1488 else {
1489 val = 0;
1490 if (event->hw.sample_period) {
1491 left = local64_read(&event->hw.period_left);
1492 if (left < 0x80000000L)
1493 val = 0x80000000L - left;
1494 }
1495 local64_set(&event->hw.prev_count, val);
1496 }
1497
1498 event->hw.idx = idx;
1499 if (event->hw.state & PERF_HES_STOPPED)
1500 val = 0;
1501 write_pmc(idx, val);
1502
1503 perf_event_update_userpage(event);
1504 }
1505 cpuhw->n_limited = n_lim;
1506 cpuhw->mmcr.mmcr0 |= MMCR0_PMXE | MMCR0_FCECE;
1507
1508 out_enable:
1509 pmao_restore_workaround(ebb);
1510
1511 mmcr0 = ebb_switch_in(ebb, cpuhw);
1512
1513 mb();
1514 if (cpuhw->bhrb_users)
1515 ppmu->config_bhrb(cpuhw->bhrb_filter);
1516
1517 write_mmcr0(cpuhw, mmcr0);
1518
1519 /*
1520 * Enable instruction sampling if necessary
1521 */
1522 if (cpuhw->mmcr.mmcra & MMCRA_SAMPLE_ENABLE) {
1523 mb();
1524 mtspr(SPRN_MMCRA, cpuhw->mmcr.mmcra);
1525 }
1526
1527 out:
1528
1529 local_irq_restore(flags);
1530 }
1531
1532 /*
1533 * Called from powerpc mobility code
1534 * during migration completion to
1535 * enable back PMU counters.
1536 */
> 1537 void mobility_pmu_enable(void)
1538 {
1539 struct cpu_hw_events *cpuhw;
1540
1541 cpuhw = this_cpu_ptr(&cpu_hw_events);
1542 power_pmu_enable(NULL);
1543 cpuhw->migrate = 0;
1544 }
1545
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 2 months