From: Sudeep Holla <sudeep.holla@arm.com>
To: LKML <linux-kernel@vger.kernel.org>,
Jassi Brar <jassisinghbrar@gmail.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>,
Alexey Klimov <alexey.klimov@arm.com>,
Jassi Brar <jaswinder.singh@linaro.org>
Subject: [PATCH 1/2] mailbox: reset txdone_method TXDONE_BY_POLL if client knows_txdone
Date: Fri, 30 Jun 2017 16:14:40 +0100 [thread overview]
Message-ID: <1498835681-23975-1-git-send-email-sudeep.holla@arm.com> (raw)
Currently the mailbox framework sets txdone_method to TXDONE_BY_POLL if
the controller sets txdone_by_poll. However some clients can have a
mechanism to do TXDONE_BY_ACK which they can specify by knows_txdone.
However, we endup setting both TXDONE_BY_POLL and TXDONE_BY_ACK in that
case. In such scenario, we may end up with below warnings as the tx
ticker is run both by mailbox framework and the client.
WARNING: CPU: 1 PID: 0 at kernel/time/hrtimer.c:805 hrtimer_forward+0x88/0xd8
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.12.0-rc5 #242
Hardware name: ARM LTD ARM Juno Development Platform
task: ffff8009768ca700 task.stack: ffff8009768f8000
PC is at hrtimer_forward+0x88/0xd8
LR is at txdone_hrtimer+0xd4/0xf8
Call trace:
hrtimer_forward+0x88/0xd8
__hrtimer_run_queues+0xe4/0x158
hrtimer_interrupt+0xa4/0x220
arch_timer_handler_phys+0x30/0x40
handle_percpu_devid_irq+0x78/0x130
generic_handle_irq+0x24/0x38
__handle_domain_irq+0x5c/0xb8
gic_handle_irq+0x54/0xa8
This patch fixes the issue by resetting TXDONE_BY_POLL if client has set
knows_txdone.
Cc: Alexey Klimov <alexey.klimov@arm.com>
Cc: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
drivers/mailbox/mailbox.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index 537f4f6d009b..8da30f833262 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -351,7 +351,7 @@ struct mbox_chan *mbox_request_channel(struct mbox_client *cl, int index)
init_completion(&chan->tx_complete);
if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
- chan->txdone_method |= TXDONE_BY_ACK;
+ chan->txdone_method = TXDONE_BY_ACK;
spin_unlock_irqrestore(&chan->lock, flags);
--
2.7.4
next reply other threads:[~2017-06-30 15:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 15:14 Sudeep Holla [this message]
2017-06-30 15:14 ` [PATCH 2/2] mailbox: mailbox-test: don't rely on rx_buffer content to signal data ready Sudeep Holla
2017-07-01 11:25 ` [PATCH 1/2] mailbox: reset txdone_method TXDONE_BY_POLL if client knows_txdone Jassi Brar
2017-07-03 8:57 ` Sudeep Holla
2017-07-03 9:35 ` Sudeep Holla
2017-07-03 11:50 ` Jassi Brar
2017-07-03 12:55 ` Sudeep Holla
2017-07-03 16:41 ` [UPDATE][PATCH " Sudeep Holla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1498835681-23975-1-git-send-email-sudeep.holla@arm.com \
--to=sudeep.holla@arm.com \
--cc=alexey.klimov@arm.com \
--cc=jassisinghbrar@gmail.com \
--cc=jaswinder.singh@linaro.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®