linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Martin Schiller <mschiller@tdt.de>
Cc: linux-crypto@vger.kernel.org
Subject: Re: Testing the geode-aes driver with the tcrypt module completely freezes the machine
Date: Thu, 3 May 2007 11:57:44 +0400	[thread overview]
Message-ID: <20070503075744.GC17966@2ka.mipt.ru> (raw)
In-Reply-To: <000301c78d4b$0f9ab810$1a04010a@V505CP>

On Thu, May 03, 2007 at 08:19:52AM +0200, Martin Schiller (mschiller@tdt.de) wrote:
> Hi Evgeniy,

Hi Martin.

> 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.

> 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:

diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
index 6d3840e..6ddfab9 100644
--- a/drivers/crypto/geode-aes.c
+++ b/drivers/crypto/geode-aes.c
@@ -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;
 }


-- 
	Evgeniy Polyakov

  reply	other threads:[~2007-05-03  7:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-26  9:04 Testing the geode-aes driver with the tcrypt module completely freezes the machine Martin Schiller
2007-04-26 11:05 ` Sebastian Siewior
2007-04-26 11:27   ` Martin Schiller
2007-04-27  8:10 ` Herbert Xu
2007-04-27  9:50   ` Evgeniy Polyakov
2007-04-27  9:53     ` Evgeniy Polyakov
2007-05-03  6:19   ` Martin Schiller
2007-05-03  7:57     ` Evgeniy Polyakov [this message]
2007-05-03 13:12 Martin Schiller
2007-05-03 13:23 ` Evgeniy Polyakov
2007-05-03 13:49   ` Herbert Xu
2007-05-03 14:47     ` Jordan Crouse
2007-05-03 16:53       ` Evgeniy Polyakov
2007-05-03 14:08   ` Martin Schiller
2007-05-03 14:47     ` Evgeniy Polyakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070503075744.GC17966@2ka.mipt.ru \
    --to=johnpol@2ka.mipt.ru \
    --cc=linux-crypto@vger.kernel.org \
    --cc=mschiller@tdt.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).