mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-30 02:21:15 +00:00
mailbox: Support blocking transfers in atomic context
The mailbox framework supports blocking transfers via completions for clients that can sleep. In order to support blocking transfers in cases where the transmission is not permitted to sleep, add a new ->flush() callback that controller drivers can implement to busy loop until the transmission has been completed. A new mbox_flush() function can be called by mailbox consumers in atomic context to make sure a transfer has completed. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
This commit is contained in:
parent
2298a6f09f
commit
a8803d7421
3 changed files with 33 additions and 0 deletions
|
@ -24,6 +24,9 @@ struct mbox_chan;
|
|||
* transmission of data is reported by the controller via
|
||||
* mbox_chan_txdone (if it has some TX ACK irq). It must not
|
||||
* sleep.
|
||||
* @flush: Called when a client requests transmissions to be blocking but
|
||||
* the context doesn't allow sleeping. Typically the controller
|
||||
* will implement a busy loop waiting for the data to flush out.
|
||||
* @startup: Called when a client requests the chan. The controller
|
||||
* could ask clients for additional parameters of communication
|
||||
* to be provided via client's chan_data. This call may
|
||||
|
@ -46,6 +49,7 @@ struct mbox_chan;
|
|||
*/
|
||||
struct mbox_chan_ops {
|
||||
int (*send_data)(struct mbox_chan *chan, void *data);
|
||||
int (*flush)(struct mbox_chan *chan, unsigned long timeout);
|
||||
int (*startup)(struct mbox_chan *chan);
|
||||
void (*shutdown)(struct mbox_chan *chan);
|
||||
bool (*last_tx_done)(struct mbox_chan *chan);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue