lkml.org 
[lkml]   [2008]   [Mar]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC][PATCH] PM: Introduce new top level suspend and hibernation callbacks (rev. 3)
    On Tue, 25 Mar 2008, Rafael J. Wysocki wrote:

    > On Tuesday, 25 of March 2008, Oliver Neukum wrote:
    > > Am Montag 24 März 2008 schrieb Rafael J. Wysocki:
    > > > -/*
    > > > +/**
    > > > + * struct pm_ops - device PM callbacks
    > > > + *
    > > >   * Several driver power state transitions are externally visible, affecting
    > > >   * the state of pending I/O queues and (for drivers that touch hardware)
    > > >   * interrupts, wakeups, DMA, and other hardware state.  There may also be
    > > > @@ -122,6 +124,254 @@ typedef struct pm_message {
    > > >   * to the rest of the driver stack (such as a driver that's ON gating off
    > > >   * clocks which are not in active use).
    > > >   *
    > > > + * The externally visible transitions are handled with the help of the following
    > > > + * callbacks included in this structure:
    > > > + *
    > > > + * @prepare: Prepare the device for the upcoming transition, but do NOT change
    > > > + *     its hardware state.  Prevent new children of the device from being
    > > > + *     registered and prevent new calls to the probe method from being made
    > >
    > > How is a driver supposed to prevent calls to probe()? You can block in probe()
    > > or you can fail it, but how do you prevent it from being called? User space
    > > can trigger probe via sysfs.
    >
    > I overlooked that.

    The driver isn't supposed to prevent calls to its own probe(). The
    comment means that the subsystem -- or the rest of the kernel generally
    -- is supposed to avoid binding a driver to the device (thereby calling
    the probe routine), assuming the device isn't already bound.

    I don't expect this sort of thing to be very common. Mostly it happens
    when new kernel modules are loaded and new drivers are registered; we
    will have to block module loading during a sleep transition. It also
    happens when the user writes to a driver's "bind" attribute in sysfs;
    the code there will have to block during a sleep transition.

    Alan Stern

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

    \
     
     \ /
      Last update: 2008-03-25 15:31    [W:6.138 / U:0.512 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site