// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) /* * Copyright(c) 2018 Intel Corporation. * */ #include "iowait.h" #include "trace_iowait.h" /* 1 priority == 16 starve_cnt */ #define IOWAIT_PRIORITY_STARVE_SHIFT … void iowait_set_flag(struct iowait *wait, u32 flag) { … } bool iowait_flag_set(struct iowait *wait, u32 flag) { … } inline void iowait_clear_flag(struct iowait *wait, u32 flag) { … } /* * iowait_init() - initialize wait structure * @wait: wait struct to initialize * @tx_limit: limit for overflow queuing * @func: restart function for workqueue * @sleep: sleep function for no space * @resume: wakeup function for no space * * This function initializes the iowait * structure embedded in the QP or PQ. * */ void iowait_init(struct iowait *wait, u32 tx_limit, void (*func)(struct work_struct *work), void (*tidfunc)(struct work_struct *work), int (*sleep)(struct sdma_engine *sde, struct iowait_work *wait, struct sdma_txreq *tx, uint seq, bool pkts_sent), void (*wakeup)(struct iowait *wait, int reason), void (*sdma_drained)(struct iowait *wait), void (*init_priority)(struct iowait *wait)) { … } /** * iowait_cancel_work - cancel all work in iowait * @w: the iowait struct */ void iowait_cancel_work(struct iowait *w) { … } /** * iowait_set_work_flag - set work flag based on leg * @w: the iowait work struct */ int iowait_set_work_flag(struct iowait_work *w) { … } /** * iowait_priority_update_top - update the top priority entry * @w: the iowait struct * @top: a pointer to the top priority entry * @idx: the index of the current iowait in an array * @top_idx: the array index for the iowait entry that has the top priority * * This function is called to compare the priority of a given * iowait with the given top priority entry. The top index will * be returned. */ uint iowait_priority_update_top(struct iowait *w, struct iowait *top, uint idx, uint top_idx) { … }