On Mon, Jun 15, 2015 at 04:52:49PM -0700, Victoria Milhoan wrote:
>
> @@ -177,10 +180,19 @@ static void caam_jr_dequeue(unsigned long devarg)
>
> sw_idx = tail = jrp->tail;
> 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);
>
> + /*
> + * Ensure that tail is read before using it as part of
> + * the index into the software ring.
> + */
> + smp_read_barrier_depends();
> +
> if (jrp->outring[hw_idx].desc ==
> jrp->entinfo[sw_idx].desc_addr_dma)
> break; /* found */
smp_read_barrier_depends should be avoided and replaced with RCU
helpers where possible. So what you could do here is mark jrp->tail
as rcu and then use the correct RCU helper to access it which will
do the smp_rad_barrier_depends for you.
Thanks,
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html