Patch "crypto: sun4i-ss - Replace spinlock_bh by spin_lock_irq{save|restore}" has been added to the 3.14-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
crypto: sun4i-ss - Replace spinlock_bh by spin_lock_irq{save|restore}to the 3.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
crypto-sun4i-ss-replace-spinlock_bh-by-spin_lock_irq-save-restore.patch
and it can be found in the queue-3.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
bdb6cf9f6fe6d9af905ea34b7c4bb78ea601329eMon Sep 17 00:00:00 2001
From: Corentin LABBE <[email protected]>
Date: Wed, 23 Mar 2016 16:11:24 +0100
Subject: crypto: sun4i-ss - Replace spinlock_bh by spin_lock_irq{save|restore}
From: Corentin LABBE <[email protected]>
commit bdb6cf9f6fe6d9af905ea34b7c4bb78ea601329e upstream.
The current sun4i-ss driver could generate data corruption when ciphering/deciphering. It occurs randomly on end of handled data.
No root cause have been found and the only way to remove it is to replace all spin_lock_bh by their irq counterparts.
drivers/crypto/sunxi-ss/sun4i-ss-cipher.c +6 -4
@@ -35,6 +35,7 @@ static int sun4i_ss_opti_poll(struct ablkcipher_request *areq)unsigned int todo;struct sg_mapping_iter mi, mo;unsigned int oi, oo;/* offset for in and out */ +unsigned long flags;if (areq->nbytes ==0 )return 0 ;
@@ -49,7 +50,7 @@ static int sun4i_ss_opti_poll(struct ablkcipher_request *areq)return -EINVAL ; } -spin_lock_bh (&ss->slock); +spin_lock_irqsave (&ss->slock, flags);for (i =0 ; i < op->keylen; i +=4 )writel (*(op->key + i /4 ), ss->base +SS_KEY0 + i);
@@ -117,7 +118,7 @@ release_ss:sg_miter_stop (&mi);sg_miter_stop (&mo);writel (0 , ss->base +SS_CTL ); -spin_unlock_bh (&ss->slock); +spin_unlock_irqrestore (&ss->slock, flags);return err; }
@@ -149,6 +150,7 @@ static int sun4i_ss_cipher_poll(struct ablkcipher_request *areq)unsigned int ob =0 ;/* offset in buf */ unsigned int obo =0 ;/* offset in bufo*/ unsigned int obl =0 ;/* length of data in bufo */ +unsigned long flags;if (areq->nbytes ==0 )return 0 ;
@@ -181,7 +183,7 @@ static int sun4i_ss_cipher_poll(struct ablkcipher_request *areq)if (no_chunk ==1 )return sun4i_ss_opti_poll (areq); -spin_lock_bh (&ss->slock); +spin_lock_irqsave (&ss->slock, flags);for (i =0 ; i < op->keylen; i +=4 )writel (*(op->key + i /4 ), ss->base +SS_KEY0 + i);
@@ -307,7 +309,7 @@ release_ss:sg_miter_stop (&mi);sg_miter_stop (&mo);writel (0 , ss->base +SS_CTL ); -spin_unlock_bh (&ss->slock); +spin_unlock_irqrestore (&ss->slock, flags);return err; }
Patches currently in stable-queue which might be from [email protected] are
queue-3.14/crypto-sun4i-ss-replace-spinlock_bh-by-spin_lock_irq-save-restore.patch