Testing the geode-aes driver with the tcrypt module completely freezes the machine
Subsystems (2)
Hello,
here is what I do:
- I have an AEWIN CB-6971 with an AMD Geode LX800.
- Testing with kernel 2.6.21-rc7-git5.
- When the geode_aes module is loaded and I am loading the tcrypt module, the machine freezes completely.
- When the geode_aes module is NOT loaded and I am loading the tcrypt module,
the test works well.
Has anyone else tried to test the geode-aes driver with the tcrypt module?
I am also not able to use the geode-aes driver with openswan-2.4.7 on kernel 2.6.19 (with patched-in geode driver).
Regards,
Martin
--------------------------
Martin Schiller
Dipl.-Inf. FH
Development
T.D.T. Transfer Data Test GmbH
Siemensstrasse 18
Gewerbegebiet Altheim
84051 Essenbach
Germany
[email protected]
www.tdt.de
tel: +49 8703 929 00
fax: +49 8703 929 201
Geschäftsführer: Elisabeth Pickhardt & Michael Pickhardt Registergericht Landshut, HRB: 1193
Quoted 2 lines · * Martin Schiller | 2007-04-26 11:04:21 [+0200]:
- When the
geode_aesmodule is loaded and I am loading the tcrypt module, the machine freezes completely.
could you modify the tcrpto module to test only ecb(aes) enc/dec with keysize = 16 (1 instead of AES_ENC_TEST_VECTORS) and see if it is still freezing?
Sebastian
Quoted 9 lines · Sebastian Siewior
Quoted 2 lines · * Martin Schiller | 2007-04-26 11:04:21 [+0200]:
- When the
geode_aesmodule is loaded and I am loading the tcrypt module, the machine freezes completely.could you modify the tcrpto module to test only ecb(aes) enc/dec with keysize = 16 (1 instead of
AES_ENC_TEST_VECTORS) and see if it is still freezing?
Tried it and it's still freezing.
Any other suggestions?
Regards,
Martin
--------------------------------
Martin Schiller
Dipl.-Inf. FH
Entwicklung / Development
T.D.T. Transfer Data Test GmbH
Siemensstrasse 18
Gewerbegebiet Altheim
84051 Essenbach
Germany
[email protected]
www.tdt.de
tel: +49 8703 929 00
fax: +49 8703 929 201
Geschäftsführer: Elisabeth Pickhardt & Michael Pickhardt Registergericht Landshut, HRB: 1193
Herbert Xu
maintainerQuoted 10 lines · Martin Schiller
here is what I do:
- I have an AEWIN CB-6971 with an AMD Geode LX800.
- Testing with kernel 2.6.21-rc7-git5.
- When the
geode_aesmodule is loaded and I am loading the tcrypt module, the machine freezes completely.
Quoted 8 lines
- When the
geode_aesmodule is NOT loaded and I am loading the tcrypt module,
the test works well.Has anyone else tried to test the geode-aes driver with the tcrypt module?
I am also not able to use the geode-aes driver with openswan-2.4.7 on kernel 2.6.19 (with patched-in geode driver).
Jordan, do you have any ideas why this is happening?
Cheers,
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtQuoted 6 lines · Herbert Xu
Quoted 4 lines
Has anyone else tried to test the geode-aes driver with the tcrypt module?
I am also not able to use the geode-aes driver with openswan-2.4.7 on kernel 2.6.19 (with patched-in geode driver).
Jordan, do you have any ideas why this is happening?
Could it be compiler problem and broken hardware?
Martin, can you test attached patch?
drivers/crypto/geode-aes.c +4 -2
@@ -78,7 +78,7 @@ static int do_crypt(void *src, void *dst, int len, u32 flags) {u32 status; -u32 counter =AES_OP_TIMEOUT ; +int counter =AES_OP_TIMEOUT ;iowrite32 (virt_to_phys (src), _iobase +AES_SOURCEA_REG );iowrite32 (virt_to_phys (dst), _iobase +AES_DSTA_REG );
@@ -89,7 +89,9 @@ do_crypt(void *src, void *dst, int len, u32 flags)do status =ioread32 (_iobase +AES_INTR_REG ); -while (!(status &AES_INTRA_PENDING ) && --counter); +while (--counter >0 && !(status &AES_INTRA_PENDING )); + +WARN_ON (!counter);/* Clear the event */ iowrite32 ((status &0xFF ) |AES_INTRA_PENDING , _iobase +AES_INTR_REG );
Signature · 1 line
Evgeniy Polyakov
Quoted 10 lines · Evgeniy Polyakov
Quoted 6 lines · Herbert Xu
Quoted 4 lines
Has anyone else tried to test the geode-aes driver with the tcrypt module?
I am also not able to use the geode-aes driver with openswan-2.4.7 on kernel 2.6.19 (with patched-in geode driver).
Jordan, do you have any ideas why this is happening?
Could it be compiler problem and broken hardware?
Martin, can you test attached patch?
Or better this one:
drivers/crypto/geode-aes.c +4 -2
@@ -78,7 +78,7 @@ static int do_crypt(void *src, void *dst, int len, u32 flags) {u32 status; -u32 counter =AES_OP_TIMEOUT ; +int counter =0x1000 ;iowrite32 (virt_to_phys (src), _iobase +AES_SOURCEA_REG );iowrite32 (virt_to_phys (dst), _iobase +AES_DSTA_REG );
@@ -89,7 +89,9 @@ do_crypt(void *src, void *dst, int len, u32 flags)do status =ioread32 (_iobase +AES_INTR_REG ); -while (!(status &AES_INTRA_PENDING ) && --counter); +while (--counter >0 && !(status &AES_INTRA_PENDING )); + +WARN_ON (!counter);/* Clear the event */ iowrite32 ((status &0xFF ) |AES_INTRA_PENDING , _iobase +AES_INTR_REG );
Signature · 1 line
Evgeniy Polyakov
Quoted 19 lines · Evgeniy Polyakov
Quoted 2 lines
Could it be compiler problem and broken hardware?
Martin, can you test attached patch?Or better this one:
drivers/crypto/geode-aes.c +1
-1@@ -78,7 +78,7 @@ static int do_crypt(void *src, void *dst, int len, u32 flags) {u32 status; -u32 counter =AES_OP_TIMEOUT ; +int counter =0x1000 ;iowrite32 (virt_to_phys (src), _iobase +AES_SOURCEA_REG );iowrite32 (virt_to_phys (dst), _iobase +AES_DSTA_REG );
drivers/crypto/geode-aes.c do_crypt(void *src, void *dst, int len, u32 flags) · line 97
Quoted 10 lines
drivers/crypto/geode-aes.c +3
-1@@ -89,7 +89,9 @@ do_crypt(void *src, void *dst, int len, u32 flags)do status =ioread32 (_iobase +AES_INTR_REG ); -while (!(status &AES_INTRA_PENDING ) && --counter); +while (--counter >0 && !(status &AES_INTRA_PENDING )); + +WARN_ON (!counter);/* Clear the event */ iowrite32((status & 0xFF) | AES_INTRA_PENDING, _iobase +
AES_INTR_REG);
Quoted 1 line
Hi Evgeniy,
Sorry for my late answer, but I didn't get your message because I haven't subscribed to the mailing-list.
I've "found" it yesterday on the mailing-list archive. So please, could you reply directly to me and to the mailing-list on any further messages?
I've tested the patch now, but nothing changed. When doing any aes cipher tests with the tcrypt test module, the machine freezes without any error.
Regards,
Martin
Quoted 1 line · Martin Schiller
Hi Evgeniy,
Hi Martin.
Quoted 4 lines
Sorry for my late answer, but I didn't get your message because I haven't subscribed to the mailing-list.
I've "found" it yesterday on the mailing-list archive. So please, could you reply directly to me and to the mailing-list on any further messages?
I did, but your mail server bounced message.
This message is also sent to you directly, hope it will pass through. Btw, AMD list bounces too.
Quoted 2 lines
I've tested the patch now, but nothing changed. When doing any aes cipher tests with the tcrypt test module, the machine freezes without any error.
Hmm, that means that main waiting loop of the driver is not an issue. Since it is PCI, likely bus is locked by incorrect written value into the space. Can you run with this patch (it will freeze too, but at least with some useful info), since AMD keeps silence, we will go hard way:
drivers/crypto/geode-aes.c +13 -2
@@ -61,8 +61,10 @@ static inline void _writefield(u32 offset, void *value) { int i; +printk ("%s: start, offset: %x.\n" , __func__, offset);for (i =0 ; i <4 ; i++)iowrite32 (((u32 *) value)[i], _iobase + offset + (i *4 )); +printk ("%s: finish, offset: %x.\n" , __func__, offset); }/* Read a 128 bit field (either a writable key or IV) */
@@ -70,8 +72,10 @@ static inline void _readfield(u32 offset, void *value) { int i; +printk ("%s: start, offset: %x.\n" , __func__, offset);for (i =0 ; i <4 ; i++) ((u32 *) value)[i] =ioread32 (_iobase + offset + (i *4 )); +printk ("%s: finish, offset: %x.\n" , __func__, offset); } static int
@@ -80,19 +84,24 @@ do_crypt(void *src, void *dst, int len, u32 flags)u32 status;u32 counter =AES_OP_TIMEOUT ; +printk ("%s: src: %p, dst: %p, len: %d, flags: %x\n" , __func__, src, dst, len, flags);iowrite32 (virt_to_phys (src), _iobase +AES_SOURCEA_REG );iowrite32 (virt_to_phys (dst), _iobase +AES_DSTA_REG );iowrite32 (len, _iobase +AES_LENA_REG ); +printk ("%s: start op, likely will freeze.\n" , __func__);/* Start the operation */ iowrite32 (AES_CTRL_START | flags, _iobase +AES_CTRLA_REG ); +printk ("%s: started, but we are stil alive.\n" , __func__); -do +do { status =ioread32 (_iobase +AES_INTR_REG ); -while (!(status &AES_INTRA_PENDING ) && --counter); +printk ("%s: status: %x, counter: %u.\n" , __func__, status, counter); + }while (!(status &AES_INTRA_PENDING ) && --counter);/* Clear the event */ iowrite32 ((status &0xFF ) |AES_INTRA_PENDING , _iobase +AES_INTR_REG ); +printk ("%s: completed.\n" , __func__);return counter ?0 :1 ; }
@@ -113,6 +122,7 @@ geode_aes_crypt(struct geode_aes_op *op)/* Start the critical section */ +printk ("%s: start.\n" , __func__);spin_lock_irqsave (&lock, iflags);if (op->mode ==AES_MODE_CBC ) {
@@ -131,6 +141,7 @@ geode_aes_crypt(struct geode_aes_op *op)_readfield (AES_WRITEIV0_REG , op->iv);spin_unlock_irqrestore (&lock, iflags); +printk ("%s: completed.\n" , __func__);return op->len; }
Signature · 1 line
Evgeniy Polyakov