tree:
git://people.freedesktop.org/~mlankhorst/linux locking-rework
head: c19d2554f1d542e2aac63116de7321ef2bb09672
commit: 0069ee1958917c4bd2503cc6a749f414c5fa74a0 [13/36] drm/i915: Fix userptr so we do
not have to worry about obj->mm.lock
config: i386-randconfig-a006-20200918 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce (this is a W=1 build):
git checkout 0069ee1958917c4bd2503cc6a749f414c5fa74a0
# save the attached .config to linux build tree
make W=1 ARCH=i386
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/rhashtable-types.h:14,
from include/linux/ipc.h:7,
from include/uapi/linux/sem.h:5,
from include/linux/sem.h:5,
from include/linux/sched.h:15,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/dma-mapping.h:7,
from include/linux/iova.h:16,
from include/linux/intel-iommu.h:14,
from drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:7:
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c: In function 'eb_move_to_gpu':
> drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2255:52: error:
'struct i915_gem_mm' has no member named 'notifier_lock'
2255 |
!(err = mutex_lock_interruptible(&eb->i915->mm.notifier_lock))) {
| ^
include/linux/mutex.h:168:72: note: in definition of macro
'mutex_lock_interruptible'
168 | #define mutex_lock_interruptible(lock) mutex_lock_interruptible_nested(lock,
0)
| ^~~~
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c:2270:29: error: 'struct
i915_gem_mm' has no member named 'notifier_lock'
2270 | mutex_unlock(&eb->i915->mm.notifier_lock);
| ^
git remote add mlankhorst
git://people.freedesktop.org/~mlankhorst/linux
git fetch --no-tags mlankhorst locking-rework
git checkout 0069ee1958917c4bd2503cc6a749f414c5fa74a0
vim +2255 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
2201
2202 static int eb_move_to_gpu(struct i915_execbuffer *eb)
2203 {
2204 const unsigned int count = eb->buffer_count;
2205 unsigned int i = count;
2206 int err = 0;
2207
2208 while (i--) {
2209 struct eb_vma *ev = &eb->vma[i];
2210 struct i915_vma *vma = ev->vma;
2211 unsigned int flags = ev->flags;
2212 struct drm_i915_gem_object *obj = vma->obj;
2213
2214 assert_vma_held(vma);
2215
2216 if (flags & EXEC_OBJECT_CAPTURE) {
2217 struct i915_capture_list *capture;
2218
2219 capture = kmalloc(sizeof(*capture), GFP_KERNEL);
2220 if (capture) {
2221 capture->next = eb->request->capture_list;
2222 capture->vma = vma;
2223 eb->request->capture_list = capture;
2224 }
2225 }
2226
2227 /*
2228 * If the GPU is not _reading_ through the CPU cache, we need
2229 * to make sure that any writes (both previous GPU writes from
2230 * before a change in snooping levels and normal CPU writes)
2231 * caught in that cache are flushed to main memory.
2232 *
2233 * We want to say
2234 * obj->cache_dirty &&
2235 * !(obj->cache_coherent & I915_BO_CACHE_COHERENT_FOR_READ)
2236 * but gcc's optimiser doesn't handle that as well and emits
2237 * two jumps instead of one. Maybe one day...
2238 */
2239 if (unlikely(obj->cache_dirty & ~obj->cache_coherent)) {
2240 if (i915_gem_clflush_object(obj, 0))
2241 flags &= ~EXEC_OBJECT_ASYNC;
2242 }
2243
2244 if (err == 0 && !(flags & EXEC_OBJECT_ASYNC)) {
2245 err = i915_request_await_object
2246 (eb->request, obj, flags & EXEC_OBJECT_WRITE);
2247 }
2248
2249 if (err == 0)
2250 err = i915_vma_move_to_active(vma, eb->request,
2251 flags | __EXEC_OBJECT_NO_RESERVE);
2252 }
2253
2254 if (!err && (eb->args->flags & __EXEC_USERPTR_USED) &&
2255 !(err =
mutex_lock_interruptible(&eb->i915->mm.notifier_lock))) {
2256 i =
count;
2257
2258 while (i--) {
2259 struct eb_vma *ev = &eb->vma[i];
2260 struct drm_i915_gem_object *obj = ev->vma->obj;
2261
2262 if (!i915_gem_object_is_userptr(obj))
2263 continue;
2264
2265 err = i915_gem_object_userptr_submit_done(obj);
2266 if (err)
2267 break;
2268 }
2269
2270 mutex_unlock(&eb->i915->mm.notifier_lock);
2271 }
2272
2273 if (unlikely(err))
2274 goto err_skip;
2275
2276 /* Unconditionally flush any chipset caches (for streaming writes). */
2277 intel_gt_chipset_flush(eb->engine->gt);
2278 return 0;
2279
2280 err_skip:
2281 i915_request_set_error_once(eb->request, err);
2282 return err;
2283 }
2284
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org