Rev 5270 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5270 | Rev 6082 | ||
---|---|---|---|
Line 75... | Line 75... | ||
75 | struct rcu_head rcu; |
75 | struct rcu_head rcu; |
76 | struct list_head cb_list; |
76 | struct list_head cb_list; |
77 | spinlock_t *lock; |
77 | spinlock_t *lock; |
78 | unsigned context, seqno; |
78 | unsigned context, seqno; |
79 | unsigned long flags; |
79 | unsigned long flags; |
80 | // ktime_t timestamp; |
80 | ktime_t timestamp; |
81 | int status; |
81 | int status; |
82 | }; |
82 | }; |
Line 83... | Line 83... | ||
83 | 83 | ||
84 | enum fence_flag_bits { |
84 | enum fence_flag_bits { |
Line 278... | Line 278... | ||
278 | 278 | ||
279 | return false; |
279 | return false; |
Line 280... | Line 280... | ||
280 | } |
280 | } |
- | 281 | ||
- | 282 | /** |
|
- | 283 | * fence_is_later - return if f1 is chronologically later than f2 |
|
- | 284 | * @f1: [in] the first fence from the same context |
|
- | 285 | * @f2: [in] the second fence from the same context |
|
- | 286 | * |
|
- | 287 | * Returns true if f1 is chronologically later than f2. Both fences must be |
|
- | 288 | * from the same context, since a seqno is not re-used across contexts. |
|
- | 289 | */ |
|
- | 290 | static inline bool fence_is_later(struct fence *f1, struct fence *f2) |
|
- | 291 | { |
|
- | 292 | if (WARN_ON(f1->context != f2->context)) |
|
- | 293 | return false; |
|
- | 294 | ||
- | 295 | return f1->seqno - f2->seqno < INT_MAX; |
|
- | 296 | } |
|
281 | 297 | ||
282 | /** |
298 | /** |
283 | * fence_later - return the chronologically later fence |
299 | * fence_later - return the chronologically later fence |
284 | * @f1: [in] the first fence from the same context |
300 | * @f1: [in] the first fence from the same context |
285 | * @f2: [in] the second fence from the same context |
301 | * @f2: [in] the second fence from the same context |
Line 296... | Line 312... | ||
296 | /* |
312 | /* |
297 | * can't check just FENCE_FLAG_SIGNALED_BIT here, it may never have been |
313 | * can't check just FENCE_FLAG_SIGNALED_BIT here, it may never have been |
298 | * set if enable_signaling wasn't called, and enabling that here is |
314 | * set if enable_signaling wasn't called, and enabling that here is |
299 | * overkill. |
315 | * overkill. |
300 | */ |
316 | */ |
301 | if (f2->seqno - f1->seqno <= INT_MAX) |
- | |
302 | return fence_is_signaled(f2) ? NULL : f2; |
317 | if (fence_is_later(f1, f2)) |
303 | else |
- | |
304 | return fence_is_signaled(f1) ? NULL : f1; |
318 | return fence_is_signaled(f1) ? NULL : f1; |
- | 319 | else |
|
- | 320 | return fence_is_signaled(f2) ? NULL : f2; |
|
305 | } |
321 | } |
Line 306... | Line 322... | ||
306 | 322 | ||
307 | signed long fence_wait_timeout(struct fence *, bool intr, signed long timeout); |
- | |
- | 323 | signed long fence_wait_timeout(struct fence *, bool intr, signed long timeout); |
|
- | 324 | signed long fence_wait_any_timeout(struct fence **fences, uint32_t count, |
|
Line 308... | Line 325... | ||
308 | 325 | bool intr, signed long timeout); |
|
309 | 326 | ||
310 | /** |
327 | /** |
311 | * fence_wait - sleep until the fence gets signaled |
328 | * fence_wait - sleep until the fence gets signaled |