Skip to content

Commit

Permalink
usb: musb: cppi41: tweak hrtimer values
Browse files Browse the repository at this point in the history
Intensive tests with USB audio devices connected to a musb host port
have shown reproducible pops and clicks in both the playback and the
capture stream.

These are related to how the early_tx hrtimer is set up, and it turns
out they can be fixed by reducing the timer's slack value from 40 to
25 us. Also, when the callback is ran without taking action, it should
be rescheduled 20 us later instead of 50 us.

Reported-and-tested-by: Sven Neumann <[email protected]>
Signed-off-by: Daniel Mack <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
  • Loading branch information
zonque authored and Felipe Balbi committed Sep 5, 2014
1 parent eb11ada commit a5e4aa4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/usb/musb/musb_cppi41.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static enum hrtimer_restart cppi41_recheck_tx_req(struct hrtimer *timer)
if (!list_empty(&controller->early_tx_list)) {
ret = HRTIMER_RESTART;
hrtimer_forward_now(&controller->early_tx,
ktime_set(0, 50 * NSEC_PER_USEC));
ktime_set(0, 20 * NSEC_PER_USEC));
}

spin_unlock_irqrestore(&musb->lock, flags);
Expand Down Expand Up @@ -278,7 +278,7 @@ static void cppi41_dma_callback(void *private_data)

hrtimer_start_range_ns(&controller->early_tx,
ktime_set(0, usecs * NSEC_PER_USEC),
40 * NSEC_PER_USEC,
20 * NSEC_PER_USEC,
HRTIMER_MODE_REL);
}
}
Expand Down

0 comments on commit a5e4aa4

Please sign in to comment.