[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070126093643.GA4627@ucw.cz>
Date: Fri, 26 Jan 2007 09:36:43 +0000
From: Pavel Machek <pavel@....cz>
To: Greg KH <gregkh@...e.de>
Cc: Ingo Molnar <mingo@...e.hu>, Andrew Morton <akpm@...l.org>,
linux-kernel@...r.kernel.org, Linus Torvalds <torvalds@...l.org>,
linux-pm@...ts.osdl.org
Subject: Re: [patch] suspend/resume debugging: device filter
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists