From: Pavel Machek <pavel@ucw.cz>
To: Shaohua Li <shaohua.li@intel.com>
Cc: linux-pm <linux-pm@lists.osdl.org>
Subject: Re: sysdev suspend/resume
Date: Wed, 27 Jul 2005 11:07:48 +0200 [thread overview]
Message-ID: <20050727090748.GB4270@elf.ucw.cz> (raw)
In-Reply-To: <1122454220.7414.3.camel@linux-hp.sh.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1951 bytes --]
Hi!
> > > The return value of sysdev's suspend/resume methods is ignored, is this
> > > intended (it should not fail?) or just a bug? I'd like to abort the
> > > suspend process if one device fails.
> >
> > I guess patch would be accepted... but please make sure you test those
> > error paths, and printk name of failing driver.
> It's a challenge to me, so many loops :). Below patch is a little ugly,
> but should cover all error paths.
It is indeed quite ugly. Could we get SYSDEV_RESUME inline function
instead of ugly macro?
> diff -puN drivers/base/sys.c~sysdev drivers/base/sys.c
> --- linux-2.6.13-rc3/drivers/base/sys.c~sysdev 2005-07-27 10:49:52.831538832 +0800
> +++ linux-2.6.13-rc3-root/drivers/base/sys.c 2005-07-27 16:25:49.154312008 +0800
> @@ -288,6 +288,22 @@ void sysdev_shutdown(void)
> up(&sysdev_drivers_lock);
> }
>
> +#define SYSDEV_RESUME(cls, dev, drv) \
> + /* First, call the class-specific one */ \
> + if (cls->resume) \
> + cls->resume(dev); \
> + \
> + /* Call auxillary drivers next. */ \
> + list_for_each_entry(drv, &cls->drivers, entry) {\
> + if (drv->resume) \
> + drv->resume(dev); \
> + } \
> + \
> + /* Call global drivers. */ \
> + list_for_each_entry(drv, &sysdev_drivers, entry) {\
> + if (drv->resume) \
> + drv->resume(dev); \
> + }
Are you sure you are resuming already-resumed devices?
> /**
> * sysdev_suspend - Suspend all system devices.
> @@ -305,38 +321,93 @@ void sysdev_shutdown(void)
> int sysdev_suspend(pm_message_t state)
> {
> struct sysdev_class * cls;
> + struct sys_device *sysdev, *err_dev;
> + struct sysdev_driver *drv, *err_drv;
> + int ret;
~~~~~~~~~~~~
use space not tab here. I see you got that habit from ACPI,
but it is just wrong.
> +cls_driver:
> + drv = NULL;
> + printk(KERN_ERR "Clss suspend failed for %s\n",
~~~~
Mssng vwls.
Pavel
--
teflon -- maybe it is a trademark, but it should not be.
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2005-07-27 9:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-26 5:42 sysdev suspend/resume Shaohua Li
2005-07-26 10:14 ` Pavel Machek
2005-07-27 8:50 ` Shaohua Li
2005-07-27 9:07 ` Pavel Machek [this message]
2005-07-27 9:30 ` Shaohua Li
2005-07-27 9:40 ` Pavel Machek
2005-07-27 17:43 ` Patrick Mochel
2005-07-27 18:50 ` Patrick Mochel
2005-07-28 3:10 ` Shaohua Li
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=20050727090748.GB4270@elf.ucw.cz \
--to=pavel@ucw.cz \
--cc=linux-pm@lists.osdl.org \
--cc=shaohua.li@intel.com \
/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