[PATCH 1/4] sync_file: add a mutex to protect fence and callback members. (fwd)

Julia Lawall julia.lawall at lip6.fr
Tue Mar 14 15:35:19 UTC 2017


Perhaps the mutex on line 410 needs to be considered on line 423.

julia

---------- Forwarded message ----------

Hi Dave,

[auto build test WARNING on drm/drm-next]
[also build test WARNING on v4.11-rc2 next-20170310]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Dave-Airlie/sync_file-add-a-mutex-to-protect-fence-and-callback-members/20170314-155609
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
:::::: branch date: 52 minutes ago
:::::: commit date: 52 minutes ago

>> drivers/dma-buf/sync_file.c:423:2-8: preceding lock on line 410

git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout a319d478cdd641742a07f809ddb7c143a0a685e9
vim +423 drivers/dma-buf/sync_file.c

d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  404  	if (copy_from_user(&info, (void __user *)arg, sizeof(info)))
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  405  		return -EFAULT;
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  406
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  407  	if (info.flags || info.pad)
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  408  		return -EINVAL;
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  409
a319d478 drivers/dma-buf/sync_file.c         Dave Airlie     2017-03-14 @410  	mutex_lock(&sync_file->lock);
a02b9dc9 drivers/dma-buf/sync_file.c         Gustavo Padovan 2016-08-05  411  	fences = get_fences(sync_file, &num_fences);
a02b9dc9 drivers/dma-buf/sync_file.c         Gustavo Padovan 2016-08-05  412
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  413  	/*
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  414  	 * Passing num_fences = 0 means that userspace doesn't want to
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  415  	 * retrieve any sync_fence_info. If num_fences = 0 we skip filling
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  416  	 * sync_fence_info and return the actual number of fences on
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  417  	 * info->num_fences.
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  418  	 */
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  419  	if (!info.num_fences)
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  420  		goto no_fences;
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  421
a02b9dc9 drivers/dma-buf/sync_file.c         Gustavo Padovan 2016-08-05  422  	if (info.num_fences < num_fences)
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28 @423  		return -EINVAL;
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  424
a02b9dc9 drivers/dma-buf/sync_file.c         Gustavo Padovan 2016-08-05  425  	size = num_fences * sizeof(*fence_info);
d4cab38e drivers/staging/android/sync_file.c Gustavo Padovan 2016-04-28  426  	fence_info = kzalloc(size, GFP_KERNEL);

:::::: The code at line 423 was first introduced by commit
:::::: d4cab38e153d62ecd502645390c0289c1b8337df staging/android: prepare sync_file for de-staging

:::::: TO: Gustavo Padovan <gustavo.padovan at collabora.co.uk>
:::::: CC: Greg Kroah-Hartman <gregkh at linuxfoundation.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation


More information about the amd-gfx mailing list