summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/include
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2018-02-06 07:36:47 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2018-02-14 07:52:47 -0500
commit1582bdb5eeff44a93f53987080a652910d51c3c4 (patch)
tree85e55ae9c929dbe1acdd72ee84ba318a421d15f5 /drivers/gpu/nvgpu/include
parenteb03270ff65b0fa52d080c2e8700acdf42b9ddee (diff)
gpu: nvgpu: delete nvgpu_semaphore_int list
The hw semas in a sema pool are stored in a list. All elements in this list are freed in a loop when a semaphore pool is destroyed. However, each hw sema is always owned by a channel, and each such channel frees its hw sema during channel closure before putting a ref to the VM which holds a ref to the sema pool, so the lifetime of all the hw semas is shorter than that of the pool and this list is always empty when freeing the pool. Delete the list and this freeing loop. Meanwhile delete also the nr_incrs member in nvgpu_semaphore_int that is never accessed. Jira NVGPU-512 Change-Id: Ie072029f9e7cc749141e9f02ef45fdf64358ad96 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1653540 Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/include')
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/semaphore.h12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/include/nvgpu/semaphore.h b/drivers/gpu/nvgpu/include/nvgpu/semaphore.h
index d36a3270..a4af1ca3 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/semaphore.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/semaphore.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2014-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2014-2018, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a 4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"), 5 * copy of this software and associated documentation files (the "Software"),
@@ -58,17 +58,8 @@ struct nvgpu_semaphore_int {
58 int idx; /* Semaphore index. */ 58 int idx; /* Semaphore index. */
59 u32 offset; /* Offset into the pool. */ 59 u32 offset; /* Offset into the pool. */
60 nvgpu_atomic_t next_value; /* Next available value. */ 60 nvgpu_atomic_t next_value; /* Next available value. */
61 u32 nr_incrs; /* Number of increments programmed. */
62 struct nvgpu_semaphore_pool *p; /* Pool that owns this sema. */ 61 struct nvgpu_semaphore_pool *p; /* Pool that owns this sema. */
63 struct channel_gk20a *ch; /* Channel that owns this sema. */ 62 struct channel_gk20a *ch; /* Channel that owns this sema. */
64 struct nvgpu_list_node hw_sema_list; /* List of HW semaphores. */
65};
66
67static inline struct nvgpu_semaphore_int *
68nvgpu_semaphore_int_from_hw_sema_list(struct nvgpu_list_node *node)
69{
70 return (struct nvgpu_semaphore_int *)
71 ((uintptr_t)node - offsetof(struct nvgpu_semaphore_int, hw_sema_list));
72}; 63};
73 64
74/* 65/*
@@ -94,7 +85,6 @@ struct nvgpu_semaphore_pool {
94 u64 gpu_va_ro; /* GPU access to the pool. */ 85 u64 gpu_va_ro; /* GPU access to the pool. */
95 int page_idx; /* Index into sea bitmap. */ 86 int page_idx; /* Index into sea bitmap. */
96 87
97 struct nvgpu_list_node hw_semas; /* List of HW semas. */
98 DECLARE_BITMAP(semas_alloced, PAGE_SIZE / SEMAPHORE_SIZE); 88 DECLARE_BITMAP(semas_alloced, PAGE_SIZE / SEMAPHORE_SIZE);
99 89
100 struct nvgpu_semaphore_sea *sema_sea; /* Sea that owns this pool. */ 90 struct nvgpu_semaphore_sea *sema_sea; /* Sea that owns this pool. */