Gustavo Padovan | 1867a23 | 2016-05-31 16:59:05 -0300 | [diff] [blame] | 1 | /* |
Gustavo Padovan | e912c88 | 2016-08-11 12:26:42 -0300 | [diff] [blame] | 2 | * Sync File validation framework |
Gustavo Padovan | 1867a23 | 2016-05-31 16:59:05 -0300 | [diff] [blame] | 3 | * |
| 4 | * Copyright (C) 2012 Google, Inc. |
| 5 | * |
| 6 | * This software is licensed under the terms of the GNU General Public |
| 7 | * License version 2, as published by the Free Software Foundation, and |
| 8 | * may be copied, distributed, and modified under those terms. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | */ |
| 16 | |
| 17 | #include <linux/file.h> |
| 18 | #include <linux/fs.h> |
| 19 | #include <linux/uaccess.h> |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 20 | #include <linux/slab.h> |
Gustavo Padovan | 1867a23 | 2016-05-31 16:59:05 -0300 | [diff] [blame] | 21 | #include <linux/sync_file.h> |
| 22 | |
Gustavo Padovan | 1fe82e2 | 2016-05-31 16:59:12 -0300 | [diff] [blame] | 23 | #include "sync_debug.h" |
Gustavo Padovan | 1867a23 | 2016-05-31 16:59:05 -0300 | [diff] [blame] | 24 | |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 25 | #define CREATE_TRACE_POINTS |
Gustavo Padovan | a04f915 | 2016-08-11 12:26:41 -0300 | [diff] [blame] | 26 | #include "sync_trace.h" |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 27 | |
Gustavo Padovan | fc0c9a0 | 2016-08-11 13:45:53 -0300 | [diff] [blame] | 28 | /* |
| 29 | * SW SYNC validation framework |
| 30 | * |
| 31 | * A sync object driver that uses a 32bit counter to coordinate |
| 32 | * synchronization. Useful when there is no hardware primitive backing |
| 33 | * the synchronization. |
| 34 | * |
| 35 | * To start the framework just open: |
| 36 | * |
| 37 | * <debugfs>/sync/sw_sync |
| 38 | * |
| 39 | * That will create a sync timeline, all fences created under this timeline |
| 40 | * file descriptor will belong to the this timeline. |
| 41 | * |
| 42 | * The 'sw_sync' file can be opened many times as to create different |
| 43 | * timelines. |
| 44 | * |
| 45 | * Fences can be created with SW_SYNC_IOC_CREATE_FENCE ioctl with struct |
| 46 | * sw_sync_ioctl_create_fence as parameter. |
| 47 | * |
| 48 | * To increment the timeline counter, SW_SYNC_IOC_INC ioctl should be used |
| 49 | * with the increment as u32. This will update the last signaled value |
| 50 | * from the timeline and signal any fence that has a seqno smaller or equal |
| 51 | * to it. |
| 52 | * |
| 53 | * struct sw_sync_ioctl_create_fence |
| 54 | * @value: the seqno to initialise the fence with |
| 55 | * @name: the name of the new sync point |
| 56 | * @fence: return the fd of the new sync_file with the created fence |
| 57 | */ |
Gustavo Padovan | 6f65aa8 | 2016-05-31 16:59:08 -0300 | [diff] [blame] | 58 | struct sw_sync_create_fence_data { |
| 59 | __u32 value; |
| 60 | char name[32]; |
| 61 | __s32 fence; /* fd of new fence */ |
| 62 | }; |
| 63 | |
| 64 | #define SW_SYNC_IOC_MAGIC 'W' |
| 65 | |
| 66 | #define SW_SYNC_IOC_CREATE_FENCE _IOWR(SW_SYNC_IOC_MAGIC, 0,\ |
| 67 | struct sw_sync_create_fence_data) |
Gustavo Padovan | fc0c9a0 | 2016-08-11 13:45:53 -0300 | [diff] [blame] | 68 | |
Gustavo Padovan | 6f65aa8 | 2016-05-31 16:59:08 -0300 | [diff] [blame] | 69 | #define SW_SYNC_IOC_INC _IOW(SW_SYNC_IOC_MAGIC, 1, __u32) |
| 70 | |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 71 | static const struct dma_fence_ops timeline_fence_ops; |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 72 | |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 73 | static inline struct sync_pt *dma_fence_to_sync_pt(struct dma_fence *fence) |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 74 | { |
| 75 | if (fence->ops != &timeline_fence_ops) |
| 76 | return NULL; |
| 77 | return container_of(fence, struct sync_pt, base); |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * sync_timeline_create() - creates a sync object |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 82 | * @name: sync_timeline name |
| 83 | * |
| 84 | * Creates a new sync_timeline. Returns the sync_timeline object or NULL in |
| 85 | * case of error. |
| 86 | */ |
Baoyou Xie | 7488158 | 2016-09-18 20:49:21 +0800 | [diff] [blame] | 87 | static struct sync_timeline *sync_timeline_create(const char *name) |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 88 | { |
| 89 | struct sync_timeline *obj; |
| 90 | |
| 91 | obj = kzalloc(sizeof(*obj), GFP_KERNEL); |
| 92 | if (!obj) |
| 93 | return NULL; |
| 94 | |
| 95 | kref_init(&obj->kref); |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 96 | obj->context = dma_fence_context_alloc(1); |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 97 | strlcpy(obj->name, name, sizeof(obj->name)); |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 98 | |
| 99 | INIT_LIST_HEAD(&obj->child_list_head); |
| 100 | INIT_LIST_HEAD(&obj->active_list_head); |
| 101 | spin_lock_init(&obj->child_list_lock); |
| 102 | |
| 103 | sync_timeline_debug_add(obj); |
| 104 | |
| 105 | return obj; |
| 106 | } |
| 107 | |
| 108 | static void sync_timeline_free(struct kref *kref) |
| 109 | { |
| 110 | struct sync_timeline *obj = |
| 111 | container_of(kref, struct sync_timeline, kref); |
| 112 | |
| 113 | sync_timeline_debug_remove(obj); |
| 114 | |
| 115 | kfree(obj); |
| 116 | } |
| 117 | |
| 118 | static void sync_timeline_get(struct sync_timeline *obj) |
| 119 | { |
| 120 | kref_get(&obj->kref); |
| 121 | } |
| 122 | |
| 123 | static void sync_timeline_put(struct sync_timeline *obj) |
| 124 | { |
| 125 | kref_put(&obj->kref, sync_timeline_free); |
| 126 | } |
| 127 | |
| 128 | /** |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 129 | * sync_timeline_signal() - signal a status change on a sync_timeline |
| 130 | * @obj: sync_timeline to signal |
| 131 | * @inc: num to increment on timeline->value |
| 132 | * |
| 133 | * A sync implementation should call this any time one of it's fences |
| 134 | * has signaled or has an error condition. |
| 135 | */ |
| 136 | static void sync_timeline_signal(struct sync_timeline *obj, unsigned int inc) |
| 137 | { |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 138 | struct sync_pt *pt, *next; |
| 139 | |
| 140 | trace_sync_timeline(obj); |
| 141 | |
Chris Wilson | a6aa8fc | 2017-06-29 13:59:27 +0100 | [diff] [blame^] | 142 | spin_lock_irq(&obj->child_list_lock); |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 143 | |
| 144 | obj->value += inc; |
| 145 | |
| 146 | list_for_each_entry_safe(pt, next, &obj->active_list_head, |
| 147 | active_list) { |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 148 | if (dma_fence_is_signaled_locked(&pt->base)) |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 149 | list_del_init(&pt->active_list); |
| 150 | } |
| 151 | |
Chris Wilson | a6aa8fc | 2017-06-29 13:59:27 +0100 | [diff] [blame^] | 152 | spin_unlock_irq(&obj->child_list_lock); |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | /** |
| 156 | * sync_pt_create() - creates a sync pt |
| 157 | * @parent: fence's parent sync_timeline |
| 158 | * @size: size to allocate for this pt |
| 159 | * @inc: value of the fence |
| 160 | * |
| 161 | * Creates a new sync_pt as a child of @parent. @size bytes will be |
| 162 | * allocated allowing for implementation specific data to be kept after |
| 163 | * the generic sync_timeline struct. Returns the sync_pt object or |
| 164 | * NULL in case of error. |
| 165 | */ |
| 166 | static struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size, |
| 167 | unsigned int value) |
| 168 | { |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 169 | struct sync_pt *pt; |
| 170 | |
| 171 | if (size < sizeof(*pt)) |
| 172 | return NULL; |
| 173 | |
| 174 | pt = kzalloc(size, GFP_KERNEL); |
| 175 | if (!pt) |
| 176 | return NULL; |
| 177 | |
Chris Wilson | a6aa8fc | 2017-06-29 13:59:27 +0100 | [diff] [blame^] | 178 | spin_lock_irq(&obj->child_list_lock); |
| 179 | |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 180 | sync_timeline_get(obj); |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 181 | dma_fence_init(&pt->base, &timeline_fence_ops, &obj->child_list_lock, |
| 182 | obj->context, value); |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 183 | list_add_tail(&pt->child_list, &obj->child_list_head); |
| 184 | INIT_LIST_HEAD(&pt->active_list); |
Chris Wilson | a6aa8fc | 2017-06-29 13:59:27 +0100 | [diff] [blame^] | 185 | |
| 186 | spin_unlock_irq(&obj->child_list_lock); |
| 187 | |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 188 | return pt; |
| 189 | } |
| 190 | |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 191 | static const char *timeline_fence_get_driver_name(struct dma_fence *fence) |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 192 | { |
Gustavo Padovan | b9bc2b7 | 2016-05-31 16:59:11 -0300 | [diff] [blame] | 193 | return "sw_sync"; |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 194 | } |
| 195 | |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 196 | static const char *timeline_fence_get_timeline_name(struct dma_fence *fence) |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 197 | { |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 198 | struct sync_timeline *parent = dma_fence_parent(fence); |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 199 | |
| 200 | return parent->name; |
| 201 | } |
| 202 | |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 203 | static void timeline_fence_release(struct dma_fence *fence) |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 204 | { |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 205 | struct sync_pt *pt = dma_fence_to_sync_pt(fence); |
| 206 | struct sync_timeline *parent = dma_fence_parent(fence); |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 207 | unsigned long flags; |
| 208 | |
| 209 | spin_lock_irqsave(fence->lock, flags); |
Chris Wilson | a6aa8fc | 2017-06-29 13:59:27 +0100 | [diff] [blame^] | 210 | |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 211 | list_del(&pt->child_list); |
Gustavo Padovan | a4ebee6 | 2016-08-11 12:26:40 -0300 | [diff] [blame] | 212 | if (!list_empty(&pt->active_list)) |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 213 | list_del(&pt->active_list); |
Chris Wilson | a6aa8fc | 2017-06-29 13:59:27 +0100 | [diff] [blame^] | 214 | |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 215 | spin_unlock_irqrestore(fence->lock, flags); |
| 216 | |
| 217 | sync_timeline_put(parent); |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 218 | dma_fence_free(fence); |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 219 | } |
| 220 | |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 221 | static bool timeline_fence_signaled(struct dma_fence *fence) |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 222 | { |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 223 | struct sync_timeline *parent = dma_fence_parent(fence); |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 224 | |
Chris Wilson | 61894b0 | 2017-06-29 13:59:25 +0100 | [diff] [blame] | 225 | return !__dma_fence_is_later(fence->seqno, parent->value); |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 226 | } |
| 227 | |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 228 | static bool timeline_fence_enable_signaling(struct dma_fence *fence) |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 229 | { |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 230 | struct sync_pt *pt = dma_fence_to_sync_pt(fence); |
| 231 | struct sync_timeline *parent = dma_fence_parent(fence); |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 232 | |
| 233 | if (timeline_fence_signaled(fence)) |
| 234 | return false; |
| 235 | |
| 236 | list_add_tail(&pt->active_list, &parent->active_list_head); |
| 237 | return true; |
| 238 | } |
| 239 | |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 240 | static void timeline_fence_value_str(struct dma_fence *fence, |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 241 | char *str, int size) |
| 242 | { |
| 243 | snprintf(str, size, "%d", fence->seqno); |
| 244 | } |
| 245 | |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 246 | static void timeline_fence_timeline_value_str(struct dma_fence *fence, |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 247 | char *str, int size) |
| 248 | { |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 249 | struct sync_timeline *parent = dma_fence_parent(fence); |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 250 | |
| 251 | snprintf(str, size, "%d", parent->value); |
| 252 | } |
| 253 | |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 254 | static const struct dma_fence_ops timeline_fence_ops = { |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 255 | .get_driver_name = timeline_fence_get_driver_name, |
| 256 | .get_timeline_name = timeline_fence_get_timeline_name, |
| 257 | .enable_signaling = timeline_fence_enable_signaling, |
| 258 | .signaled = timeline_fence_signaled, |
Chris Wilson | f54d186 | 2016-10-25 13:00:45 +0100 | [diff] [blame] | 259 | .wait = dma_fence_default_wait, |
Gustavo Padovan | aff9da1 | 2016-05-31 16:59:07 -0300 | [diff] [blame] | 260 | .release = timeline_fence_release, |
| 261 | .fence_value_str = timeline_fence_value_str, |
| 262 | .timeline_value_str = timeline_fence_timeline_value_str, |
| 263 | }; |
| 264 | |
Gustavo Padovan | 1867a23 | 2016-05-31 16:59:05 -0300 | [diff] [blame] | 265 | /* |
| 266 | * *WARNING* |
| 267 | * |
| 268 | * improper use of this can result in deadlocking kernel drivers from userspace. |
| 269 | */ |
| 270 | |
| 271 | /* opening sw_sync create a new sync obj */ |
| 272 | static int sw_sync_debugfs_open(struct inode *inode, struct file *file) |
| 273 | { |
| 274 | struct sync_timeline *obj; |
| 275 | char task_comm[TASK_COMM_LEN]; |
| 276 | |
| 277 | get_task_comm(task_comm, current); |
| 278 | |
Gustavo Padovan | b9bc2b7 | 2016-05-31 16:59:11 -0300 | [diff] [blame] | 279 | obj = sync_timeline_create(task_comm); |
Gustavo Padovan | 1867a23 | 2016-05-31 16:59:05 -0300 | [diff] [blame] | 280 | if (!obj) |
| 281 | return -ENOMEM; |
| 282 | |
| 283 | file->private_data = obj; |
| 284 | |
| 285 | return 0; |
| 286 | } |
| 287 | |
| 288 | static int sw_sync_debugfs_release(struct inode *inode, struct file *file) |
| 289 | { |
| 290 | struct sync_timeline *obj = file->private_data; |
| 291 | |
Gustavo Padovan | 7111023 | 2016-05-31 16:59:10 -0300 | [diff] [blame] | 292 | smp_wmb(); |
| 293 | |
| 294 | sync_timeline_put(obj); |
Gustavo Padovan | 1867a23 | 2016-05-31 16:59:05 -0300 | [diff] [blame] | 295 | return 0; |
| 296 | } |
| 297 | |
| 298 | static long sw_sync_ioctl_create_fence(struct sync_timeline *obj, |
| 299 | unsigned long arg) |
| 300 | { |
| 301 | int fd = get_unused_fd_flags(O_CLOEXEC); |
| 302 | int err; |
| 303 | struct sync_pt *pt; |
| 304 | struct sync_file *sync_file; |
| 305 | struct sw_sync_create_fence_data data; |
| 306 | |
| 307 | if (fd < 0) |
| 308 | return fd; |
| 309 | |
| 310 | if (copy_from_user(&data, (void __user *)arg, sizeof(data))) { |
| 311 | err = -EFAULT; |
| 312 | goto err; |
| 313 | } |
| 314 | |
| 315 | pt = sync_pt_create(obj, sizeof(*pt), data.value); |
| 316 | if (!pt) { |
| 317 | err = -ENOMEM; |
| 318 | goto err; |
| 319 | } |
| 320 | |
| 321 | sync_file = sync_file_create(&pt->base); |
Gustavo Padovan | 4592bfc | 2016-10-26 18:59:59 -0200 | [diff] [blame] | 322 | dma_fence_put(&pt->base); |
Gustavo Padovan | 1867a23 | 2016-05-31 16:59:05 -0300 | [diff] [blame] | 323 | if (!sync_file) { |
Gustavo Padovan | 1867a23 | 2016-05-31 16:59:05 -0300 | [diff] [blame] | 324 | err = -ENOMEM; |
| 325 | goto err; |
| 326 | } |
| 327 | |
| 328 | data.fence = fd; |
| 329 | if (copy_to_user((void __user *)arg, &data, sizeof(data))) { |
| 330 | fput(sync_file->file); |
| 331 | err = -EFAULT; |
| 332 | goto err; |
| 333 | } |
| 334 | |
| 335 | fd_install(fd, sync_file->file); |
| 336 | |
| 337 | return 0; |
| 338 | |
| 339 | err: |
| 340 | put_unused_fd(fd); |
| 341 | return err; |
| 342 | } |
| 343 | |
| 344 | static long sw_sync_ioctl_inc(struct sync_timeline *obj, unsigned long arg) |
| 345 | { |
| 346 | u32 value; |
| 347 | |
| 348 | if (copy_from_user(&value, (void __user *)arg, sizeof(value))) |
| 349 | return -EFAULT; |
| 350 | |
Chris Wilson | 8f66d3a | 2017-06-29 13:59:26 +0100 | [diff] [blame] | 351 | while (value > INT_MAX) { |
| 352 | sync_timeline_signal(obj, INT_MAX); |
| 353 | value -= INT_MAX; |
| 354 | } |
| 355 | |
Gustavo Padovan | 1867a23 | 2016-05-31 16:59:05 -0300 | [diff] [blame] | 356 | sync_timeline_signal(obj, value); |
| 357 | |
| 358 | return 0; |
| 359 | } |
| 360 | |
| 361 | static long sw_sync_ioctl(struct file *file, unsigned int cmd, |
| 362 | unsigned long arg) |
| 363 | { |
| 364 | struct sync_timeline *obj = file->private_data; |
| 365 | |
| 366 | switch (cmd) { |
| 367 | case SW_SYNC_IOC_CREATE_FENCE: |
| 368 | return sw_sync_ioctl_create_fence(obj, arg); |
| 369 | |
| 370 | case SW_SYNC_IOC_INC: |
| 371 | return sw_sync_ioctl_inc(obj, arg); |
| 372 | |
| 373 | default: |
| 374 | return -ENOTTY; |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | const struct file_operations sw_sync_debugfs_fops = { |
| 379 | .open = sw_sync_debugfs_open, |
| 380 | .release = sw_sync_debugfs_release, |
| 381 | .unlocked_ioctl = sw_sync_ioctl, |
| 382 | .compat_ioctl = sw_sync_ioctl, |
| 383 | }; |