Commit 1e6e7f2b authored by Steve Cornelius's avatar Steve Cornelius Committed by Jason Liu

ENGR00234401: CAAM: Fix incorrect invalidate call for output ring

The job ring driver exhibited a hang condition in the top of
caam_jr_dequeue() where a BUG_ON statement looks for a condition
where the output ring is said to have valid entries by the ring logic,
but the ring entries apparently have NULL descriptor pointers.

In the initial ARM port of this driver, the cache flush call
of the output ring content occured before the output ring read index
register read occurred, exposing a condition where the driver sensed valid
output entries, yet the entries written by the ring hardware were not
invalidated, and therefore were not visible to the processor, appearing
as false NULL entries.

This patch relocates the invalidate call to immediately follow the
check of the output read index, where it is required.
Signed-off-by: default avatarVicki Milhoan <vicki.milhoan@freescale.com>
Signed-off-by: default avatarSteve Cornelius <steve.cornelius@freescale.com>
Signed-off-by: default avatarTerry Lv <r65388@freescale.com>
parent ce7d1e92
......@@ -62,9 +62,6 @@ static void caam_jr_dequeue(unsigned long devarg)
unsigned long flags;
outbusaddr = rd_reg64(&jrp->rregs->outring_base);
dma_sync_single_for_cpu(dev, outbusaddr,
sizeof(struct jr_outentry) * JOBR_DEPTH,
DMA_FROM_DEVICE);
spin_lock_irqsave(&jrp->outlock, flags);
......@@ -75,6 +72,10 @@ static void caam_jr_dequeue(unsigned long devarg)
rd_reg32(&jrp->rregs->outring_used)) {
hw_idx = jrp->out_ring_read_index;
dma_sync_single_for_cpu(dev, outbusaddr,
sizeof(struct jr_outentry) * JOBR_DEPTH,
DMA_FROM_DEVICE);
for (i = 0; CIRC_CNT(head, tail + i, JOBR_DEPTH) >= 1; i++) {
sw_idx = (tail + i) & (JOBR_DEPTH - 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment