On Mon, Aug 08, 2005 at 12:42:49PM -0700, Greg KH wrote:
> On Mon, Aug 08, 2005 at 12:32:09PM -0700, David S. Miller wrote:

> > And lo' and behold, we find the answer in the PCI probing code.
> > It initializes every PCI device's PCI power state to "unknown":
> >  
> >     /* "Unknown power state" */
> >     dev->current_state = 4;
> > 
> > and thus makes this test ">= D3hot" pass in the pci_set_power_state()
> > code.
> 
> Crap, gotta love >= checks on enumerated types...

The "dev->current_state = 4" is what prompted the ">= D3hot" in the
first place... :-)

I had seen a patch from earlier this year that changed the probing
code to actually get the power state from the device (and added a
pci_get_power_state API).  I don't know why that never got merged,
but since it didn't I had to account for the case of the power state
being unknown (i.e dev->current_state == 4).

So, w/ Dave's patch for Sparc64 to use setup-res.c, does the patch
stay?  Is there anything else I need to do?

Thanks,

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

Reply via email to