diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2020-10-29 19:42:29 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-29 19:42:29 -0300 |
commit | 1a578877cf48eb96b5c8554873cdee756ae16c7e (patch) | |
tree | 10978aa5e09161d68426acc33554450032ceda65 /drivers/mailbox/mailbox.c | |
parent | 859f1281231fd3c1ca687bb517748daa19eaf402 (diff) | |
parent | 8081974b75314b3f52a7afee916c352319261a16 (diff) |
Merge pull request #160 from zandrey/5.4-2.1.x-imx
Update 5.4-2.1.x-imx to v5.4.73 from stable
Diffstat (limited to 'drivers/mailbox/mailbox.c')
-rw-r--r-- | drivers/mailbox/mailbox.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c index 0b821a5b2db8..3e7d4b20ab34 100644 --- a/drivers/mailbox/mailbox.c +++ b/drivers/mailbox/mailbox.c @@ -82,9 +82,12 @@ static void msg_submit(struct mbox_chan *chan) exit: spin_unlock_irqrestore(&chan->lock, flags); - if (!err && (chan->txdone_method & TXDONE_BY_POLL)) - /* kick start the timer immediately to avoid delays */ - hrtimer_start(&chan->mbox->poll_hrt, 0, HRTIMER_MODE_REL); + /* kick start the timer immediately to avoid delays */ + if (!err && (chan->txdone_method & TXDONE_BY_POLL)) { + /* but only if not already active */ + if (!hrtimer_active(&chan->mbox->poll_hrt)) + hrtimer_start(&chan->mbox->poll_hrt, 0, HRTIMER_MODE_REL); + } } static void tx_tick(struct mbox_chan *chan, int r) @@ -122,11 +125,10 @@ static enum hrtimer_restart txdone_hrtimer(struct hrtimer *hrtimer) struct mbox_chan *chan = &mbox->chans[i]; if (chan->active_req && chan->cl) { + resched = true; txdone = chan->mbox->ops->last_tx_done(chan); if (txdone) tx_tick(chan, 0); - else - resched = true; } } |