Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a09f746 authored by Lina Iyer's avatar Lina Iyer
Browse files

drivers: mailbox: add controller debug



Sometimes a client may detect that a channel has clogged up and is not
responding to requests in time. In such case, the client may want to
initiate a debug on the controller that might help debug and analyze the
reasons for the clog.

Change-Id: Ib15db652e780790f0eaa4f6ada7ad9defed99a65
Signed-off-by: default avatarLina Iyer <ilina@codeaurora.org>
parent 3b6ca7c9
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -332,6 +332,16 @@ bool mbox_controller_is_idle(struct mbox_chan *chan)
}
EXPORT_SYMBOL(mbox_controller_is_idle);


void mbox_chan_debug(struct mbox_chan *chan)
{
	if (!chan || !chan->cl || !chan->mbox->debug)
		return;

	return chan->mbox->debug(chan);
}
EXPORT_SYMBOL(mbox_chan_debug);

/**
 * mbox_request_channel - Request a mailbox channel.
 * @cl: Identity of the client requesting the channel.
+1 −0
Original line number Diff line number Diff line
@@ -49,5 +49,6 @@ void mbox_client_txdone(struct mbox_chan *chan, int r); /* atomic */
bool mbox_client_peek_data(struct mbox_chan *chan); /* atomic */
void mbox_free_channel(struct mbox_chan *chan); /* may sleep */
bool mbox_controller_is_idle(struct mbox_chan *chan); /* atomic */
void mbox_chan_debug(struct mbox_chan *chan);

#endif /* __MAILBOX_CLIENT_H */
+3 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ struct mbox_chan;
 *		  Used only if txdone_poll:=true && txdone_irq:=false
 * @peek_data: Atomic check for any received data. Return true if controller
 *		  has some data to push to the client. False otherwise.
 * @debug:	Allow chan to be debugged when the client detects a channel is
 *		locked up.
 */
struct mbox_chan_ops {
	int (*send_data)(struct mbox_chan *chan, void *data);
@@ -90,6 +92,7 @@ struct mbox_controller {
	struct mbox_chan *(*of_xlate)(struct mbox_controller *mbox,
				      const struct of_phandle_args *sp);
	bool (*is_idle)(struct mbox_controller *mbox);
	void (*debug)(struct mbox_chan *chan);
	/* Internal to API */
	struct hrtimer poll_hrt;
	struct list_head node;