[PATCH 3/5] drm/lima: save task info dump when task fail
kbuild test robot
lkp at intel.com
Sun Feb 23 02:07:22 UTC 2020
Hi Qiang,
I love your patch! Yet something to improve:
[auto build test ERROR on drm-tip/drm-tip]
[cannot apply to drm-exynos/exynos-drm-next drm-intel/for-linux-next tegra-drm/drm/tegra/for-next linus/master v5.6-rc2 next-20200221]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Qiang-Yu/drm-lima-add-error-debug-functionality/20200223-054634
base: git://anongit.freedesktop.org/drm/drm-tip drm-tip
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp at intel.com>
All errors (new ones prefixed by >>):
drivers/gpu/drm/lima/lima_sched.c: In function 'lima_sched_build_error_task_list':
>> drivers/gpu/drm/lima/lima_sched.c:347:11: error: implicit declaration of function 'vmap'; did you mean 'bmap'? [-Werror=implicit-function-declaration]
data = vmap(bo->base.pages, bo->heap_size >> PAGE_SHIFT,
^~~~
bmap
>> drivers/gpu/drm/lima/lima_sched.c:348:9: error: 'VM_MAP' undeclared (first use in this function); did you mean 'VM_MPX'?
VM_MAP, pgprot_writecombine(PAGE_KERNEL));
^~~~~~
VM_MPX
drivers/gpu/drm/lima/lima_sched.c:348:9: note: each undeclared identifier is reported only once for each function it appears in
>> drivers/gpu/drm/lima/lima_sched.c:356:4: error: implicit declaration of function 'vunmap'; did you mean 'kunmap'? [-Werror=implicit-function-declaration]
vunmap(data);
^~~~~~
kunmap
cc1: some warnings being treated as errors
vim +347 drivers/gpu/drm/lima/lima_sched.c
258
259 static void lima_sched_build_error_task_list(struct lima_sched_task *task)
260 {
261 struct lima_sched_error_task *et;
262 struct lima_sched_pipe *pipe = to_lima_pipe(task->base.sched);
263 struct lima_ip *ip = pipe->processor[0];
264 int pipe_id = ip->id == lima_ip_gp ? lima_pipe_gp : lima_pipe_pp;
265 struct lima_device *dev = ip->dev;
266 struct lima_sched_context *sched_ctx =
267 container_of(task->base.entity, struct lima_sched_context, base);
268 struct lima_ctx *ctx =
269 container_of(sched_ctx, struct lima_ctx, context[pipe_id]);
270 struct lima_dump_task *dt;
271 struct lima_dump_chunk *chunk;
272 struct lima_dump_chunk_pid *pid_chunk;
273 struct lima_dump_chunk_buffer *buffer_chunk;
274 uint32_t size, task_size, mem_size;
275 int i;
276
277 mutex_lock(&dev->error_task_list_lock);
278
279 if (dev->dump.num_tasks >= lima_max_error_tasks) {
280 dev_info(dev->dev, "fail to save task state: error task list is full\n");
281 goto out;
282 }
283
284 /* frame chunk */
285 size = sizeof(struct lima_dump_chunk) + pipe->frame_size;
286 /* process name chunk */
287 size += sizeof(struct lima_dump_chunk) + sizeof(ctx->pname);
288 /* pid chunk */
289 size += sizeof(struct lima_dump_chunk);
290 /* buffer chunks */
291 for (i = 0; i < task->num_bos; i++) {
292 struct lima_bo *bo = task->bos[i];
293
294 size += sizeof(struct lima_dump_chunk);
295 size += bo->heap_size ? bo->heap_size : lima_bo_size(bo);
296 }
297
298 task_size = size + sizeof(struct lima_dump_task);
299 mem_size = task_size + sizeof(*et);
300 et = kvmalloc(mem_size, GFP_KERNEL);
301 if (!et) {
302 dev_err(dev->dev, "fail to alloc task dump buffer of size %x\n",
303 mem_size);
304 goto out;
305 }
306
307 et->data = et + 1;
308 et->size = task_size;
309
310 dt = et->data;
311 memset(dt, 0, sizeof(*dt));
312 dt->id = pipe_id;
313 dt->size = size;
314
315 chunk = (struct lima_dump_chunk *)(dt + 1);
316 memset(chunk, 0, sizeof(*chunk));
317 chunk->id = LIMA_DUMP_CHUNK_FRAME;
318 chunk->size = pipe->frame_size;
319 memcpy(chunk + 1, task->frame, pipe->frame_size);
320 dt->num_chunks++;
321
322 chunk = (void *)(chunk + 1) + chunk->size;
323 memset(chunk, 0, sizeof(*chunk));
324 chunk->id = LIMA_DUMP_CHUNK_PROCESS_NAME;
325 chunk->size = sizeof(ctx->pname);
326 memcpy(chunk + 1, ctx->pname, sizeof(ctx->pname));
327 dt->num_chunks++;
328
329 pid_chunk = (void *)(chunk + 1) + chunk->size;
330 memset(pid_chunk, 0, sizeof(*pid_chunk));
331 pid_chunk->id = LIMA_DUMP_CHUNK_PROCESS_ID;
332 pid_chunk->pid = ctx->pid;
333 dt->num_chunks++;
334
335 buffer_chunk = (void *)(pid_chunk + 1) + pid_chunk->size;
336 for (i = 0; i < task->num_bos; i++) {
337 struct lima_bo *bo = task->bos[i];
338 void *data;
339
340 memset(buffer_chunk, 0, sizeof(*buffer_chunk));
341 buffer_chunk->id = LIMA_DUMP_CHUNK_BUFFER;
342 buffer_chunk->va = lima_vm_get_va(task->vm, bo);
343
344 if (bo->heap_size) {
345 buffer_chunk->size = bo->heap_size;
346
> 347 data = vmap(bo->base.pages, bo->heap_size >> PAGE_SHIFT,
> 348 VM_MAP, pgprot_writecombine(PAGE_KERNEL));
349 if (!data) {
350 kvfree(et);
351 goto out;
352 }
353
354 memcpy(buffer_chunk + 1, data, buffer_chunk->size);
355
> 356 vunmap(data);
357 } else {
358 buffer_chunk->size = lima_bo_size(bo);
359
360 data = drm_gem_shmem_vmap(&bo->base.base);
361 if (IS_ERR_OR_NULL(data)) {
362 kvfree(et);
363 goto out;
364 }
365
366 memcpy(buffer_chunk + 1, data, buffer_chunk->size);
367
368 drm_gem_shmem_vunmap(&bo->base.base, data);
369 }
370
371 buffer_chunk = (void *)(buffer_chunk + 1) + buffer_chunk->size;
372 dt->num_chunks++;
373 }
374
375 list_add(&et->list, &dev->error_task_list);
376 dev->dump.size += et->size;
377 dev->dump.num_tasks++;
378
379 dev_info(dev->dev, "save error task state success\n");
380
381 out:
382 mutex_unlock(&dev->error_task_list_lock);
383 }
384
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 64305 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20200223/97469887/attachment-0001.gz>
More information about the dri-devel
mailing list