aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma-buf/sync_file.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-10-22 08:36:53 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-22 08:39:14 -0400
commitf8ddadc4db6c7b7029b6d0e0d9af24f74ad27ca2 (patch)
tree0a6432aba336bae42313613f4c891bcfce02bd4e /drivers/dma-buf/sync_file.c
parentbdd091bab8c631bd2801af838e344fad34566410 (diff)
parentb5ac3beb5a9f0ef0ea64cd85faf94c0dc4de0e42 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
There were quite a few overlapping sets of changes here. Daniel's bug fix for off-by-ones in the new BPF branch instructions, along with the added allowances for "data_end > ptr + x" forms collided with the metadata additions. Along with those three changes came veritifer test cases, which in their final form I tried to group together properly. If I had just trimmed GIT's conflict tags as-is, this would have split up the meta tests unnecessarily. In the socketmap code, a set of preemption disabling changes overlapped with the rename of bpf_compute_data_end() to bpf_compute_data_pointers(). Changes were made to the mv88e6060.c driver set addr method which got removed in net-next. The hyperv transport socket layer had a locking change in 'net' which overlapped with a change of socket state macro usage in 'net-next'. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/dma-buf/sync_file.c')
-rw-r--r--drivers/dma-buf/sync_file.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index 66fb40d0ebdb..03830634e141 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -383,7 +383,7 @@ err_put_fd:
383 return err; 383 return err;
384} 384}
385 385
386static void sync_fill_fence_info(struct dma_fence *fence, 386static int sync_fill_fence_info(struct dma_fence *fence,
387 struct sync_fence_info *info) 387 struct sync_fence_info *info)
388{ 388{
389 strlcpy(info->obj_name, fence->ops->get_timeline_name(fence), 389 strlcpy(info->obj_name, fence->ops->get_timeline_name(fence),
@@ -399,6 +399,8 @@ static void sync_fill_fence_info(struct dma_fence *fence,
399 test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags) ? 399 test_bit(DMA_FENCE_FLAG_TIMESTAMP_BIT, &fence->flags) ?
400 ktime_to_ns(fence->timestamp) : 400 ktime_to_ns(fence->timestamp) :
401 ktime_set(0, 0); 401 ktime_set(0, 0);
402
403 return info->status;
402} 404}
403 405
404static long sync_file_ioctl_fence_info(struct sync_file *sync_file, 406static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
@@ -424,8 +426,12 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
424 * sync_fence_info and return the actual number of fences on 426 * sync_fence_info and return the actual number of fences on
425 * info->num_fences. 427 * info->num_fences.
426 */ 428 */
427 if (!info.num_fences) 429 if (!info.num_fences) {
430 info.status = dma_fence_is_signaled(sync_file->fence);
428 goto no_fences; 431 goto no_fences;
432 } else {
433 info.status = 1;
434 }
429 435
430 if (info.num_fences < num_fences) 436 if (info.num_fences < num_fences)
431 return -EINVAL; 437 return -EINVAL;
@@ -435,8 +441,10 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
435 if (!fence_info) 441 if (!fence_info)
436 return -ENOMEM; 442 return -ENOMEM;
437 443
438 for (i = 0; i < num_fences; i++) 444 for (i = 0; i < num_fences; i++) {
439 sync_fill_fence_info(fences[i], &fence_info[i]); 445 int status = sync_fill_fence_info(fences[i], &fence_info[i]);
446 info.status = info.status <= 0 ? info.status : status;
447 }
440 448
441 if (copy_to_user(u64_to_user_ptr(info.sync_fence_info), fence_info, 449 if (copy_to_user(u64_to_user_ptr(info.sync_fence_info), fence_info,
442 size)) { 450 size)) {
@@ -446,7 +454,6 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
446 454
447no_fences: 455no_fences:
448 sync_file_get_name(sync_file, info.name, sizeof(info.name)); 456 sync_file_get_name(sync_file, info.name, sizeof(info.name));
449 info.status = dma_fence_is_signaled(sync_file->fence);
450 info.num_fences = num_fences; 457 info.num_fences = num_fences;
451 458
452 if (copy_to_user((void __user *)arg, &info, sizeof(info))) 459 if (copy_to_user((void __user *)arg, &info, sizeof(info)))