From: Pavel Machek <pavel@ucw.cz>
To: Greg KH <gregkh@suse.de>
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
Ingo Molnar <mingo@elte.hu>,
linux-pm@lists.osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [patch] suspend/resume debugging: device filter
Date: Fri, 26 Jan 2007 09:36:43 +0000 [thread overview]
Message-ID: <20070126093643.GA4627@ucw.cz> (raw)
In-Reply-To: <20070126015536.GA14917@suse.de>
Hi!
> > it might be better to do this centrally in sysfs, via a per-device
> > attribute, to individually enable suspend and resume on a per device
> > basis, but my sysfs-fu is not strong enough for that now ;-)
>
> Here's a (compile tested only) patch that does this on a per-device
> basis, which is smaller, and should work just as well as your patch.
>
> It creates a new file in the power/ directory for every device called
> "can_suspend". Write a '0' to it to prevent that device from being
> suspended.
Maybe we could just introduce debug_flags?
> +static ssize_t can_suspend_store(struct device *dev,
> + struct device_attribute *attr,
> + const char *buf, size_t n)
> +{
> + if (!n)
> + return -EINVAL;
> +
> + switch (buf[0]) {
> + case 'y':
> + case 'Y':
> + case '1':
> + dev->no_suspend = 0;
> + break;
> + case 'n':
> + case 'N':
> + case '0':
> + dev->no_suspend = 1;
> + break;
default: return -EINVAL ?
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
next prev parent reply other threads:[~2007-01-26 9:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20070125110501.GA25151@elte.hu>
2007-01-26 1:55 ` [patch] suspend/resume debugging: device filter Greg KH
2007-01-26 9:36 ` Pavel Machek [this message]
2007-05-05 9:24 ` Ingo Molnar
2007-05-05 9:39 ` Rafael J. Wysocki
2007-05-05 10:08 ` Pavel Machek
2007-05-08 2:54 ` [linux-pm] " Greg KH
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=20070126093643.GA4627@ucw.cz \
--to=pavel@ucw.cz \
--cc=akpm@osdl.org \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.osdl.org \
--cc=mingo@elte.hu \
--cc=torvalds@osdl.org \
/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