diff options
Diffstat (limited to 'drivers/media/video/cx18/cx18-mailbox.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-mailbox.c | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/drivers/media/video/cx18/cx18-mailbox.c b/drivers/media/video/cx18/cx18-mailbox.c index abd39aaa345..79647c6d6c5 100644 --- a/drivers/media/video/cx18/cx18-mailbox.c +++ b/drivers/media/video/cx18/cx18-mailbox.c @@ -462,13 +462,6 @@ void cx18_api_epu_cmd_irq(struct cx18 *cx, int rpu) * Functions called from a non-interrupt, non work_queue context */ -static void cx18_api_log_ack_delay(struct cx18 *cx, int msecs) -{ - if (msecs > CX18_MAX_MB_ACK_DELAY) - msecs = CX18_MAX_MB_ACK_DELAY; - atomic_inc(&cx->mbox_stats.mb_ack_delay[msecs]); -} - static int cx18_api_call(struct cx18 *cx, u32 cmd, int args, u32 data[]) { const struct cx18_api_info *info = find_api_info(cmd); @@ -523,7 +516,7 @@ static int cx18_api_call(struct cx18 *cx, u32 cmd, int args, u32 data[]) */ state = cx18_readl(cx, xpu_state); req = cx18_readl(cx, &mb->request); - timeout = msecs_to_jiffies(20); /* 1 field at 50 Hz vertical refresh */ + timeout = msecs_to_jiffies(10); ret = wait_event_timeout(*waitq, (ack = cx18_readl(cx, &mb->ack)) == req, timeout); @@ -533,8 +526,8 @@ static int cx18_api_call(struct cx18 *cx, u32 cmd, int args, u32 data[]) CX18_ERR("mbox was found stuck busy when setting up for %s; " "clearing busy and trying to proceed\n", info->name); } else if (ret != timeout) - CX18_DEBUG_API("waited %u usecs for busy mbox to be acked\n", - jiffies_to_usecs(timeout-ret)); + CX18_DEBUG_API("waited %u msecs for busy mbox to be acked\n", + jiffies_to_msecs(timeout-ret)); /* Build the outgoing mailbox */ req = ((req & 0xfffffffe) == 0xfffffffe) ? 1 : req + 1; @@ -548,10 +541,8 @@ static int cx18_api_call(struct cx18 *cx, u32 cmd, int args, u32 data[]) /* * Notify the XPU and wait for it to send an Ack back - * 21 ms = ~ 0.5 frames at a frame rate of 24 fps - * 42 ms = ~ 1 frame at a frame rate of 24 fps */ - timeout = msecs_to_jiffies((info->flags & API_FAST) ? 21 : 42); + timeout = msecs_to_jiffies((info->flags & API_FAST) ? 10 : 20); CX18_DEBUG_HI_IRQ("sending interrupt SW1: %x to send %s\n", irq, info->name); @@ -561,27 +552,19 @@ static int cx18_api_call(struct cx18 *cx, u32 cmd, int args, u32 data[]) *waitq, cx18_readl(cx, &mb->ack) == cx18_readl(cx, &mb->request), timeout); + if (ret == 0) { /* Timed out */ mutex_unlock(mb_lock); - i = jiffies_to_msecs(timeout); - cx18_api_log_ack_delay(cx, i); CX18_WARN("sending %s timed out waiting %d msecs for RPU " - "acknowledgement\n", info->name, i); + "acknowledgement\n", + info->name, jiffies_to_msecs(timeout)); return -EINVAL; - } else if (ret < 0) { - /* Interrupted */ - mutex_unlock(mb_lock); - CX18_WARN("sending %s was interrupted waiting for RPU" - "acknowledgement\n", info->name); - return -EINTR; } - i = jiffies_to_msecs(timeout-ret); - cx18_api_log_ack_delay(cx, i); if (ret != timeout) CX18_DEBUG_HI_API("waited %u msecs for %s to be acked\n", - i, info->name); + jiffies_to_msecs(timeout-ret), info->name); /* Collect data returned by the XPU */ for (i = 0; i < MAX_MB_ARGUMENTS; i++) |