On Wednesday, January 30, 2013 10:55:17 PM Rafael J. Wysocki wrote: > On Wednesday, January 30, 2013 06:53:46 PM Peter Wu wrote: > > Hi Lv Zheng, > > > > I encounter a regression with your patch (Linux 3.8-rc5). On my Nvidia Optimus > > laptop, I use the bbswitch[1] kernel module to trigger a _PS3 ACPI method call > > to turn the video card off. > > > > After this patch, I got the following in my kernel log: > > > > pci 0000:01:00.0: Refused to change power state, currently in D0 > > ACPI: Cannot transition to non-D0 state from D3 > > bbswitch: Succesfully loaded. Discrete card 0000:01:00.0 is on > > > > The expected output would be "Discrete card 0000:01:00.0 is off". Printing the > > contents of (acpi_device) device->power.state shows FF (ACPI_STATE_UNKNOWN). > > Should this condition be excluded from your check or is my hacky module > > outdated? > > > > I currently workaround this issue by checking for ACPI_STATE_UNKNOWN. If that > > is the value, I assume on (overwrite device->power.state with ACPI_STATE_D0). > > Then I call pci_set_power_state(pci_dev, PCI_D3cold). > > You shouldn't ever be transitioning from an uknown state to D3cold directly. > Please first transition to D0 and then to D3cold. > > Can you please test the linux-next branch of the linux-pm.git tree and check > if you see this problem in there too? To be more precise, I wonder why you get ACPI_STATE_UNKNOWN in device->power.state if the device is power-manageable. In theory acpi_bus_init_power() should change that to something meaningful and if it doesn't, then there's a bug either in acpi_bus_init_power() or in the BIOS. We may just need to try to force D0 in acpi_bus_init_power() if _PSC is missing, for example. Thanks, Rafael -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html