lkml.org 
[lkml]   [2009]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [linux-pm] Run-time PM idea (was: Re: [RFC][PATCH 0/2] PM: Rearrange core suspend code)
    Date
    On Wednesday 10 June 2009, Alan Stern wrote:
    > On Wed, 10 Jun 2009, Rafael J. Wysocki wrote:
    >
    > > > By the way, a legitimate reason for aborting an autosuspend is if the
    > > > device's driver requires remote wakeup to be enabled during suspend but
    > > > the user has disabled it.
    > >
    > > Do you mean the user has disabled the remote wakeup?
    >
    > Yes, by writing to the power/wakeup attribute.
    >
    >
    > > > > > There should be a sysfs interface (like the one in USB) to allow
    > > > > > userspace to prevent a device from being autosuspended -- and perhaps
    > > > > > also to force it to be suspended.
    > > > >
    > > > > To prevent a device from being suspended - yes. To force it to stay suspended
    > > > > - I'm not sure.
    > > >
    > > > I'm not sure either. Oliver Neukum requested it originally and it has
    > > > been useful for debugging, but I haven't seen many places where it
    > > > would come in useful in practice.
    >
    > I did think of one use for this feature. It's unique to USB,
    > however...
    >
    > In Windows, you're not supposed to unplug a hot-unpluggable device
    > without first telling the OS -- there's a "Safely Remove Hardware"
    > applet. When you tell the applet you want to remove a USB device, the
    > system disables the device's port and then says it's okay to unplug the
    > device. Now Linux doesn't have any user API for disabling USB ports,
    > but suspending a port has the same effect (the device can't distinguish
    > a disable from a suspend).
    >
    > It turns out that some devices (MP3 players, for instance) have
    > incorporated this into their design. They display a "Safe to unplug"
    > message when their port is disabled or suspended. People like to see
    > this message -- it makes them feel good about unplugging the device --
    > and the only way to get it under Linux is by forcing the device to be
    > suspended. :-)

    Well, I'd very much prefer to have a separate mechanism for that.

    > > The problem with it is that the user space may not know if it is safe to keep
    > > a device suspended and if it is not, the kernel will have to ignore the setting
    > > anyway, so I'm not sure what's the point (except for debugging).
    >
    > This falls into the category of "The user knows better". If the user
    > specifically tells the kernel to suspend a device (rather than just
    > letting it autosuspend), and this causes a problem, then it's the
    > user's own fault.
    >
    > After all, who's really the master? Us or the kernel?

    Oh, that depends on who the user is. If I'm the user, I'm the master, but in
    case of a typical Windows user I'm afraid the kernel has to know better. ;-)

    Best,
    Rafael


    \
     
     \ /
      Last update: 2009-06-10 23:17    [W:0.025 / U:1.244 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site