Re: Changes to sysfs PM layer break userspace

From: Andrew Morton
Date: Wed Dec 20 2006 - 22:52:14 EST


On Tue, 19 Dec 2006 19:29:13 -0800
David Brownell <david-b@xxxxxxxxxxx> wrote:

> On Tuesday 19 December 2006 6:15 pm, Andrew Morton wrote:
> > On Tue, 19 Dec 2006 13:34:49 -0800
> > David Brownell <david-b@xxxxxxxxxxx> wrote:
> >
> > > Documentation/feature-removal-schedule.txt has warned about this since
> > > August
> >
> > Nobody reads that.
> >
> > Please, wherever possible, put a nice printk("this is going away") in the code
> > when planning these things.
>
>
> Signed-off-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>
>
> Index: g26/drivers/base/power/sysfs.c
> ===================================================================
> --- g26.orig/drivers/base/power/sysfs.c 2006-09-27 16:19:00.000000000 -0700
> +++ g26/drivers/base/power/sysfs.c 2006-12-19 19:27:25.000000000 -0800
> @@ -42,9 +42,17 @@ static ssize_t state_show(struct device
>
> static ssize_t state_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t n)
> {
> + static int warned;
> pm_message_t state;
> int error = -EINVAL;
>
> + if (!warned) {
> + printk(KERN_WARNING
> + "*** WARNING *** sysfs devices/.../power/state files "
> + "are only for testing, and will be removed\n");
> + warned = error;
> + }
> +
> /* disallow incomplete suspend sequences */
> if (dev->bus && (dev->bus->suspend_late || dev->bus->resume_early))
> return error;

Well that's not much use. It tells people "hey, we broke it". They
already knew that.

What we should do is to revert 047bda36150d11422b2c7bacca1df324c909c0b3 and
add a printk("hey, we'll be breaking this soon").

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/