Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ON/OFF handling on recent ThinkPad t440p BIOS #102

Closed
wants to merge 2 commits into from

Conversation

doudou
Copy link

@doudou doudou commented Dec 20, 2014

This pull request fixes the ON/OFF handling on Lenovo ThinkPad t440p with recent BIOSes. See the second half of the thread in #78 for the complete background.

The general idea is that with recent BIOSes, the call to _DSM does not switch the card OFF, the transition to D3 does. An end result is that the card's identity does not change in lspci and the current state detection method in bbswitch is broken (and the card cannot be turned back ON after it is OFF). This PR implements a different mode where the card state is inferred from the ACPI-reported power state. Set use_acpi_to_detect_card_state to 1 to use this new mode.

@smunaut
Copy link

smunaut commented Jul 20, 2015

You might want to read what I wrote in #112 because it might be that you're not getting all the power savings you should.

@ArchangeGabriel
Copy link
Member

@Lekensteyn Any thoughts on this patch? Maybe we could first ship it this way an tell people who want to that they can try it, and if no issue arise, either make it the default or mix it with current way of doing things (in case they are some corner cases for this new method).

@doudou
Copy link
Author

doudou commented Jan 4, 2016

@Lekensteyn: as @smunaut noticed, my patch does fix the corruption issue, but the card is only put in D3 and not powered off, at least on recent Lenovo firmware versions. For that, one need to put the PCIe root in D3 (which Linux does not do automatically). @smunaut has a working hack that does it.
(#112). I say a hack because it turns the PCIe root off without telling the linux driver about it ....

@ArchangeGabriel ArchangeGabriel added this to the 1.0 Release milestone May 5, 2016
@Lekensteyn
Copy link
Member

Sorry for the delay, I could not give a meaningful response before. Now I looked into the details again and your (and @smunaut) observations are correct, _DSM cannot be used for turning it off. See also #115 (comment) for an initial analysis.

_PS3 only brings a device in D3hot state, so it is indeed not fully off (and the reported value by bbswitch is correct, it is indeed still ON). For the device to be put in fully off state (D3cold), the power resources have to be disabled (see the earlier comment for a reference to the ACPI specification).

If I remember correctly, the pci-set_power_state functions do correctly call _PS3 (bbswitch should probably use PCI_D3hot instead of PCI_D3cold for normal cases). Your patch tries to make bbswitch report OFF when the device is (hopefully) in D3hot, right? I think that we need something like #112 (have yet to review that, but if the idea is to put the parent PCIe port in OFF state, I think it is a good direction).

@doudou
Copy link
Author

doudou commented May 12, 2016

Yes. This PR is obsolete now that we @smunaut found the real underlying issue.

@doudou doudou closed this May 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants