public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Re: NAK new drivers without proper power management?
       [not found]   ` <1171076554.10170.5.camel@nigel.suspend2.net>
@ 2007-02-10  9:34     ` Rafael J. Wysocki
  2007-02-10 10:02       ` Nigel Cunningham
  0 siblings, 1 reply; 24+ messages in thread
From: Rafael J. Wysocki @ 2007-02-10  9:34 UTC (permalink / raw)
  To: nigel; +Cc: Robert Hancock, Pavel Machek, pm list, linux-kernel, Jeff Garzik

Hi,

On Saturday, 10 February 2007 04:02, Nigel Cunningham wrote:
> Hi.
> 
> On Fri, 2007-02-09 at 19:50 -0600, Robert Hancock wrote:
> > It also kind of bothers me that if a driver has no suspend/resume 
> > functions, and you suspend and resume the system, we don't complain 
> > about it even though there's a very good chance that device is not going 
> > to function properly. How about something in dmesg like:
> > 
> > Warning: driver for device XXXX has no suspend or resume support.
> > Device may not function properly after resume.
> > 
> > so that users know who to complain to. Maybe there are some devices that 
> > truly don't need any handling for suspend, but if so I suspect the 
> > number of those is small enough that adding empty functions would be a 
> > good-enough solution.
> 
> Here's my current version of a patch to do this, if anyone wants to try
> it out. It dumps stack with the warning to make it easier to see what
> the source of the message is:

I have an alternative idea.

There is a test mode of swsusp that's triggered with
"echo test > /sys/power/disk" and "echo disk > /sys/power/state".  We can make
it set a switch that will be used to trigger the warnings in the core.

This way the warnings will only appear in the user's dmesg in the test mode
and not always.

Would that be acceptable?

Rafael

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-10  9:34     ` [PATCH] Re: NAK new drivers without proper power management? Rafael J. Wysocki
@ 2007-02-10 10:02       ` Nigel Cunningham
  2007-02-10 10:30         ` Rafael J. Wysocki
  0 siblings, 1 reply; 24+ messages in thread
From: Nigel Cunningham @ 2007-02-10 10:02 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Robert Hancock, linux-kernel, Jeff Garzik, Pavel Machek, pm list

Gidday.

On Sat, 2007-02-10 at 10:34 +0100, Rafael J. Wysocki wrote:
> On Saturday, 10 February 2007 04:02, Nigel Cunningham wrote:
> > On Fri, 2007-02-09 at 19:50 -0600, Robert Hancock wrote:
> > > It also kind of bothers me that if a driver has no suspend/resume 
> > > functions, and you suspend and resume the system, we don't complain 
> > > about it even though there's a very good chance that device is not going 
> > > to function properly. How about something in dmesg like:
> > > 
> > > Warning: driver for device XXXX has no suspend or resume support.
> > > Device may not function properly after resume.
> > > 
> > > so that users know who to complain to. Maybe there are some devices that 
> > > truly don't need any handling for suspend, but if so I suspect the 
> > > number of those is small enough that adding empty functions would be a 
> > > good-enough solution.
> > 
> > Here's my current version of a patch to do this, if anyone wants to try
> > it out. It dumps stack with the warning to make it easier to see what
> > the source of the message is:
> 
> I have an alternative idea.
> 
> There is a test mode of swsusp that's triggered with
> "echo test > /sys/power/disk" and "echo disk > /sys/power/state".  We can make
> it set a switch that will be used to trigger the warnings in the core.
> 
> This way the warnings will only appear in the user's dmesg in the test mode
> and not always.
> 
> Would that be acceptable?

Well, the original desire was to stop new drivers getting in without
proper power management. For this to help achieve that aim, one or more
of the following would need to happen:

* developers of new drivers would have to remember to run the test
after/during writing their driver. Of course if they remember to do
this, they've already remembered that they need to implement power
management;
* you, I or someone else would need to test all these trees before
Andrew and Linus merge them and report problems to the developers before
they get their new drivers merged;
* Andrew or Linus would run it prior to or after merging a whole lot of
stuff.

I'm afraid I don't like the chances of any of those things happening, so
I'm not sure that it is an acceptable alternative from my perspective. 

Sticking a printk in dmesg doesn't exactly put the problem in flashing
red 36 point characters before the developer either, but I think they're
slightly more likely to see it there if only because they might stick
printks in that they want to read (eg perhaps while debugging the
driver) and therefore see the message when checking output from the
driver being loaded/initialised.

Maybe another alternative would be to make the warnings compile time
warnings - if that's possible?

Regards,

Nigel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-10 10:02       ` Nigel Cunningham
@ 2007-02-10 10:30         ` Rafael J. Wysocki
  2007-02-10 17:52           ` Daniel Barkalow
  0 siblings, 1 reply; 24+ messages in thread
From: Rafael J. Wysocki @ 2007-02-10 10:30 UTC (permalink / raw)
  To: nigel; +Cc: Robert Hancock, Pavel Machek, pm list, linux-kernel, Jeff Garzik

Hi,

On Saturday, 10 February 2007 11:02, Nigel Cunningham wrote:
> Gidday.
> 
> On Sat, 2007-02-10 at 10:34 +0100, Rafael J. Wysocki wrote:
> > On Saturday, 10 February 2007 04:02, Nigel Cunningham wrote:
> > > On Fri, 2007-02-09 at 19:50 -0600, Robert Hancock wrote:
> > > > It also kind of bothers me that if a driver has no suspend/resume 
> > > > functions, and you suspend and resume the system, we don't complain 
> > > > about it even though there's a very good chance that device is not going 
> > > > to function properly. How about something in dmesg like:
> > > > 
> > > > Warning: driver for device XXXX has no suspend or resume support.
> > > > Device may not function properly after resume.
> > > > 
> > > > so that users know who to complain to. Maybe there are some devices that 
> > > > truly don't need any handling for suspend, but if so I suspect the 
> > > > number of those is small enough that adding empty functions would be a 
> > > > good-enough solution.
> > > 
> > > Here's my current version of a patch to do this, if anyone wants to try
> > > it out. It dumps stack with the warning to make it easier to see what
> > > the source of the message is:
> > 
> > I have an alternative idea.
> > 
> > There is a test mode of swsusp that's triggered with
> > "echo test > /sys/power/disk" and "echo disk > /sys/power/state".  We can make
> > it set a switch that will be used to trigger the warnings in the core.
> > 
> > This way the warnings will only appear in the user's dmesg in the test mode
> > and not always.
> > 
> > Would that be acceptable?
> 
> Well, the original desire was to stop new drivers getting in without
> proper power management.

I know, but I agree with the argument that having a driver without the
suspend/resume support is better than not having the driver at all.
Moreover, if you _know_ which of the drivers you use have no suspend/resume
support, usually you _can_ suspend (at least to disk) and resume anyway - you
only need to unload their modules before the suspend.  Of course, this is not
true for the disk (and related) drivers and for the drivers that cannot be
unloaded.  [I think it generally is not true for the suspend-to-RAM either.]

Also, I think there are quite some drivers already in the tree that don't
support suspend/resume explicitly and honestly we should start from adding the
suspend/resume routines to these drivers _before_ we ban new drivers like that.

> For this to help achieve that aim, one or more 
> of the following would need to happen:
> 
> * developers of new drivers would have to remember to run the test
> after/during writing their driver. Of course if they remember to do
> this, they've already remembered that they need to implement power
> management;
> * you, I or someone else would need to test all these trees before
> Andrew and Linus merge them and report problems to the developers before
> they get their new drivers merged;
> * Andrew or Linus would run it prior to or after merging a whole lot of
> stuff.
> 
> I'm afraid I don't like the chances of any of those things happening, so
> I'm not sure that it is an acceptable alternative from my perspective. 
> 
> Sticking a printk in dmesg doesn't exactly put the problem in flashing
> red 36 point characters before the developer either, but I think they're
> slightly more likely to see it there if only because they might stick
> printks in that they want to read (eg perhaps while debugging the
> driver) and therefore see the message when checking output from the
> driver being loaded/initialised.
> 
> Maybe another alternative would be to make the warnings compile time
> warnings - if that's possible?

Well, maybe.

Still, I'd like to create standard debugging procedures for suspend/resume, so
that if someone reports a problem, we can tell him exactly what to do next.
>From this point of view, the idea of having warnings related to the lack of
.suspend or .resume routines in drivers that will appear in the user's dmesg in
the test mode seems to be a good one. ;-)

Greetings,
Rafael


-- 
If you don't have the time to read,
you don't have the time or the tools to write.
		- Stephen King

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-10 10:30         ` Rafael J. Wysocki
@ 2007-02-10 17:52           ` Daniel Barkalow
  2007-02-10 19:50             ` Rafael J. Wysocki
  2007-02-11 19:37             ` Pavel Machek
  0 siblings, 2 replies; 24+ messages in thread
From: Daniel Barkalow @ 2007-02-10 17:52 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Robert Hancock, Jeff Garzik, Pavel Machek, pm list, linux-kernel

On Sat, 10 Feb 2007, Rafael J. Wysocki wrote:

> On Saturday, 10 February 2007 11:02, Nigel Cunningham wrote:
>
> > Well, the original desire was to stop new drivers getting in without
> > proper power management.
> 
> I know, but I agree with the argument that having a driver without the
> suspend/resume support is better than not having the driver at all.

How about if "proper power management" is defined to include the driver 
explicitly preventing suspend? It seems to me like the current problem is 
that driver writers don't think about power management at all, and the 
result is that, after suspend/resume, the system doesn't come back. It 
would be better if driver writers had to think about power management just 
enough to realize that it's not going to work, and make this information 
available to the system. At that point, it's relatively easy for the 
system to do something useful about it.

> Also, I think there are quite some drivers already in the tree that don't
> support suspend/resume explicitly and honestly we should start from adding the
> suspend/resume routines to these drivers _before_ we ban new drivers like that.

It'd be relatively quick to modify all the current drivers that don't 
explicitly support suspend/resume to explicitly not support it. (Or to 
explicitly support it trivially; /dev/null obviously doesn't need 
anything.)

	-Daniel
*This .sig left intentionally blank*

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-10 17:52           ` Daniel Barkalow
@ 2007-02-10 19:50             ` Rafael J. Wysocki
  2007-02-11  6:54               ` Willy Tarreau
  2007-02-11 19:37             ` Pavel Machek
  1 sibling, 1 reply; 24+ messages in thread
From: Rafael J. Wysocki @ 2007-02-10 19:50 UTC (permalink / raw)
  To: Daniel Barkalow
  Cc: Robert Hancock, Jeff Garzik, Pavel Machek, pm list, linux-kernel

On Saturday, 10 February 2007 18:52, Daniel Barkalow wrote:
> On Sat, 10 Feb 2007, Rafael J. Wysocki wrote:
> 
> > On Saturday, 10 February 2007 11:02, Nigel Cunningham wrote:
> >
> > > Well, the original desire was to stop new drivers getting in without
> > > proper power management.
> > 
> > I know, but I agree with the argument that having a driver without the
> > suspend/resume support is better than not having the driver at all.
> 
> How about if "proper power management" is defined to include the driver 
> explicitly preventing suspend? It seems to me like the current problem is 
> that driver writers don't think about power management at all, and the 
> result is that, after suspend/resume, the system doesn't come back. It 
> would be better if driver writers had to think about power management just 
> enough to realize that it's not going to work, and make this information 
> available to the system. At that point, it's relatively easy for the 
> system to do something useful about it.

Actually, it is easy for the driver authors to do this right now.  They can
just make the .suspend() routine always return an error.

Well, I think this is a good idea: if the device in question requires specific
power management during the suspend/resume, but it is not implemented by the
driver, we should require the author of the driver to define the .suspend()
routine that returns -ENOSYS (preferably, with an explanatory warning in
dmesg).

Thoughts?

> > Also, I think there are quite some drivers already in the tree that don't
> > support suspend/resume explicitly and honestly we should start from adding the
> > suspend/resume routines to these drivers _before_ we ban new drivers like that.
> 
> It'd be relatively quick to modify all the current drivers that don't 
> explicitly support suspend/resume to explicitly not support it. (Or to 
> explicitly support it trivially; /dev/null obviously doesn't need 
> anything.)

The problem is we have to review quite a lot of drivers for this purpose.
Still it looks like we should do this anyway.

Greetings,
Rafael


-- 
If you don't have the time to read,
you don't have the time or the tools to write.
		- Stephen King

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-10 19:50             ` Rafael J. Wysocki
@ 2007-02-11  6:54               ` Willy Tarreau
  2007-02-11 12:13                 ` Matthew Garrett
  0 siblings, 1 reply; 24+ messages in thread
From: Willy Tarreau @ 2007-02-11  6:54 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Robert Hancock, Jeff Garzik, Pavel Machek, Daniel Barkalow,
	pm list, linux-kernel

On Sat, Feb 10, 2007 at 08:50:27PM +0100, Rafael J. Wysocki wrote:
> On Saturday, 10 February 2007 18:52, Daniel Barkalow wrote:
> > On Sat, 10 Feb 2007, Rafael J. Wysocki wrote:
> > 
> > > On Saturday, 10 February 2007 11:02, Nigel Cunningham wrote:
> > >
> > > > Well, the original desire was to stop new drivers getting in without
> > > > proper power management.
> > > 
> > > I know, but I agree with the argument that having a driver without the
> > > suspend/resume support is better than not having the driver at all.
> > 
> > How about if "proper power management" is defined to include the driver 
> > explicitly preventing suspend? It seems to me like the current problem is 
> > that driver writers don't think about power management at all, and the 
> > result is that, after suspend/resume, the system doesn't come back. It 
> > would be better if driver writers had to think about power management just 
> > enough to realize that it's not going to work, and make this information 
> > available to the system. At that point, it's relatively easy for the 
> > system to do something useful about it.
> 
> Actually, it is easy for the driver authors to do this right now.  They can
> just make the .suspend() routine always return an error.
> 
> Well, I think this is a good idea: if the device in question requires specific
> power management during the suspend/resume, but it is not implemented by the
> driver, we should require the author of the driver to define the .suspend()
> routine that returns -ENOSYS (preferably, with an explanatory warning in
> dmesg).

instead of modifying all drivers to explicitly state that they don't support
it, we should start with a test of the NULL pointer for .suspend which should
mean exactly the same without modifying the drivers. I find it obvious that
a driver which does provide a suspend function will not support it. And if
some drivers (eg /dev/null) can support it anyway, it's better to change
*those* drivers to explicitly mark them as compatible.

regards,
Willy

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11  6:54               ` Willy Tarreau
@ 2007-02-11 12:13                 ` Matthew Garrett
  2007-02-11 13:09                   ` Willy Tarreau
                                     ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Matthew Garrett @ 2007-02-11 12:13 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: Rafael J. Wysocki, Daniel Barkalow, nigel, Robert Hancock,
	linux-kernel, Jeff Garzik, Pavel Machek, pm list

On Sun, Feb 11, 2007 at 07:54:04AM +0100, Willy Tarreau wrote:

> instead of modifying all drivers to explicitly state that they don't support
> it, we should start with a test of the NULL pointer for .suspend which should
> mean exactly the same without modifying the drivers. I find it obvious that
> a driver which does provide a suspend function will not support it. And if
> some drivers (eg /dev/null) can support it anyway, it's better to change
> *those* drivers to explicitly mark them as compatible.

No, that doesn't work. In the absence of suspend/resume methods, the PCI 
layer will implement basic PM itself. In some cases, this works. In 
others, it doesn't. There's no way to automatically determine which is 
which without modifying the drivers.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 12:13                 ` Matthew Garrett
@ 2007-02-11 13:09                   ` Willy Tarreau
  2007-02-11 13:19                     ` Matthew Garrett
  2007-02-11 21:10                     ` Pavel Machek
  2007-02-11 17:36                   ` Robert Hancock
  2007-02-11 22:49                   ` Nigel Cunningham
  2 siblings, 2 replies; 24+ messages in thread
From: Willy Tarreau @ 2007-02-11 13:09 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Robert Hancock, Pavel Machek, Jeff Garzik, Daniel Barkalow,
	pm list, linux-kernel

On Sun, Feb 11, 2007 at 12:13:40PM +0000, Matthew Garrett wrote:
> On Sun, Feb 11, 2007 at 07:54:04AM +0100, Willy Tarreau wrote:
> 
> > instead of modifying all drivers to explicitly state that they don't support
> > it, we should start with a test of the NULL pointer for .suspend which should
> > mean exactly the same without modifying the drivers. I find it obvious that
> > a driver which does provide a suspend function will not support it. And if
> > some drivers (eg /dev/null) can support it anyway, it's better to change
> > *those* drivers to explicitly mark them as compatible.
> 
> No, that doesn't work. In the absence of suspend/resume methods, the PCI 
> layer will implement basic PM itself. In some cases, this works. In 
> others, it doesn't. There's no way to automatically determine which is 
> which without modifying the drivers.

Then change the PCI layer to do the basic PM only for known compatible
drivers, and modify only the known-compatible drivers to mark them
explicitly compatible. IMHO, it generally is a bad idea to require that
any driver explicitly states what it *does not* support. It's the reason
why users encounter problem on new features with old drivers. For instance,
do you know if the old ISA NE2000 driver breaks suspend ? I don't know,
but I would at least expect it not to support it by default. It's best
to announce what *is* supported and consider everything unimplemented
otherwise explicitly stated.

Regards,
Willy

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 13:09                   ` Willy Tarreau
@ 2007-02-11 13:19                     ` Matthew Garrett
  2007-02-11 13:37                       ` Willy Tarreau
  2007-02-11 21:10                     ` Pavel Machek
  1 sibling, 1 reply; 24+ messages in thread
From: Matthew Garrett @ 2007-02-11 13:19 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: Rafael J. Wysocki, Daniel Barkalow, nigel, Robert Hancock,
	linux-kernel, Jeff Garzik, Pavel Machek, pm list

On Sun, Feb 11, 2007 at 02:09:43PM +0100, Willy Tarreau wrote:

> Then change the PCI layer to do the basic PM only for known compatible
> drivers, and modify only the known-compatible drivers to mark them
> explicitly compatible. IMHO, it generally is a bad idea to require that
> any driver explicitly states what it *does not* support. It's the reason
> why users encounter problem on new features with old drivers. For instance,
> do you know if the old ISA NE2000 driver breaks suspend ? I don't know,
> but I would at least expect it not to support it by default. It's best
> to announce what *is* supported and consider everything unimplemented
> otherwise explicitly stated.

This ignores the reality of the situation, which is that many drivers 
support suspend and resume despite the lack of any explicit 
implementation. Changing things so they're flagged as broken when 
they're not would be a regression.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 13:19                     ` Matthew Garrett
@ 2007-02-11 13:37                       ` Willy Tarreau
  2007-02-11 13:50                         ` Rafael J. Wysocki
  0 siblings, 1 reply; 24+ messages in thread
From: Willy Tarreau @ 2007-02-11 13:37 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Robert Hancock, Pavel Machek, Jeff Garzik, Daniel Barkalow,
	pm list, linux-kernel

On Sun, Feb 11, 2007 at 01:19:57PM +0000, Matthew Garrett wrote:
> On Sun, Feb 11, 2007 at 02:09:43PM +0100, Willy Tarreau wrote:
> 
> > Then change the PCI layer to do the basic PM only for known compatible
> > drivers, and modify only the known-compatible drivers to mark them
> > explicitly compatible. IMHO, it generally is a bad idea to require that
> > any driver explicitly states what it *does not* support. It's the reason
> > why users encounter problem on new features with old drivers. For instance,
> > do you know if the old ISA NE2000 driver breaks suspend ? I don't know,
> > but I would at least expect it not to support it by default. It's best
> > to announce what *is* supported and consider everything unimplemented
> > otherwise explicitly stated.
> 
> This ignores the reality of the situation, which is that many drivers 
> support suspend and resume despite the lack of any explicit 
> implementation. Changing things so they're flagged as broken when 
> they're not would be a regression.

Those which are identified as OK should be flagged OK. Only those for
which we have no idea should be flagged broken. It's better than leaving
them in the wild waiting for a victim. And given what Nigel would like,
they would all have to be reviewed to get .suspend/.resume entries
anyway. But at least, we would only have to change the known good instead
of all of them. And the remaining ones would not cause trouble to users.

Willy

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 13:37                       ` Willy Tarreau
@ 2007-02-11 13:50                         ` Rafael J. Wysocki
  2007-02-11 13:57                           ` Willy Tarreau
  0 siblings, 1 reply; 24+ messages in thread
From: Rafael J. Wysocki @ 2007-02-11 13:50 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: Robert Hancock, Matthew Garrett, Pavel Machek, Jeff Garzik,
	Daniel Barkalow, pm list, linux-kernel

On Sunday, 11 February 2007 14:37, Willy Tarreau wrote:
> On Sun, Feb 11, 2007 at 01:19:57PM +0000, Matthew Garrett wrote:
> > On Sun, Feb 11, 2007 at 02:09:43PM +0100, Willy Tarreau wrote:
> > 
> > > Then change the PCI layer to do the basic PM only for known compatible
> > > drivers, and modify only the known-compatible drivers to mark them
> > > explicitly compatible. IMHO, it generally is a bad idea to require that
> > > any driver explicitly states what it *does not* support. It's the reason
> > > why users encounter problem on new features with old drivers. For instance,
> > > do you know if the old ISA NE2000 driver breaks suspend ? I don't know,
> > > but I would at least expect it not to support it by default. It's best
> > > to announce what *is* supported and consider everything unimplemented
> > > otherwise explicitly stated.
> > 
> > This ignores the reality of the situation, which is that many drivers 
> > support suspend and resume despite the lack of any explicit 
> > implementation. Changing things so they're flagged as broken when 
> > they're not would be a regression.
> 
> Those which are identified as OK should be flagged OK. Only those for
> which we have no idea should be flagged broken.

I think we don't need to flag the drivers identified as OK.  Let's flag only
the suspicious ones.

Whatever we finally come up with, I'd like to avoid modifying drivers that are
known good.

Greetings,
Rafael

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 13:50                         ` Rafael J. Wysocki
@ 2007-02-11 13:57                           ` Willy Tarreau
  2007-02-11 14:36                             ` Rafael J. Wysocki
  0 siblings, 1 reply; 24+ messages in thread
From: Willy Tarreau @ 2007-02-11 13:57 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Robert Hancock, Matthew Garrett, Pavel Machek, Jeff Garzik,
	Daniel Barkalow, pm list, linux-kernel

On Sun, Feb 11, 2007 at 02:50:48PM +0100, Rafael J. Wysocki wrote:
> On Sunday, 11 February 2007 14:37, Willy Tarreau wrote:
> > On Sun, Feb 11, 2007 at 01:19:57PM +0000, Matthew Garrett wrote:
> > > On Sun, Feb 11, 2007 at 02:09:43PM +0100, Willy Tarreau wrote:
> > > 
> > > > Then change the PCI layer to do the basic PM only for known compatible
> > > > drivers, and modify only the known-compatible drivers to mark them
> > > > explicitly compatible. IMHO, it generally is a bad idea to require that
> > > > any driver explicitly states what it *does not* support. It's the reason
> > > > why users encounter problem on new features with old drivers. For instance,
> > > > do you know if the old ISA NE2000 driver breaks suspend ? I don't know,
> > > > but I would at least expect it not to support it by default. It's best
> > > > to announce what *is* supported and consider everything unimplemented
> > > > otherwise explicitly stated.
> > > 
> > > This ignores the reality of the situation, which is that many drivers 
> > > support suspend and resume despite the lack of any explicit 
> > > implementation. Changing things so they're flagged as broken when 
> > > they're not would be a regression.
> > 
> > Those which are identified as OK should be flagged OK. Only those for
> > which we have no idea should be flagged broken.
> 
> I think we don't need to flag the drivers identified as OK.  Let's flag only
> the suspicious ones.
> 
> Whatever we finally come up with, I'd like to avoid modifying drivers that are
> known good.

I understand your concerns, but the problem is not *current* drivers, but
what will happen to *new* drivers. If we make it implicit that a driver
is compatible, then new drivers will be promoted as good even if nothing
has been done for this.

Regards,
Willy

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 13:57                           ` Willy Tarreau
@ 2007-02-11 14:36                             ` Rafael J. Wysocki
  2007-02-11 15:19                               ` Pekka Enberg
                                                 ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: Rafael J. Wysocki @ 2007-02-11 14:36 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: Robert Hancock, Matthew Garrett, Pavel Machek, Jeff Garzik,
	Daniel Barkalow, pm list, linux-kernel

On Sunday, 11 February 2007 14:57, Willy Tarreau wrote:
> On Sun, Feb 11, 2007 at 02:50:48PM +0100, Rafael J. Wysocki wrote:
> > On Sunday, 11 February 2007 14:37, Willy Tarreau wrote:
> > > On Sun, Feb 11, 2007 at 01:19:57PM +0000, Matthew Garrett wrote:
> > > > On Sun, Feb 11, 2007 at 02:09:43PM +0100, Willy Tarreau wrote:
> > > > 
> > > > > Then change the PCI layer to do the basic PM only for known compatible
> > > > > drivers, and modify only the known-compatible drivers to mark them
> > > > > explicitly compatible. IMHO, it generally is a bad idea to require that
> > > > > any driver explicitly states what it *does not* support. It's the reason
> > > > > why users encounter problem on new features with old drivers. For instance,
> > > > > do you know if the old ISA NE2000 driver breaks suspend ? I don't know,
> > > > > but I would at least expect it not to support it by default. It's best
> > > > > to announce what *is* supported and consider everything unimplemented
> > > > > otherwise explicitly stated.
> > > > 
> > > > This ignores the reality of the situation, which is that many drivers 
> > > > support suspend and resume despite the lack of any explicit 
> > > > implementation. Changing things so they're flagged as broken when 
> > > > they're not would be a regression.
> > > 
> > > Those which are identified as OK should be flagged OK. Only those for
> > > which we have no idea should be flagged broken.
> > 
> > I think we don't need to flag the drivers identified as OK.  Let's flag only
> > the suspicious ones.
> > 
> > Whatever we finally come up with, I'd like to avoid modifying drivers that are
> > known good.
> 
> I understand your concerns, but the problem is not *current* drivers, but
> what will happen to *new* drivers. If we make it implicit that a driver
> is compatible, then new drivers will be promoted as good even if nothing
> has been done for this.

The problem is it was made implicit long ago.  The design is "optimistic", so
to speak, and I think we have the following choices:

1) Change the design to make the kernel refuse to suspend if there are any
drivers not explicitly flagged as "suspend/resume-safe".  [This looks like a
lot of work to me, but it is generally doable provided that someone has enough
time to do it.  Unfortunately it has to be done in one shot for all of the
known good drivers to avoid user-observable regressions.]

2) Require the authors of new drivers to _either_ ensure that their drivers
will be suspend/resume-safe (and I mean both STR and STD here), _or_ explicitly
flag the drivers as "suspend/resume-unsafe", for example by impelenting
.suspend() routines returning -ENOSYS.  [The existing drivers can be modified
to follow this convention gradually.]

Now IMO 1) has some disadvantages:
- Potential for introducing some regressions (eg. if we omit a known-good
driver)
- Necessity to review a lot of drivers simultaneously
- Problem what to do with drivers that work for some people and don't work
for the others (ie. if we don't flag them as known good, we will break the
setups in which they work)

The advantage of 1), however, is that we can differentiate drivers that are
safe only with respect to the suspend to disk from those that are safe with
respect to the suspend to RAM too (there are some).

I'd prefer 2), because it's simpler to make happen.

Greetings,
Rafael

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 14:36                             ` Rafael J. Wysocki
@ 2007-02-11 15:19                               ` Pekka Enberg
  2007-02-11 18:31                                 ` Rafael J. Wysocki
  2007-02-11 17:27                               ` Daniel Barkalow
  2007-02-11 21:04                               ` Stefan Richter
  2 siblings, 1 reply; 24+ messages in thread
From: Pekka Enberg @ 2007-02-11 15:19 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Robert Hancock, Matthew Garrett, Pavel Machek, Jeff Garzik,
	Daniel Barkalow, pm list, Willy Tarreau, linux-kernel

On 2/11/07, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> Unfortunately it has to be done in one shot for all of the known good drivers to avoid
> user-observable regressions.

No you don't. You can make it a config option that defaults to n
during a transition period.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 14:36                             ` Rafael J. Wysocki
  2007-02-11 15:19                               ` Pekka Enberg
@ 2007-02-11 17:27                               ` Daniel Barkalow
  2007-02-11 18:53                                 ` Rafael J. Wysocki
  2007-02-11 21:04                               ` Stefan Richter
  2 siblings, 1 reply; 24+ messages in thread
From: Daniel Barkalow @ 2007-02-11 17:27 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Willy Tarreau, Matthew Garrett, nigel, Robert Hancock,
	linux-kernel, Jeff Garzik, Pavel Machek, pm list

On Sun, 11 Feb 2007, Rafael J. Wysocki wrote:

> The problem is it was made implicit long ago.  The design is "optimistic", so
> to speak, and I think we have the following choices:
> 
> 1) Change the design to make the kernel refuse to suspend if there are any
> drivers not explicitly flagged as "suspend/resume-safe".  [This looks like a
> lot of work to me, but it is generally doable provided that someone has enough
> time to do it.  Unfortunately it has to be done in one shot for all of the
> known good drivers to avoid user-observable regressions.]

The kernel wouldn't necessarily have to refuse to suspend. It could just 
warn (and list the drivers that aren't marked), or could require some 
extra insistance from the user. It would be good to have it log a message 
saying something like: "If you can read this, report that ne2000 seems to 
be safe for suspend/resume". Having drivers explicitly marked as to 
whether they are safe is a good kernel feature; what to do if they're not 
is policy.

> 2) Require the authors of new drivers to _either_ ensure that their drivers
> will be suspend/resume-safe (and I mean both STR and STD here), _or_ explicitly
> flag the drivers as "suspend/resume-unsafe", for example by impelenting
> .suspend() routines returning -ENOSYS.  [The existing drivers can be modified
> to follow this convention gradually.]

I don't see any reason not to do (2) regardless of (1). That was (my idea 
of) the statement that started this thread: new drivers need to not mess 
up on suspend/resume, as a matter of suitability for inclusion. Of course, 
we need some way for drivers to indicate that they work fine with the 
PCI-layer defaults. And it should probably more machine-readable than the 
author telling reviewers that it works.

> - Problem what to do with drivers that work for some people and don't work
> for the others (ie. if we don't flag them as known good, we will break the
> setups in which they work)

I think the only interesting case here is when a device resumes fine with 
no driver support if the BIOS manages to deal effectively with it, but the 
BIOS generally doesn't. Otherwise, I think it's only going to work at 
all if the author put in the effort to make it work (so it should be 
"known good"), but there may be bugs (firmware, BIOS, driver, etc). But 
that's true of any functionality.

	-Daniel
*This .sig left intentionally blank*

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 12:13                 ` Matthew Garrett
  2007-02-11 13:09                   ` Willy Tarreau
@ 2007-02-11 17:36                   ` Robert Hancock
  2007-02-11 22:49                   ` Nigel Cunningham
  2 siblings, 0 replies; 24+ messages in thread
From: Robert Hancock @ 2007-02-11 17:36 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Willy Tarreau, Rafael J. Wysocki, Daniel Barkalow, nigel,
	linux-kernel, Jeff Garzik, Pavel Machek, pm list

Matthew Garrett wrote:
> On Sun, Feb 11, 2007 at 07:54:04AM +0100, Willy Tarreau wrote:
> 
>> instead of modifying all drivers to explicitly state that they don't support
>> it, we should start with a test of the NULL pointer for .suspend which should
>> mean exactly the same without modifying the drivers. I find it obvious that
>> a driver which does provide a suspend function will not support it. And if
>> some drivers (eg /dev/null) can support it anyway, it's better to change
>> *those* drivers to explicitly mark them as compatible.
> 
> No, that doesn't work. In the absence of suspend/resume methods, the PCI 
> layer will implement basic PM itself. In some cases, this works. In 
> others, it doesn't. There's no way to automatically determine which is 
> which without modifying the drivers.
> 

The only thing that the PCI layer does for PM is the stuff that the 
driver would normally tell the PCI layer to do as part of a proper 
suspend/resume implementation: enable/disable the device and 
save/restore the PCI configuration space (only the standardized part, I 
believe). This is the bare minimum that's needed on all PCI devices, 
whether or not they even have a driver loaded. I suspect the number of 
PCI devices where this is truly all they need, i.e. no state in any IO 
ports or MMIO registers that need to be reset on resume, is quite low. 
Maybe in some cases it may appear to work by luck, i.e. the registers 
happening to be set to the correct values (especially on 
suspend-to-disk) but this is not a proper implementation.

-- 
Robert Hancock      Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 15:19                               ` Pekka Enberg
@ 2007-02-11 18:31                                 ` Rafael J. Wysocki
  0 siblings, 0 replies; 24+ messages in thread
From: Rafael J. Wysocki @ 2007-02-11 18:31 UTC (permalink / raw)
  To: Pekka Enberg
  Cc: Robert Hancock, Matthew Garrett, Pavel Machek, Jeff Garzik,
	Daniel Barkalow, pm list, Willy Tarreau, linux-kernel

On Sunday, 11 February 2007 16:19, Pekka Enberg wrote:
> On 2/11/07, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > Unfortunately it has to be done in one shot for all of the known good drivers to avoid
> > user-observable regressions.
> 
> No you don't. You can make it a config option that defaults to n
> during a transition period.

Yes, that's possible.

Greetings,
Rafael

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 17:27                               ` Daniel Barkalow
@ 2007-02-11 18:53                                 ` Rafael J. Wysocki
  2007-02-11 23:06                                   ` Nigel Cunningham
  0 siblings, 1 reply; 24+ messages in thread
From: Rafael J. Wysocki @ 2007-02-11 18:53 UTC (permalink / raw)
  To: Daniel Barkalow
  Cc: Robert Hancock, Matthew Garrett, Pavel Machek, Jeff Garzik,
	pm list, Willy Tarreau, linux-kernel

On Sunday, 11 February 2007 18:27, Daniel Barkalow wrote:
> On Sun, 11 Feb 2007, Rafael J. Wysocki wrote:
> 
> > The problem is it was made implicit long ago.  The design is "optimistic", so
> > to speak, and I think we have the following choices:
> > 
> > 1) Change the design to make the kernel refuse to suspend if there are any
> > drivers not explicitly flagged as "suspend/resume-safe".  [This looks like a
> > lot of work to me, but it is generally doable provided that someone has enough
> > time to do it.  Unfortunately it has to be done in one shot for all of the
> > known good drivers to avoid user-observable regressions.]
> 
> The kernel wouldn't necessarily have to refuse to suspend.

Well, not from the start, but I think at some point in the fufure it would.

> It could just warn (and list the drivers that aren't marked), or could
> require some extra insistance from the user.

We would have to change the interface for that and I don't want to do it.

> It would be good to have it log a message saying something like: "If you can
> read this, report that ne2000 seems to be safe for suspend/resume".

Sure, it would.

> Having drivers explicitly marked as to whether they are safe is a good kernel
> feature; what to do if they're not is policy.

That's true, but I assume that the people who opt for doing that are also
willing to take part in the review of the drivers. :-)

> > 2) Require the authors of new drivers to _either_ ensure that their drivers
> > will be suspend/resume-safe (and I mean both STR and STD here), _or_ explicitly
> > flag the drivers as "suspend/resume-unsafe", for example by impelenting
> > .suspend() routines returning -ENOSYS.  [The existing drivers can be modified
> > to follow this convention gradually.]
> 
> I don't see any reason not to do (2) regardless of (1). That was (my idea 
> of) the statement that started this thread: new drivers need to not mess 
> up on suspend/resume, as a matter of suitability for inclusion. Of course, 
> we need some way for drivers to indicate that they work fine with the 
> PCI-layer defaults. And it should probably more machine-readable than the 
> author telling reviewers that it works.

Well, if we change the design to fail by default, the authors of new drivers
will only have to flag them if they believe that the drivers are
suspend/resume-safe.

> > - Problem what to do with drivers that work for some people and don't work
> > for the others (ie. if we don't flag them as known good, we will break the
> > setups in which they work)
> 
> I think the only interesting case here is when a device resumes fine with 
> no driver support if the BIOS manages to deal effectively with it, but the 
> BIOS generally doesn't.

Well, I don't think so.  Let's estimate the number of drivers that define
.resume() right now:

$ grep -I -l -r '.resume =' linux-2.6.20/drivers/ | wc
    102     102    4169

And I think there are much more drivers that really work fine with respect
to the suspend/resume.

This indicates that in fact many drivers can be marked as known good even
though they don't define the .suspend() or .resume() routines.

Greetings,
Rafael

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-10 17:52           ` Daniel Barkalow
  2007-02-10 19:50             ` Rafael J. Wysocki
@ 2007-02-11 19:37             ` Pavel Machek
  1 sibling, 0 replies; 24+ messages in thread
From: Pavel Machek @ 2007-02-11 19:37 UTC (permalink / raw)
  To: Daniel Barkalow; +Cc: Robert Hancock, Jeff Garzik, pm list, linux-kernel

Hi!

> > Also, I think there are quite some drivers already in the tree that don't
> > support suspend/resume explicitly and honestly we should start from adding the
> > suspend/resume routines to these drivers _before_ we ban new drivers like that.
> 
> It'd be relatively quick to modify all the current drivers that don't 
> explicitly support suspend/resume to explicitly not support it. (Or

Well, I think that is more work than you realize, but yes, that patch
would really be welcome.
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 14:36                             ` Rafael J. Wysocki
  2007-02-11 15:19                               ` Pekka Enberg
  2007-02-11 17:27                               ` Daniel Barkalow
@ 2007-02-11 21:04                               ` Stefan Richter
  2 siblings, 0 replies; 24+ messages in thread
From: Stefan Richter @ 2007-02-11 21:04 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Robert Hancock, Matthew Garrett, Pavel Machek, Jeff Garzik,
	Daniel Barkalow, pm list, Willy Tarreau, linux-kernel

Rafael J. Wysocki wrote:
> - Problem what to do with drivers that work for some people and don't work
> for the others (ie. if we don't flag them as known good, we will break the
> setups in which they work)

And this issue is independent of whether a driver has .suspend and
.resume or not. For example, ohci1394 had them for ages but they didn't
work as expected before 2.6.20.

What's more, ohci1394's resume routine alone is insufficient; an
additional facility in ieee1394 was necessary and added for 2.6.21(-rc).
This shows that the original authors of ohci1394's .suspend and .resume
didn't test with actual external devices or gave up when they figured
that the problem reaches into upper subsystem layers. (We still haven't
tested interaction with most of the IEEE 1394 high level.)
-- 
Stefan Richter
-=====-=-=== --=- -=-==
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 13:09                   ` Willy Tarreau
  2007-02-11 13:19                     ` Matthew Garrett
@ 2007-02-11 21:10                     ` Pavel Machek
  1 sibling, 0 replies; 24+ messages in thread
From: Pavel Machek @ 2007-02-11 21:10 UTC (permalink / raw)
  To: Willy Tarreau
  Cc: Matthew Garrett, Rafael J. Wysocki, Daniel Barkalow, nigel,
	Robert Hancock, linux-kernel, Jeff Garzik, pm list

Hi!

> > > instead of modifying all drivers to explicitly state that they don't support
> > > it, we should start with a test of the NULL pointer for .suspend which should
> > > mean exactly the same without modifying the drivers. I find it obvious that
> > > a driver which does provide a suspend function will not support it. And if
> > > some drivers (eg /dev/null) can support it anyway, it's better to change
> > > *those* drivers to explicitly mark them as compatible.
> > 
> > No, that doesn't work. In the absence of suspend/resume methods, the PCI 
> > layer will implement basic PM itself. In some cases, this works. In 
> > others, it doesn't. There's no way to automatically determine which is 
> > which without modifying the drivers.
> 
> Then change the PCI layer to do the basic PM only for known compatible
> drivers, and modify only the known-compatible drivers to mark them
> explicitly compatible. IMHO, it generally is a bad idea to require that
> any driver explicitly states what it *does not* support. It's the reason
> why users encounter problem on new features with old drivers. For instance,
> do you know if the old ISA NE2000 driver breaks suspend ? I don't know,
> but I would at least expect it not to support it by default. It's best
> to announce what *is* supported and consider everything unimplemented
> otherwise explicitly stated.

Actually, ne2k driver is okay. ne2k cards are notoriously buggy, so it
responds with "****, that damn card has just locked up again, lets
reset it". Ok, it takes timeout to realize card is "locked up",
so it could be improved...

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 12:13                 ` Matthew Garrett
  2007-02-11 13:09                   ` Willy Tarreau
  2007-02-11 17:36                   ` Robert Hancock
@ 2007-02-11 22:49                   ` Nigel Cunningham
  2 siblings, 0 replies; 24+ messages in thread
From: Nigel Cunningham @ 2007-02-11 22:49 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: Willy Tarreau, Rafael J. Wysocki, Daniel Barkalow, Robert Hancock,
	linux-kernel, Jeff Garzik, Pavel Machek, pm list

Hi.

On Sun, 2007-02-11 at 12:13 +0000, Matthew Garrett wrote:
> On Sun, Feb 11, 2007 at 07:54:04AM +0100, Willy Tarreau wrote:
> 
> > instead of modifying all drivers to explicitly state that they don't support
> > it, we should start with a test of the NULL pointer for .suspend which should
> > mean exactly the same without modifying the drivers. I find it obvious that
> > a driver which does provide a suspend function will not support it. And if
> > some drivers (eg /dev/null) can support it anyway, it's better to change
> > *those* drivers to explicitly mark them as compatible.
> 
> No, that doesn't work. In the absence of suspend/resume methods, the PCI 
> layer will implement basic PM itself. In some cases, this works. In 
> others, it doesn't. There's no way to automatically determine which is 
> which without modifying the drivers.

I think we have it backwards there. Power management support for a
driver should always start with the driver itself. If there's a generic
routine that can be used for the bus, the driver should explicitly set
the routine to the generic routine.

Regards,

Nigel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 18:53                                 ` Rafael J. Wysocki
@ 2007-02-11 23:06                                   ` Nigel Cunningham
  2007-02-11 23:10                                     ` Rafael J. Wysocki
  0 siblings, 1 reply; 24+ messages in thread
From: Nigel Cunningham @ 2007-02-11 23:06 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Robert Hancock, Matthew Garrett, Pavel Machek, Jeff Garzik,
	Daniel Barkalow, pm list, Willy Tarreau, linux-kernel

Hi.

On Sun, 2007-02-11 at 19:53 +0100, Rafael J. Wysocki wrote:
> > Having drivers explicitly marked as to whether they are safe is a good kernel
> > feature; what to do if they're not is policy.
> 
> That's true, but I assume that the people who opt for doing that are also
> willing to take part in the review of the drivers. :-)

Absolutely :)

> Well, I don't think so.  Let's estimate the number of drivers that define
> .resume() right now:
> 
> $ grep -I -l -r '.resume =' linux-2.6.20/drivers/ | wc
>     102     102    4169

I think the '.resume =' doesn't help - some have tabs. I ran '\.resume'
and got 351.

It would be interesting to see how many struct pci_driver etc instances
lack resume methods.

Regards,

Nige

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH] Re: NAK new drivers without proper power management?
  2007-02-11 23:06                                   ` Nigel Cunningham
@ 2007-02-11 23:10                                     ` Rafael J. Wysocki
  0 siblings, 0 replies; 24+ messages in thread
From: Rafael J. Wysocki @ 2007-02-11 23:10 UTC (permalink / raw)
  To: nigel
  Cc: Robert Hancock, Matthew Garrett, Pavel Machek, Jeff Garzik,
	Daniel Barkalow, pm list, Willy Tarreau, linux-kernel

On Monday, 12 February 2007 00:06, Nigel Cunningham wrote:
> Hi.
> 
> On Sun, 2007-02-11 at 19:53 +0100, Rafael J. Wysocki wrote:
> > > Having drivers explicitly marked as to whether they are safe is a good kernel
> > > feature; what to do if they're not is policy.
> > 
> > That's true, but I assume that the people who opt for doing that are also
> > willing to take part in the review of the drivers. :-)
> 
> Absolutely :)
> 
> > Well, I don't think so.  Let's estimate the number of drivers that define
> > .resume() right now:
> > 
> > $ grep -I -l -r '.resume =' linux-2.6.20/drivers/ | wc
> >     102     102    4169
> 
> I think the '.resume =' doesn't help - some have tabs. I ran '\.resume'
> and got 351.

Ah, good catch.  I have searched for ".resume" only and got 612, but this
is the number of files, not the number of drivers.  And it is not exactly
large. ;-)

> It would be interesting to see how many struct pci_driver etc instances
> lack resume methods.

Yes, I'll try to invent a test.

Greetings,
Rafael

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2007-02-11 23:10 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <fa.xSKPgY66Q+DPCZ1pszFFfdrJ0To@ifi.uio.no>
     [not found] ` <45CD24F6.8090107@shaw.ca>
     [not found]   ` <1171076554.10170.5.camel@nigel.suspend2.net>
2007-02-10  9:34     ` [PATCH] Re: NAK new drivers without proper power management? Rafael J. Wysocki
2007-02-10 10:02       ` Nigel Cunningham
2007-02-10 10:30         ` Rafael J. Wysocki
2007-02-10 17:52           ` Daniel Barkalow
2007-02-10 19:50             ` Rafael J. Wysocki
2007-02-11  6:54               ` Willy Tarreau
2007-02-11 12:13                 ` Matthew Garrett
2007-02-11 13:09                   ` Willy Tarreau
2007-02-11 13:19                     ` Matthew Garrett
2007-02-11 13:37                       ` Willy Tarreau
2007-02-11 13:50                         ` Rafael J. Wysocki
2007-02-11 13:57                           ` Willy Tarreau
2007-02-11 14:36                             ` Rafael J. Wysocki
2007-02-11 15:19                               ` Pekka Enberg
2007-02-11 18:31                                 ` Rafael J. Wysocki
2007-02-11 17:27                               ` Daniel Barkalow
2007-02-11 18:53                                 ` Rafael J. Wysocki
2007-02-11 23:06                                   ` Nigel Cunningham
2007-02-11 23:10                                     ` Rafael J. Wysocki
2007-02-11 21:04                               ` Stefan Richter
2007-02-11 21:10                     ` Pavel Machek
2007-02-11 17:36                   ` Robert Hancock
2007-02-11 22:49                   ` Nigel Cunningham
2007-02-11 19:37             ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox