From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [Intel-gfx] [PATCH 15/23] drm/i915: Convert i915_gem_object/client_blt.c to use ww locking as well, v2.
Date: Sun, 05 Jul 2020 20:45:49 +0800 [thread overview]
Message-ID: <202007052039.lc6MKLSx%lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 9313 bytes --]
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200703122221.591656-16-maarten.lankhorst@linux.intel.com>
References: <20200703122221.591656-16-maarten.lankhorst@linux.intel.com>
TO: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Hi Maarten,
I love your patch! Perhaps something to improve:
[auto build test WARNING on 7faedc4873dd257f4ed064ab4e0a28407690ea73]
url: https://github.com/0day-ci/linux/commits/Maarten-Lankhorst/drm-i915-Use-ww-locking-in-execbuf-submission/20200703-202504
base: 7faedc4873dd257f4ed064ab4e0a28407690ea73
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: i386-randconfig-m021-20200701 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
New smatch warnings:
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c:367 i915_gem_object_copy_blt() warn: passing a valid pointer to 'PTR_ERR'
Old smatch warnings:
drivers/gpu/drm/i915/gem/i915_gem_object.h:130 __i915_gem_object_lock() error: we previously assumed 'ww' could be null (see line 122)
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c:139 move_obj_to_gpu() warn: maybe use && instead of &
drivers/gpu/drm/i915/gem/i915_gem_context.h:205 i915_gem_context_get_engine() warn: inconsistent indenting
drivers/gpu/drm/i915/gem/i915_gem_context.h:207 i915_gem_context_get_engine() warn: inconsistent indenting
# https://github.com/0day-ci/linux/commit/db8aba4953b274f1a757ff6f92b15697fd5af58a
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout db8aba4953b274f1a757ff6f92b15697fd5af58a
vim +/PTR_ERR +367 drivers/gpu/drm/i915/gem/i915_gem_object_blt.c
05f219d709ec57 Matthew Auld 2019-08-10 350
05f219d709ec57 Matthew Auld 2019-08-10 351 int i915_gem_object_copy_blt(struct drm_i915_gem_object *src,
05f219d709ec57 Matthew Auld 2019-08-10 352 struct drm_i915_gem_object *dst,
05f219d709ec57 Matthew Auld 2019-08-10 353 struct intel_context *ce)
05f219d709ec57 Matthew Auld 2019-08-10 354 {
05f219d709ec57 Matthew Auld 2019-08-10 355 struct i915_address_space *vm = ce->vm;
05f219d709ec57 Matthew Auld 2019-08-10 356 struct i915_vma *vma[2], *batch;
db8aba4953b274 Maarten Lankhorst 2020-07-03 357 struct i915_gem_ww_ctx ww;
05f219d709ec57 Matthew Auld 2019-08-10 358 struct i915_request *rq;
05f219d709ec57 Matthew Auld 2019-08-10 359 int err, i;
05f219d709ec57 Matthew Auld 2019-08-10 360
05f219d709ec57 Matthew Auld 2019-08-10 361 vma[0] = i915_vma_instance(src, vm, NULL);
05f219d709ec57 Matthew Auld 2019-08-10 362 if (IS_ERR(vma[0]))
05f219d709ec57 Matthew Auld 2019-08-10 363 return PTR_ERR(vma[0]);
05f219d709ec57 Matthew Auld 2019-08-10 364
05f219d709ec57 Matthew Auld 2019-08-10 365 vma[1] = i915_vma_instance(dst, vm, NULL);
05f219d709ec57 Matthew Auld 2019-08-10 366 if (IS_ERR(vma[1]))
db8aba4953b274 Maarten Lankhorst 2020-07-03 @367 return PTR_ERR(vma);
05f219d709ec57 Matthew Auld 2019-08-10 368
db8aba4953b274 Maarten Lankhorst 2020-07-03 369 i915_gem_ww_ctx_init(&ww, true);
db8aba4953b274 Maarten Lankhorst 2020-07-03 370 intel_engine_pm_get(ce->engine);
db8aba4953b274 Maarten Lankhorst 2020-07-03 371 retry:
db8aba4953b274 Maarten Lankhorst 2020-07-03 372 err = i915_gem_object_lock(src, &ww);
db8aba4953b274 Maarten Lankhorst 2020-07-03 373 if (!err)
db8aba4953b274 Maarten Lankhorst 2020-07-03 374 err = i915_gem_object_lock(dst, &ww);
db8aba4953b274 Maarten Lankhorst 2020-07-03 375 if (!err)
db8aba4953b274 Maarten Lankhorst 2020-07-03 376 err = intel_context_pin_ww(ce, &ww);
db8aba4953b274 Maarten Lankhorst 2020-07-03 377 if (err)
db8aba4953b274 Maarten Lankhorst 2020-07-03 378 goto out;
db8aba4953b274 Maarten Lankhorst 2020-07-03 379
db8aba4953b274 Maarten Lankhorst 2020-07-03 380 err = i915_vma_pin_ww(vma[0], &ww, 0, 0, PIN_USER);
db8aba4953b274 Maarten Lankhorst 2020-07-03 381 if (err)
db8aba4953b274 Maarten Lankhorst 2020-07-03 382 goto out_ctx;
db8aba4953b274 Maarten Lankhorst 2020-07-03 383
db8aba4953b274 Maarten Lankhorst 2020-07-03 384 err = i915_vma_pin_ww(vma[1], &ww, 0, 0, PIN_USER);
05f219d709ec57 Matthew Auld 2019-08-10 385 if (unlikely(err))
05f219d709ec57 Matthew Auld 2019-08-10 386 goto out_unpin_src;
05f219d709ec57 Matthew Auld 2019-08-10 387
db8aba4953b274 Maarten Lankhorst 2020-07-03 388 batch = intel_emit_vma_copy_blt(ce, &ww, vma[0], vma[1]);
05f219d709ec57 Matthew Auld 2019-08-10 389 if (IS_ERR(batch)) {
05f219d709ec57 Matthew Auld 2019-08-10 390 err = PTR_ERR(batch);
05f219d709ec57 Matthew Auld 2019-08-10 391 goto out_unpin_dst;
05f219d709ec57 Matthew Auld 2019-08-10 392 }
05f219d709ec57 Matthew Auld 2019-08-10 393
db8aba4953b274 Maarten Lankhorst 2020-07-03 394 rq = i915_request_create(ce);
05f219d709ec57 Matthew Auld 2019-08-10 395 if (IS_ERR(rq)) {
05f219d709ec57 Matthew Auld 2019-08-10 396 err = PTR_ERR(rq);
05f219d709ec57 Matthew Auld 2019-08-10 397 goto out_batch;
05f219d709ec57 Matthew Auld 2019-08-10 398 }
05f219d709ec57 Matthew Auld 2019-08-10 399
05f219d709ec57 Matthew Auld 2019-08-10 400 err = intel_emit_vma_mark_active(batch, rq);
05f219d709ec57 Matthew Auld 2019-08-10 401 if (unlikely(err))
05f219d709ec57 Matthew Auld 2019-08-10 402 goto out_request;
05f219d709ec57 Matthew Auld 2019-08-10 403
05f219d709ec57 Matthew Auld 2019-08-10 404 for (i = 0; i < ARRAY_SIZE(vma); i++) {
223128f7671021 Tvrtko Ursulin 2020-06-15 405 err = move_obj_to_gpu(vma[i]->obj, rq, i);
05f219d709ec57 Matthew Auld 2019-08-10 406 if (unlikely(err))
db8aba4953b274 Maarten Lankhorst 2020-07-03 407 goto out_request;
05f219d709ec57 Matthew Auld 2019-08-10 408 }
05f219d709ec57 Matthew Auld 2019-08-10 409
05f219d709ec57 Matthew Auld 2019-08-10 410 for (i = 0; i < ARRAY_SIZE(vma); i++) {
05f219d709ec57 Matthew Auld 2019-08-10 411 unsigned int flags = i ? EXEC_OBJECT_WRITE : 0;
05f219d709ec57 Matthew Auld 2019-08-10 412
05f219d709ec57 Matthew Auld 2019-08-10 413 err = i915_vma_move_to_active(vma[i], rq, flags);
05f219d709ec57 Matthew Auld 2019-08-10 414 if (unlikely(err))
db8aba4953b274 Maarten Lankhorst 2020-07-03 415 goto out_request;
05f219d709ec57 Matthew Auld 2019-08-10 416 }
05f219d709ec57 Matthew Auld 2019-08-10 417
05f219d709ec57 Matthew Auld 2019-08-10 418 if (rq->engine->emit_init_breadcrumb) {
05f219d709ec57 Matthew Auld 2019-08-10 419 err = rq->engine->emit_init_breadcrumb(rq);
05f219d709ec57 Matthew Auld 2019-08-10 420 if (unlikely(err))
db8aba4953b274 Maarten Lankhorst 2020-07-03 421 goto out_request;
05f219d709ec57 Matthew Auld 2019-08-10 422 }
05f219d709ec57 Matthew Auld 2019-08-10 423
05f219d709ec57 Matthew Auld 2019-08-10 424 err = rq->engine->emit_bb_start(rq,
05f219d709ec57 Matthew Auld 2019-08-10 425 batch->node.start, batch->node.size,
05f219d709ec57 Matthew Auld 2019-08-10 426 0);
db8aba4953b274 Maarten Lankhorst 2020-07-03 427
05f219d709ec57 Matthew Auld 2019-08-10 428 out_request:
05f219d709ec57 Matthew Auld 2019-08-10 429 if (unlikely(err))
36e191f0644b20 Chris Wilson 2020-03-04 430 i915_request_set_error_once(rq, err);
05f219d709ec57 Matthew Auld 2019-08-10 431
05f219d709ec57 Matthew Auld 2019-08-10 432 i915_request_add(rq);
05f219d709ec57 Matthew Auld 2019-08-10 433 out_batch:
05f219d709ec57 Matthew Auld 2019-08-10 434 intel_emit_vma_release(ce, batch);
05f219d709ec57 Matthew Auld 2019-08-10 435 out_unpin_dst:
05f219d709ec57 Matthew Auld 2019-08-10 436 i915_vma_unpin(vma[1]);
05f219d709ec57 Matthew Auld 2019-08-10 437 out_unpin_src:
05f219d709ec57 Matthew Auld 2019-08-10 438 i915_vma_unpin(vma[0]);
db8aba4953b274 Maarten Lankhorst 2020-07-03 439 out_ctx:
db8aba4953b274 Maarten Lankhorst 2020-07-03 440 intel_context_unpin(ce);
db8aba4953b274 Maarten Lankhorst 2020-07-03 441 out:
db8aba4953b274 Maarten Lankhorst 2020-07-03 442 if (err == -EDEADLK) {
db8aba4953b274 Maarten Lankhorst 2020-07-03 443 err = i915_gem_ww_ctx_backoff(&ww);
db8aba4953b274 Maarten Lankhorst 2020-07-03 444 if (!err)
db8aba4953b274 Maarten Lankhorst 2020-07-03 445 goto retry;
db8aba4953b274 Maarten Lankhorst 2020-07-03 446 }
db8aba4953b274 Maarten Lankhorst 2020-07-03 447 i915_gem_ww_ctx_fini(&ww);
db8aba4953b274 Maarten Lankhorst 2020-07-03 448 intel_engine_pm_put(ce->engine);
05f219d709ec57 Matthew Auld 2019-08-10 449 return err;
05f219d709ec57 Matthew Auld 2019-08-10 450 }
05f219d709ec57 Matthew Auld 2019-08-10 451
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 41957 bytes --]
next reply other threads:[~2020-07-05 12:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-05 12:45 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-07-14 11:44 [Intel-gfx] [PATCH 01/23] Revert "drm/i915/gem: Async GPU relocations only" Maarten Lankhorst
2020-07-14 11:45 ` [Intel-gfx] [PATCH 15/23] drm/i915: Convert i915_gem_object/client_blt.c to use ww locking as well, v2 Maarten Lankhorst
2020-07-03 12:21 [Intel-gfx] [PATCH 00/23] drm/i915: Use ww locking in execbuf submission Maarten Lankhorst
2020-07-03 12:22 ` [Intel-gfx] [PATCH 15/23] drm/i915: Convert i915_gem_object/client_blt.c to use ww locking as well, v2 Maarten Lankhorst
2020-07-07 14:32 ` Dan Carpenter
2020-07-07 14:32 ` Dan Carpenter
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=202007052039.lc6MKLSx%lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.