Lines Matching refs:wait
52 #include <linux/wait.h>
98 * @list: used to add/insert into QP/PQ wait lists
104 * @lock: lock protected head of wait queue
106 * @wait_dma: wait for sdma_busy == 0
107 * @wait_pio: wait for pio_busy == 0
112 * @flags: wait flags (one per QP)
113 * @wait: SE array for multiple legs
143 struct iowait_work *wait,
148 void (*wakeup)(struct iowait *wait, int reason);
149 void (*sdma_drained)(struct iowait *wait);
150 void (*init_priority)(struct iowait *wait);
162 struct iowait_work wait[IOWAIT_SES];
167 void iowait_set_flag(struct iowait *wait, u32 flag);
168 bool iowait_flag_set(struct iowait *wait, u32 flag);
169 void iowait_clear_flag(struct iowait *wait, u32 flag);
171 void iowait_init(struct iowait *wait, u32 tx_limit,
175 struct iowait_work *wait,
179 void (*wakeup)(struct iowait *wait, int reason),
180 void (*sdma_drained)(struct iowait *wait),
181 void (*init_priority)(struct iowait *wait));
185 * @wait: wait struct to schedule
189 static inline bool iowait_schedule(struct iowait *wait,
192 return !!queue_work_on(cpu, wq, &wait->wait[IOWAIT_IB_SE].iowork);
197 * @wait: the iowait structure
201 static inline bool iowait_tid_schedule(struct iowait *wait,
204 return !!queue_work_on(cpu, wq, &wait->wait[IOWAIT_TID_SE].iowork);
208 * iowait_sdma_drain() - wait for DMAs to drain
210 * @wait: iowait structure
215 static inline void iowait_sdma_drain(struct iowait *wait)
217 wait_event(wait->wait_dma, !atomic_read(&wait->sdma_busy));
223 * @wait: iowait structure
226 static inline int iowait_sdma_pending(struct iowait *wait)
228 return atomic_read(&wait->sdma_busy);
233 * @wait: iowait structure
235 static inline void iowait_sdma_inc(struct iowait *wait)
237 atomic_inc(&wait->sdma_busy);
242 * @wait: iowait structure
244 static inline void iowait_sdma_add(struct iowait *wait, int count)
246 atomic_add(count, &wait->sdma_busy);
251 * @wait: iowait structure
253 static inline int iowait_sdma_dec(struct iowait *wait)
255 if (!wait)
257 return atomic_dec_and_test(&wait->sdma_busy);
261 * iowait_pio_drain() - wait for pios to drain
263 * @wait: iowait structure
268 static inline void iowait_pio_drain(struct iowait *wait)
270 wait_event_timeout(wait->wait_pio,
271 !atomic_read(&wait->pio_busy),
278 * @wait: iowait structure
281 static inline int iowait_pio_pending(struct iowait *wait)
283 return atomic_read(&wait->pio_busy);
288 * @wait: iowait structure
290 static inline void iowait_pio_inc(struct iowait *wait)
292 atomic_inc(&wait->pio_busy);
297 * @wait: iowait structure
299 static inline int iowait_pio_dec(struct iowait *wait)
301 if (!wait)
303 return atomic_dec_and_test(&wait->pio_busy);
309 * @wait: iowait structure
313 static inline void iowait_drain_wakeup(struct iowait *wait)
315 wake_up(&wait->wait_dma);
316 wake_up(&wait->wait_pio);
317 if (wait->sdma_drained)
318 wait->sdma_drained(wait);
324 * @wait iowait_work struture
326 static inline struct sdma_txreq *iowait_get_txhead(struct iowait_work *wait)
330 if (!list_empty(&wait->tx_head)) {
332 &wait->tx_head,
359 num_desc = iowait_get_desc(&w->wait[IOWAIT_IB_SE]);
360 num_desc += iowait_get_desc(&w->wait[IOWAIT_TID_SE]);
378 iowait_update_priority(&w->wait[IOWAIT_IB_SE]);
379 iowait_update_priority(&w->wait[IOWAIT_TID_SE]);
396 * iowait_queue - Put the iowait on a wait queue
399 * @wait_head: the wait queue
402 * wait queue after a resource (eg, sdma descriptor or pio
409 * To play fair, insert the iowait at the tail of the wait queue if it
426 * iowait_starve_clear - clear the wait queue's starve count
446 * @wait: the iowait_work structure
448 static inline bool iowait_packet_queued(struct iowait_work *wait)
450 return !list_empty(&wait->tx_head);
454 * inc_wait_count - increment wait counts
472 return &w->wait[IOWAIT_TID_SE];
481 return &w->wait[IOWAIT_IB_SE];