diff options
Diffstat (limited to 'drivers/crypto/geode-aes.c')
-rw-r--r-- | drivers/crypto/geode-aes.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c index 6c04f1363e6d..6c6a31b979be 100644 --- a/drivers/crypto/geode-aes.c +++ b/drivers/crypto/geode-aes.c | |||
@@ -88,9 +88,10 @@ do_crypt(void *src, void *dst, int len, u32 flags) | |||
88 | /* Start the operation */ | 88 | /* Start the operation */ |
89 | iowrite32(AES_CTRL_START | flags, _iobase + AES_CTRLA_REG); | 89 | iowrite32(AES_CTRL_START | flags, _iobase + AES_CTRLA_REG); |
90 | 90 | ||
91 | do | 91 | do { |
92 | status = ioread32(_iobase + AES_INTR_REG); | 92 | status = ioread32(_iobase + AES_INTR_REG); |
93 | while(!(status & AES_INTRA_PENDING) && --counter); | 93 | cpu_relax(); |
94 | } while(!(status & AES_INTRA_PENDING) && --counter); | ||
94 | 95 | ||
95 | /* Clear the event */ | 96 | /* Clear the event */ |
96 | iowrite32((status & 0xFF) | AES_INTRA_PENDING, _iobase + AES_INTR_REG); | 97 | iowrite32((status & 0xFF) | AES_INTRA_PENDING, _iobase + AES_INTR_REG); |
@@ -102,6 +103,7 @@ geode_aes_crypt(struct geode_aes_op *op) | |||
102 | { | 103 | { |
103 | u32 flags = 0; | 104 | u32 flags = 0; |
104 | unsigned long iflags; | 105 | unsigned long iflags; |
106 | int ret; | ||
105 | 107 | ||
106 | if (op->len == 0) | 108 | if (op->len == 0) |
107 | return 0; | 109 | return 0; |
@@ -130,7 +132,8 @@ geode_aes_crypt(struct geode_aes_op *op) | |||
130 | _writefield(AES_WRITEKEY0_REG, op->key); | 132 | _writefield(AES_WRITEKEY0_REG, op->key); |
131 | } | 133 | } |
132 | 134 | ||
133 | do_crypt(op->src, op->dst, op->len, flags); | 135 | ret = do_crypt(op->src, op->dst, op->len, flags); |
136 | BUG_ON(ret); | ||
134 | 137 | ||
135 | if (op->mode == AES_MODE_CBC) | 138 | if (op->mode == AES_MODE_CBC) |
136 | _readfield(AES_WRITEIV0_REG, op->iv); | 139 | _readfield(AES_WRITEIV0_REG, op->iv); |