crypto: talitos - Preempt overflow interrupts off-by-one fix
authorVishnu Suresh <Vishnu@freescale.com>
Mon, 20 Oct 2008 13:06:18 +0000 (21:06 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 25 Dec 2008 00:01:17 +0000 (11:01 +1100)
In commit ec6644d6325b5a38525f1d5b20fd4bf7db05cf2a "crypto: talitos - Preempt
overflow interrupts", the test in atomic_inc_not_zero was interpreted by the
author to be applied after the increment operation (not before). This off-by-one
fix prevents overflow error interrupts from occurring when requests are frequent
and large enough to do so.

Signed-off-by: Vishnu Suresh <Vishnu@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/talitos.c

index 16c97caa17acb1e0004e67672b34a6a2565dea7b..c3df3b1df857def2aa215fc532463d17b14c6af6 100644 (file)
@@ -1598,7 +1598,7 @@ static int talitos_probe(struct of_device *ofdev,
                goto err_out;
        }
        for (i = 0; i < priv->num_channels; i++)
-               atomic_set(&priv->submit_count[i], -priv->chfifo_len);
+               atomic_set(&priv->submit_count[i], -(priv->chfifo_len - 1));
 
        priv->head = kzalloc(sizeof(int) * priv->num_channels, GFP_KERNEL);
        priv->tail = kzalloc(sizeof(int) * priv->num_channels, GFP_KERNEL);