wcte43x, wcte13xp, wcaxx: Bump irqmisses counter when there are DMA underruns.

This makes the behavior of IRQ misses for these drivers behave the same as the
wcte12xp, wctdm24xxp, and wct4xxp drivers.

Previously irqmisses would never increase. The presence of underruns would still
show up in dmesg as latency bumps.

Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
This commit is contained in:
Shaun Ruffell 2014-01-22 12:24:04 -06:00 committed by Russ Meyerriecks
parent 1f024713ed
commit 4cd09feb54
4 changed files with 27 additions and 0 deletions

View File

@ -3864,9 +3864,16 @@ static void wcaxx_back_out_gracefully(struct wcaxx *wc)
kfree(wc); kfree(wc);
} }
static void wcaxx_handle_error(struct wcxb *xb)
{
struct wcaxx *wc = container_of(xb, struct wcaxx, xb);
wc->ddev->irqmisses++;
}
static const struct wcxb_operations wcxb_operations = { static const struct wcxb_operations wcxb_operations = {
.handle_receive = wcaxx_handle_receive, .handle_receive = wcaxx_handle_receive,
.handle_transmit = wcaxx_handle_transmit, .handle_transmit = wcaxx_handle_transmit,
.handle_error = wcaxx_handle_error,
}; };
struct cmd_results { struct cmd_results {

View File

@ -115,10 +115,17 @@ static void te13x_handle_transmit(struct wcxb *xb, void *vfp);
static void te13x_handle_receive(struct wcxb *xb, void *vfp); static void te13x_handle_receive(struct wcxb *xb, void *vfp);
static void te13x_handle_interrupt(struct wcxb *xb, u32 pending); static void te13x_handle_interrupt(struct wcxb *xb, u32 pending);
static void te13x_handle_error(struct wcxb *xb)
{
struct t13x *wc = container_of(xb, struct t13x, xb);
wc->ddev->irqmisses++;
}
static struct wcxb_operations xb_ops = { static struct wcxb_operations xb_ops = {
.handle_receive = te13x_handle_receive, .handle_receive = te13x_handle_receive,
.handle_transmit = te13x_handle_transmit, .handle_transmit = te13x_handle_transmit,
.handle_interrupt = te13x_handle_interrupt, .handle_interrupt = te13x_handle_interrupt,
.handle_error = te13x_handle_error,
}; };
/* Maintenance Mode Registers */ /* Maintenance Mode Registers */

View File

@ -144,10 +144,17 @@ static void t43x_handle_transmit(struct wcxb *xb, void *vfp);
static void t43x_handle_receive(struct wcxb *xb, void *vfp); static void t43x_handle_receive(struct wcxb *xb, void *vfp);
static void t43x_handle_interrupt(struct wcxb *xb, u32 pending); static void t43x_handle_interrupt(struct wcxb *xb, u32 pending);
static void t43x_handle_error(struct wcxb *xb)
{
struct t43x *wc = container_of(xb, struct t43x, xb);
wc->ddev->irqmisses++;
}
static struct wcxb_operations xb_ops = { static struct wcxb_operations xb_ops = {
.handle_receive = t43x_handle_receive, .handle_receive = t43x_handle_receive,
.handle_transmit = t43x_handle_transmit, .handle_transmit = t43x_handle_transmit,
.handle_interrupt = t43x_handle_interrupt, .handle_interrupt = t43x_handle_interrupt,
.handle_error = t43x_handle_error,
}; };
/* Maintenance Mode Registers */ /* Maintenance Mode Registers */

View File

@ -397,6 +397,12 @@ static irqreturn_t _wcxb_isr(int irq, void *dev_id)
if (pending & DESC_UNDERRUN) { if (pending & DESC_UNDERRUN) {
u32 reg; u32 reg;
/* Report the error in case drivers have any custom
* methods for indicating potential data corruption. An
* underrun means data loss in the TDM channel. */
if (xb->ops->handle_error)
xb->ops->handle_error(xb);
/* bump latency */ /* bump latency */
spin_lock(&xb->lock); spin_lock(&xb->lock);