All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [Intel-gfx] [PATCH 20/23] drm/i915: Use ww pinning for intel_context_create_request()
Date: Mon, 06 Jul 2020 09:20:41 +0800	[thread overview]
Message-ID: <202007060919.2psbH4G5%lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4463 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200703122221.591656-21-maarten.lankhorst@linux.intel.com>
References: <20200703122221.591656-21-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: 3 days ago
:::::: commit date: 3 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/gt/intel_context.c:472 intel_context_create_request() error: uninitialized symbol 'rq'.

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)

# https://github.com/0day-ci/linux/commit/bf4a02b288a7a2fb0b765163016a766e068b32da
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout bf4a02b288a7a2fb0b765163016a766e068b32da
vim +/rq +472 drivers/gpu/drm/i915/gt/intel_context.c

a9877da2d629589 Chris Wilson      2019-07-16  449  
5e2a0419ef7cb25 Chris Wilson      2019-04-26  450  struct i915_request *intel_context_create_request(struct intel_context *ce)
5e2a0419ef7cb25 Chris Wilson      2019-04-26  451  {
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  452  	struct i915_gem_ww_ctx ww;
5e2a0419ef7cb25 Chris Wilson      2019-04-26  453  	struct i915_request *rq;
5e2a0419ef7cb25 Chris Wilson      2019-04-26  454  	int err;
5e2a0419ef7cb25 Chris Wilson      2019-04-26  455  
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  456  	i915_gem_ww_ctx_init(&ww, true);
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  457  retry:
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  458  	err = intel_context_pin_ww(ce, &ww);
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  459  	if (!err) {
5e2a0419ef7cb25 Chris Wilson      2019-04-26  460  		rq = i915_request_create(ce);
5e2a0419ef7cb25 Chris Wilson      2019-04-26  461  		intel_context_unpin(ce);
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  462  	} else if (err == -EDEADLK) {
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  463  		err = i915_gem_ww_ctx_backoff(&ww);
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  464  		if (!err)
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  465  			goto retry;
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  466  	} else {
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  467  		rq = ERR_PTR(err);
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  468  	}
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  469  
bf4a02b288a7a2f Maarten Lankhorst 2020-07-03  470  	i915_gem_ww_ctx_fini(&ww);
5e2a0419ef7cb25 Chris Wilson      2019-04-26  471  
2c5820855aff608 Maarten Lankhorst 2020-07-03 @472  	if (IS_ERR(rq))
2c5820855aff608 Maarten Lankhorst 2020-07-03  473  		return rq;
2c5820855aff608 Maarten Lankhorst 2020-07-03  474  
2c5820855aff608 Maarten Lankhorst 2020-07-03  475  	/*
2c5820855aff608 Maarten Lankhorst 2020-07-03  476  	 * timeline->mutex should be the inner lock, but is used as outer lock.
2c5820855aff608 Maarten Lankhorst 2020-07-03  477  	 * Hack around this to shut up lockdep in selftests..
2c5820855aff608 Maarten Lankhorst 2020-07-03  478  	 */
2c5820855aff608 Maarten Lankhorst 2020-07-03  479  	lockdep_unpin_lock(&ce->timeline->mutex, rq->cookie);
2c5820855aff608 Maarten Lankhorst 2020-07-03  480  	mutex_release(&ce->timeline->mutex.dep_map, _RET_IP_);
2c5820855aff608 Maarten Lankhorst 2020-07-03  481  	mutex_acquire(&ce->timeline->mutex.dep_map, SINGLE_DEPTH_NESTING, 0, _RET_IP_);
2c5820855aff608 Maarten Lankhorst 2020-07-03  482  	rq->cookie = lockdep_pin_lock(&ce->timeline->mutex);
2c5820855aff608 Maarten Lankhorst 2020-07-03  483  
5e2a0419ef7cb25 Chris Wilson      2019-04-26  484  	return rq;
5e2a0419ef7cb25 Chris Wilson      2019-04-26  485  }
d8af05ff38ae7a4 Chris Wilson      2019-08-02  486  

---
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 --]

             reply	other threads:[~2020-07-06  1:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-06  1:20 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 20/23] drm/i915: Use ww pinning for intel_context_create_request() 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 20/23] drm/i915: Use ww pinning for intel_context_create_request() Maarten Lankhorst
2020-07-07 14:35   ` Dan Carpenter
2020-07-07 14:35     ` 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=202007060919.2psbH4G5%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.