1
0
Fork 0
Commit Graph

5 Commits (5d0b6e48cbef3219c0ed75e0e746c4ed259303c2)

Author SHA1 Message Date
Thierry Reding a8803d7421 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>
2018-12-21 22:31:26 -06:00
Thierry Reding e898d9cdd3 mailbox: Add device-managed registration functions
Add device-managed equivalents of the mbox_controller_register() and
mbox_controller_unregister() functions that can be used to have the
devres infrastructure automatically unregister mailbox controllers on
driver probe failure or driver removal. This can help remove a lot of
boiler plate code from drivers.

Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2018-12-21 16:49:25 -06:00
Sudeep Holla 0cc67945ea mailbox: switch to hrtimer for tx_complete polling
The mailbox core uses jiffy based timer to handle polling for the
transmit completion. If the client/protocol have/support notification
of the last packet transmit completion via ACK packet, then we tick the
Tx state machine immediately in the callback. However if the client
doesn't support that mechanism we might end-up waiting for atleast a
jiffy even though the remote is ready to receive the next request.

This patch switches the timer used for that polling from jiffy-based
to hrtimer-based so that we can support polling at much higher time
resolution.

Reported-and-suggested-by: Juri Lelli <Juri.Lelli@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2015-08-10 14:29:27 +05:30
Andrew Bresticker 05ae797566 mailbox: Make mbox_chan_ops const
The mailbox controller's channel ops ought to be read-only.  Update
all the mailbox drivers to make their mbox_chan_ops const as well.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Cc: Ashwin Chaugule <ashwin.chaugule@linaro.org>
Cc: Ley Foon Tan <lftan@altera.com>
Acked-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2015-05-12 09:18:16 +05:30
Jassi Brar 2b6d83e2b8 mailbox: Introduce framework for mailbox
Introduce common framework for client/protocol drivers and
controller drivers of Inter-Processor-Communication (IPC).

Client driver developers should have a look at
 include/linux/mailbox_client.h to understand the part of
the API exposed to client drivers.
Similarly controller driver developers should have a look
at include/linux/mailbox_controller.h

Reviewed-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
2014-10-08 10:39:41 +05:30