From: Nigel Cunningham <nigel@suspend2.net>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: David Brownell <david-b@pacbell.net>,
Andrew Morton <akpm@osdl.org>,
linux-pm@lists.osdl.org, linux-usb-devel@lists.sourceforge.net
Subject: Re: [patch/rft 2.6.17-rc2] swsusp resume must not device_suspend()
Date: Wed, 26 Apr 2006 08:18:11 +1000 [thread overview]
Message-ID: <200604260818.20484.nigel@suspend2.net> (raw)
In-Reply-To: <200604260006.33856.rjw@sisk.pl>
[-- Attachment #1.1: Type: text/plain, Size: 3388 bytes --]
Hi.
On Wednesday 26 April 2006 08:06, Rafael J. Wysocki wrote:
> On Tuesday 25 April 2006 23:03, Nigel Cunningham wrote:
> > On Wednesday 26 April 2006 06:53, Rafael J. Wysocki wrote:
> > > On Tuesday 25 April 2006 22:28, Nigel Cunningham wrote:
> > > > On Wednesday 26 April 2006 04:56, Rafael J. Wysocki wrote:
> > > > > You're saying that (9) is wrong, so could you please suggest what
> > > > > to do instead of it?
> > > >
> > > > 'scuse me for butting in, but here's my suggested modified version:
> > > > > Well, suppose we have a modular driver that's not loaded before
> > > > > resume. Then it goes like that (approximately):
> > > > > (1) We activate swsusp which calls .suspend() for all devices
> > > > > including our driver (this is a real suspend).
> > > > > (2) swsusp snapshots the system and creates the image.
> > > > > (3) swsusp calls .resume() for all devices in order to be able to
> > > > > save the image (.resume() for our driver is also called which is
> > > > > OK). (4) swsusp turns off the system.
> > > > > (5) (some time later) We start a new kernel and tell it to resume.
> > > > > (6) It activates swsusp which reads the image.
> > > > > (7) (without your change) swsusp calls .suspend() for all device
> > > > > drivers that are present at that time, but our driver is not there,
> > > > > so its .suspend() _won't_ be called. [Of course with your change
> > > > > .suspend() won't be called for any driver.]
> > > >
> > > > We also make a list that is safely available after the atomic restore
> > > > of drivers that have had .suspend methods called.
> > >
> > > Do you mean we place the list in a __nosave area?
> >
> > Well, I wasn't wanting to get bogged down in the details yet, but let's
> > see what we can come up with. How about this:
> >
> > At the point where we do the drivers resume at resume time, we're still
> > atomic, right? Since that's the case, we can just use get_safe_page()
> > prior to the restore to store the list and a __nosave pointer to retain
> > the location across the atomic restore. If we are concerned about
> > resuming drivers allocating memory and overwriting our list (and I think
> > that's a valid concern), space could be allocated and the list copied
> > between doing the atomic restore and the device pwoerup/resume.
>
> This one seems to look better.
>
> Still the problem is we need to know what to do with the devices that have
> had .suspend() routines called. Some of them would have to be reset, some
> of them might be left in the current state, and for some of them we'd have
> to do something special. Frankly, only the driver writer will know what's
> appropriate.
I saw the 2 suspends, 1 resume comment in another part of the thread, but
don't believe a driver would be able to detect that 2 suspends and 1 resume
call had been made - at least not without some non volatile ram. This is the
problem I'm mainly seeking to address. I agree that the driver is the only
thing that will know what to do with the information. That presents another
issue - we would then have to pass on to the drivers the information - I
guess by modified a field in their struct device?
Regards,
Nigel
--
See our web page for Howtos, FAQs, the Wiki and mailing list info.
http://www.suspend2.net IRC: #suspend2 on Freenode
[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2006-04-25 22:18 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-24 21:29 [patch/rft 2.6.17-rc2] swsusp resume must not device_suspend() David Brownell
2006-04-24 21:47 ` [linux-pm] " Rafael J. Wysocki
2006-04-24 22:47 ` David Brownell
2006-04-25 10:34 ` Nigel Cunningham
2006-04-25 14:41 ` Alan Stern
2006-04-25 17:37 ` [linux-pm] " David Brownell
2006-04-25 20:45 ` Alan Stern
2006-04-26 0:30 ` David Brownell
2006-04-27 8:20 ` Pavel Machek
2006-04-27 8:16 ` Pavel Machek
2006-04-27 8:08 ` Pavel Machek
2006-04-27 14:34 ` [linux-pm] " Alan Stern
2006-04-27 16:55 ` Patrick Mochel
2006-04-27 17:41 ` Alan Stern
2006-04-27 19:21 ` David Brownell
2006-04-27 20:35 ` Nigel Cunningham
2006-04-27 20:58 ` Pavel Machek
2006-04-25 16:56 ` David Brownell
2006-04-24 22:31 ` [linux-pm] " Nigel Cunningham
2006-04-25 8:32 ` Rafael J. Wysocki
2006-04-25 16:11 ` David Brownell
2006-04-25 18:56 ` Rafael J. Wysocki
2006-04-25 20:28 ` Nigel Cunningham
2006-04-25 20:53 ` [linux-pm] " Rafael J. Wysocki
2006-04-25 21:03 ` Nigel Cunningham
2006-04-25 22:06 ` Rafael J. Wysocki
2006-04-25 22:18 ` Nigel Cunningham [this message]
2006-04-25 22:34 ` Rafael J. Wysocki
2006-04-25 23:55 ` David Brownell
2006-04-26 1:16 ` Nigel Cunningham
2006-04-26 3:32 ` [linux-pm] " David Brownell
2006-04-26 3:44 ` Nigel Cunningham
2006-04-26 14:24 ` Alan Stern
2006-04-26 19:47 ` [linux-pm] " Nigel Cunningham
2006-04-25 21:04 ` David Brownell
2006-04-25 21:41 ` Pavel Machek
2006-04-25 23:13 ` [linux-pm] " David Brownell
2006-04-26 9:07 ` Pavel Machek
2006-04-25 21:55 ` Rafael J. Wysocki
2006-04-25 22:56 ` David Brownell
2006-04-26 11:26 ` Rafael J. Wysocki
2006-04-26 14:38 ` [linux-pm] " Alan Stern
2006-04-26 15:26 ` Rafael J. Wysocki
2006-04-26 15:38 ` Alan Stern
2006-04-26 16:09 ` Rafael J. Wysocki
2006-04-26 19:06 ` Alan Stern
2006-04-26 20:37 ` Rafael J. Wysocki
2006-04-26 21:31 ` David Brownell
2006-04-26 22:24 ` Rafael J. Wysocki
2006-04-27 19:44 ` David Brownell
2006-04-25 15:56 ` David Brownell
2006-04-27 10:54 ` Pavel Machek
2006-04-25 13:50 ` [linux-usb-devel] " Alan Stern
2006-04-25 15:49 ` David Brownell
2006-04-27 1:22 ` Patrick Mochel
2006-04-27 19:41 ` [linux-pm] " David Brownell
2006-05-02 16:12 ` Patrick Mochel
2006-05-26 3:06 ` David Brownell
2006-05-26 19:50 ` Rafael J. Wysocki
2006-05-26 23:16 ` Pavel Machek
2006-05-27 0:19 ` [linux-usb-devel] " David Brownell
2006-05-27 16:38 ` Pavel Machek
2006-06-05 15:31 ` David Brownell
2006-06-05 16:36 ` [patch/rft 2.6.17-rc5-git 0/6] PM_EVENT_PRETHAW David Brownell
2006-06-05 16:36 ` [patch/rft 2.6.17-rc5-git 1/6] fix broken/dubious driver suspend() methods David Brownell
[not found] ` <20060530191140.GA4017@ucw.cz>
2006-06-07 0:53 ` David Brownell
2006-06-05 16:37 ` [patch/rft 2.6.17-rc5-git 2/6] add PM_EVENT_PRETHAW David Brownell
2006-05-30 19:17 ` Pavel Machek
2006-06-07 1:02 ` David Brownell
2006-06-05 16:38 ` [patch/rft 2.6.17-rc5-git 3/6] PM_EVENT_PRETHAW, handle in IDE and PCI David Brownell
2006-05-30 19:21 ` Pavel Machek
2006-06-07 0:51 ` David Brownell
2006-06-05 16:38 ` [patch/rft 2.6.17-rc5-git 4/6] PM_EVENT_PRETHAW for various graphics cards David Brownell
2006-05-30 19:30 ` Pavel Machek
2006-06-07 1:24 ` David Brownell
2006-06-07 18:57 ` PM docs and API? bsmith
2006-06-07 22:58 ` David Brownell
2006-06-05 16:38 ` [patch/rft 2.6.17-rc5-git 5/6] PM_EVENT_PRETHAW, handle for USB David Brownell
2006-06-05 16:38 ` [patch/rft 2.6.17-rc5-git 6/6] PM_EVENT_PRETHAW, issue from PM core David Brownell
2006-05-30 19:28 ` 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=200604260818.20484.nigel@suspend2.net \
--to=nigel@suspend2.net \
--cc=akpm@osdl.org \
--cc=david-b@pacbell.net \
--cc=linux-pm@lists.osdl.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--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