[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.0803251024120.4838-100000@iolanthe.rowland.org>
Date: Tue, 25 Mar 2008 10:29:36 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: "Rafael J. Wysocki" <rjw@...k.pl>
cc: Oliver Neukum <oliver@...kum.org>,
pm list <linux-pm@...ts.linux-foundation.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
Greg KH <greg@...ah.com>, Len Brown <lenb@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Alexey Starikovskiy <astarikovskiy@...e.de>,
David Brownell <david-b@...bell.net>,
Pavel Machek <pavel@....cz>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>
Subject: Re: [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@...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