public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Maximilian Engelhardt <maxi@daemonizer.de>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: nigel@nigel.suspend2.net,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Pavel Machek <pavel@ucw.cz>
Subject: Re: software suspend doesn't work with 2.6.22-rc3
Date: Mon, 28 May 2007 23:02:28 +0200	[thread overview]
Message-ID: <200705282302.31227.maxi@daemonizer.de> (raw)
In-Reply-To: <200705282021.30355.rjw@sisk.pl>

[-- Attachment #1: Type: text/plain, Size: 6621 bytes --]

On Monday 28 May 2007, Rafael J. Wysocki wrote:
> On Monday, 28 May 2007 09:59, Rafael J. Wysocki wrote:
> > On Monday, 28 May 2007 02:21, Maximilian Engelhardt wrote:
> > > On Sunday 27 May 2007, Rafael J. Wysocki wrote:
> > > > On Sunday, 27 May 2007 22:41, Maximilian Engelhardt wrote:
> > > > > On Sunday 27 May 2007, Rafael J. Wysocki wrote:
> > > > > > On Sunday, 27 May 2007 18:01, Maximilian Engelhardt wrote:
> > > > > > > On Saturday 26 May 2007, Nigel Cunningham wrote:
> > > > > > > > Hi.
> > > > > > > >
> > > > > > > > On Sat, 2007-05-26 at 14:49 +0200, Maximilian Engelhardt 
wrote:
> > > > > > > > > On Saturday 26 May 2007, Nigel Cunningham wrote:
> > > > > > > > > > Hi.
> > > > > > > > > >
> > > > > > > > > > On Sat, 2007-05-26 at 11:28 +0200, Maximilian Engelhardt 
wrote:
> > > > > > > > > > > Hello,
> > > > > > > > > > >
> > > > > > > > > > > When I try software suspend on my laptop it always
> > > > > > > > > > > returns to my running system after some time.
> > > > > > > > > > > This is what's logged by the kernel:
> > > > > > > > > > >
> > > > > > > > > > > swsusp: Basic memory bitmaps created
> > > > > > > > > > > Stopping tasks ...
> > > > > > > > > > > Stopping kernel threads timed out after 20 seconds (1
> > > > > > > > > > > tasks refusing to freeze):
> > > > > > > > > > >  cryptd
> > > > > > > > > > > Restarting tasks ... done.
> > > > > > > > > > > swsusp: Basic memory bitmaps freed
> > > > > > > > > > >
> > > > > > > > > > > I have no idea what's the problem, but if you tell me
> > > > > > > > > > > what I should do I can create debugging information
> > > > > > > > > > > and/or test patches.
> > > > > > > > > >
> > > > > > > > > > Could you try this patch, please? It should help.
> > > > > > > > > >
> > > > > > > > > > Herbert, is this right? If cryptd is going to be used for
> > > > > > > > > > block devs, the task should probably be PF_NOFREEZE (or
> > > > > > > > > > whatever it is today) instead.
> > > > > > > > > >
> > > > > > > > > > Regards,
> > > > > > > > > >
> > > > > > > > > > Nigel
> > > > > > > > > >
> > > > > > > > > >  crypto/cryptd.c         |    1 +
> > > > > > > > > >  include/linux/freezer.h |    3 +++
> > > > > > > > > >  kernel/power/process.c  |    2 +-
> > > > > > > > > >  3 files changed, 5 insertions(+), 1 deletion(-)
> > > > > > > > > > diff -ruNp 991-fix-cryptd.patch-old/crypto/cryptd.c
> > > > > > > > > > 991-fix-cryptd.patch-new/crypto/cryptd.c ---
> > > > > > > > > > 991-fix-cryptd.patch-old/crypto/cryptd.c	2007-05-19
> > > > > > > > > > 18:16:47.000000000 +1000 +++
> > > > > > > > > > 991-fix-cryptd.patch-new/crypto/cryptd.c	2007-05-26
> > > > > > > > > > 19:45:42.000000000 +1000 @@ -341,6 +341,7 @@ static int
> > > > > > > > > > cryptd_thread(void *data)
> > > > > > > > > >
> > > > > > > > > >  		mutex_unlock(&state->mutex);
> > > > > > > > > >
> > > > > > > > > > +		try_to_freeze();
> > > > > > > > > >  		schedule();
> > > > > > > > > >  	} while (!stop);
> > > > > > > > >
> > > > > > > > > I tried your patch, but when I apply it my kernel doesn't
> > > > > > > > > compile any more. I get these warnings/errors:
> > > > > > > > >
> > > > > > > > > [...]
> > > > > > > > >   CC      crypto/cryptd.o
> > > > > > > > > crypto/cryptd.c: In function ‘cryptd_thread’:
> > > > > > > > > crypto/cryptd.c:344: warning: implicit declaration of
> > > > > > > > > function ‘try_to_freeze’ [...]
> > > > > > > > >   LD      init/built-in.o
> > > > > > > > >   LD      .tmp_vmlinux1
> > > > > > > > > crypto/built-in.o: In function `cryptd_thread':
> > > > > > > > > cryptd.c:(.text+0xd7f5): undefined reference to
> > > > > > > > > `try_to_freeze' make: *** [.tmp_vmlinux1] Error 1
> > > > > > > >
> > > > > > > > Ah. You'll need to add #include <linux/freezer.h> near that
> > > > > > > > start of crypto/cryptd.c. Sorry for forgetting that.
> > > > > > > >
> > > > > > > > Nigel
> > > > > > >
> > > > > > > I added the include line and now I could compile the kernel,
> > > > > > > but suspending still doesn't work.
> > > > > > >
> > > > > > > swsusp: Basic memory bitmaps created
> > > > > > > Stopping tasks ...
> > > > > > > Stopping kernel threads timed out after 20 seconds (1 tasks
> > > > > > > refusing to freeze):
> > > > > > > cryptd
> > > > > > > Restarting tasks ... done.
> > > > > > > swsusp: Basic memory bitmaps freed
> > > > > >
> > > > > > OK, this means that cryptd doesn't execute the try_to_freeze()
> > > > > > for some reason.
> > > > > >
> > > > > > Please apply the appended patch on top of 2.6.22-rc3 and see if
> > > > > > that helps.
> > > > > >
> > > > > > Greetings,
> > > > > > Rafael
> > > > > >
> > > > > > ---
> > > > > >  crypto/cryptd.c |    1 +
> > > > > >  1 file changed, 1 insertion(+)
> > > > > >
> > > > > > Index: linux-2.6.22-rc3/crypto/cryptd.c
> > > > > > =================================================================
> > > > > >== --- linux-2.6.22-rc3.orig/crypto/cryptd.c
> > > > > > +++ linux-2.6.22-rc3/crypto/cryptd.c
> > > > > > @@ -316,6 +316,7 @@ static int cryptd_thread(void *data)
> > > > > >  	struct cryptd_state *state = data;
> > > > > >  	int stop;
> > > > > >
> > > > > > +	current->flags |= PF_NOFREEZE;
> > > > > >  	do {
> > > > > >  		struct crypto_async_request *req, *backlog;
> > > > >
> > > > > Even with this patch suspending doesn't work, dmesg shows the same
> > > > > error message.
> > > > > I also did build a kernel without cryptd and suspending does work
> > > > > there.
> > > >
> > > > Well, that's strange, because in that case the freezer shouldn't even
> > > > wait for cryptd.
> > > >
> > > > Can you please try the patch at http://lkml.org/lkml/2007/5/26/169 ?
> > >
> > > With this patch applied suspend does work fine.
> >
> > Hmm.  IMO the patch is too intrusive for 2.6.22, but OTOH it's going into
> > the direction preferred by some prominent people. ;-)
> >
> > Let's try to combine the two threads and see what results from that.
>
> Well, it looks like we have to fix this one separately.
>
> Can you please tell me what to do to make cryptd run?

Well, there really isn't much I do. When I switched from 2.6.21 to 2.6.22-rc2 
I did a 'make oldconfig' and I enabled CONFIG_CRYPTO_CRYPTD because I thought 
it would be a good idea. I don't need cryptd,  I just enabled it. Now when I 
boot this kernel it seems like cryptd is automatically started.

I also tried building a kernel where CONFIG_CRYPTO_CRYPTD is disabled and 
there suspending does work fine.

Maxi

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-05-28 21:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-26  9:28 software suspend doesn't work with 2.6.22-rc3 Maximilian Engelhardt
2007-05-26  9:53 ` Nigel Cunningham
2007-05-26 11:08   ` Herbert Xu
2007-05-26 11:14     ` Nigel Cunningham
2007-05-26 11:55       ` Herbert Xu
2007-05-26 20:23         ` Rafael J. Wysocki
2007-05-26 12:49   ` Maximilian Engelhardt
2007-05-26 20:20     ` Rafael J. Wysocki
2007-05-26 21:33     ` Nigel Cunningham
2007-05-27 16:01       ` Maximilian Engelhardt
2007-05-27 18:19         ` Rafael J. Wysocki
2007-05-27 20:41           ` Maximilian Engelhardt
2007-05-27 21:27             ` Rafael J. Wysocki
2007-05-28  0:21               ` Maximilian Engelhardt
2007-05-28  7:59                 ` Rafael J. Wysocki
2007-05-28 18:21                   ` Rafael J. Wysocki
2007-05-28 21:02                     ` Maximilian Engelhardt [this message]
2007-05-29  0:39                     ` Herbert Xu
2007-05-29 12:01                       ` Rafael J. Wysocki
2007-05-31  6:54                       ` Rafael J. Wysocki
2007-05-31  7:04                         ` Rafael J. Wysocki
2007-05-31  7:13                           ` Rafael J. Wysocki
2007-05-31  8:08                             ` Herbert Xu
2007-05-27 20:35 ` Pavel Machek

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=200705282302.31227.maxi@daemonizer.de \
    --to=maxi@daemonizer.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nigel@nigel.suspend2.net \
    --cc=pavel@ucw.cz \
    --cc=rjw@sisk.pl \
    /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