[UPDATE PATCH 8/many] acrypto: crypto_dev.c

From: Nishanth Aravamudan
Date: Mon Mar 07 2005 - 21:00:00 EST


On Tue, Mar 08, 2005 at 02:27:20AM +0300, Evgeniy Polyakov wrote:
> On Mon, 7 Mar 2005 14:51:21 -0800
> Nish Aravamudan <nish.aravamudan@xxxxxxxxx> wrote:
>
> > On Tue, 8 Mar 2005 02:14:31 +0300, Evgeniy Polyakov <johnpol@xxxxxxxxxxx> wrote:
> > > On Mon, 7 Mar 2005 14:40:52 -0800
> > > Nish Aravamudan <nish.aravamudan@xxxxxxxxx> wrote:
> > >
> > > > On Mon, 7 Mar 2005 23:37:34 +0300, Evgeniy Polyakov <johnpol@xxxxxxxxxxx> wrote:
> > > > > --- /tmp/empty/crypto_dev.c 1970-01-01 03:00:00.000000000 +0300
> > > > > +++ ./acrypto/crypto_dev.c 2005-03-07 20:35:36.000000000 +0300
> > > > > @@ -0,0 +1,421 @@
> > > > > +/*
> > > > > + * crypto_dev.c
> > > >
> > > > <snip>
> > > >
> > > > > + while (atomic_read(&__dev->refcnt)) {
> >
> > <snip>
> >
> > > > > + set_current_state(TASK_UNINTERRUPTIBLE);
> > > > > + schedule_timeout(HZ);
> > > >
> > > > I don't see any wait-queues in the immediate area of this code. Can
> > > > this be an ssleep(1)?
> > >
> > > Yes, you are right, this loop just spins until all pending sessions
> > > are removed from given crypto device, so it can just ssleep(1) here.
> >
> > Would you like me to send an incremental patch or will you be changing
> > it yourself?
>
> That would be nice to see your changes in the acrypto.
> If it will be commited...

Well, here is an incremental patch, then:

Description: Use ssleep() instead of schedule_timeout() to guarantee the
task delays as expected.

Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>


--- 2.6.11-v/acrypto/crypto_dev.c 2005-03-07 17:41:31.000000000 -0800
+++ 2.6.11/acrypto/crypto_dev.c 2005-03-07 17:41:57.000000000 -0800
@@ -28,6 +28,7 @@
#include <linux/interrupt.h>
#include <linux/spinlock.h>
#include <linux/device.h>
+#include <linux/delay.h>

#include "acrypto.h"

@@ -399,8 +400,7 @@ void crypto_device_remove(struct crypto_
*/

__dev->data_ready(__dev);
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(HZ);
+ ssleep(1);
}

dprintk(KERN_ERR "Crypto device %s was unregistered.\n",
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/