Lines Matching refs:wait

11 #include <linux/wait.h>
57 * @list: used to add/insert into QP/PQ wait lists
63 * @lock: lock protected head of wait queue
65 * @wait_dma: wait for sdma_busy == 0
66 * @wait_pio: wait for pio_busy == 0
71 * @flags: wait flags (one per QP)
72 * @wait: SE array for multiple legs
102 struct iowait_work *wait,
107 void (*wakeup)(struct iowait *wait, int reason);
108 void (*sdma_drained)(struct iowait *wait);
109 void (*init_priority)(struct iowait *wait);
121 struct iowait_work wait[IOWAIT_SES];
126 void iowait_set_flag(struct iowait *wait, u32 flag);
127 bool iowait_flag_set(struct iowait *wait, u32 flag);
128 void iowait_clear_flag(struct iowait *wait, u32 flag);
130 void iowait_init(struct iowait *wait, u32 tx_limit,
134 struct iowait_work *wait,
138 void (*wakeup)(struct iowait *wait, int reason),
139 void (*sdma_drained)(struct iowait *wait),
140 void (*init_priority)(struct iowait *wait));
144 * @wait: wait struct to schedule
148 static inline bool iowait_schedule(struct iowait *wait,
151 return !!queue_work_on(cpu, wq, &wait->wait[IOWAIT_IB_SE].iowork);
156 * @wait: the iowait structure
160 static inline bool iowait_tid_schedule(struct iowait *wait,
163 return !!queue_work_on(cpu, wq, &wait->wait[IOWAIT_TID_SE].iowork);
167 * iowait_sdma_drain() - wait for DMAs to drain
169 * @wait: iowait structure
174 static inline void iowait_sdma_drain(struct iowait *wait)
176 wait_event(wait->wait_dma, !atomic_read(&wait->sdma_busy));
182 * @wait: iowait structure
185 static inline int iowait_sdma_pending(struct iowait *wait)
187 return atomic_read(&wait->sdma_busy);
192 * @wait: iowait structure
194 static inline void iowait_sdma_inc(struct iowait *wait)
196 atomic_inc(&wait->sdma_busy);
201 * @wait: iowait structure
203 static inline void iowait_sdma_add(struct iowait *wait, int count)
205 atomic_add(count, &wait->sdma_busy);
210 * @wait: iowait structure
212 static inline int iowait_sdma_dec(struct iowait *wait)
214 if (!wait)
216 return atomic_dec_and_test(&wait->sdma_busy);
220 * iowait_pio_drain() - wait for pios to drain
222 * @wait: iowait structure
227 static inline void iowait_pio_drain(struct iowait *wait)
229 wait_event_timeout(wait->wait_pio,
230 !atomic_read(&wait->pio_busy),
237 * @wait: iowait structure
240 static inline int iowait_pio_pending(struct iowait *wait)
242 return atomic_read(&wait->pio_busy);
247 * @wait: iowait structure
249 static inline void iowait_pio_inc(struct iowait *wait)
251 atomic_inc(&wait->pio_busy);
256 * @wait: iowait structure
258 static inline int iowait_pio_dec(struct iowait *wait)
260 if (!wait)
262 return atomic_dec_and_test(&wait->pio_busy);
268 * @wait: iowait structure
272 static inline void iowait_drain_wakeup(struct iowait *wait)
274 wake_up(&wait->wait_dma);
275 wake_up(&wait->wait_pio);
276 if (wait->sdma_drained)
277 wait->sdma_drained(wait);
283 * @wait: iowait_work structure
285 static inline struct sdma_txreq *iowait_get_txhead(struct iowait_work *wait)
289 if (!list_empty(&wait->tx_head)) {
291 &wait->tx_head,
318 num_desc = iowait_get_desc(&w->wait[IOWAIT_IB_SE]);
319 num_desc += iowait_get_desc(&w->wait[IOWAIT_TID_SE]);
337 iowait_update_priority(&w->wait[IOWAIT_IB_SE]);
338 iowait_update_priority(&w->wait[IOWAIT_TID_SE]);
355 * iowait_queue - Put the iowait on a wait queue
358 * @wait_head: the wait queue
361 * wait queue after a resource (eg, sdma descriptor or pio
368 * To play fair, insert the iowait at the tail of the wait queue if it
385 * iowait_starve_clear - clear the wait queue's starve count
405 * @wait: the iowait_work structure
407 static inline bool iowait_packet_queued(struct iowait_work *wait)
409 return !list_empty(&wait->tx_head);
413 * inc_wait_count - increment wait counts
431 return &w->wait[IOWAIT_TID_SE];
440 return &w->wait[IOWAIT_IB_SE];