Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Compatibility with Linux 3.8 #46

Closed
Lekensteyn opened this Issue · 12 comments

5 participants

@Lekensteyn
Owner

On Linux 3.8, the card is not turned off on a fresh boot. The kernel log reads this on Linux 3.8 (at least v3.8-rc5-218-ga56e160, likely the final 3.8 too)

Feb 13 18:14:32 al kernel: bbswitch: version 0.5
Feb 13 18:14:32 al kernel: bbswitch: Found integrated VGA device 0000:00:02.0: \_SB_.PCI0.GFX0
Feb 13 18:14:32 al kernel: bbswitch: Found discrete VGA device 0000:01:00.0: \_SB_.PCI0.P0P2.PEGP
Feb 13 18:14:32 al kernel: bbswitch: detected an Optimus _DSM function
Feb 13 18:14:32 al kernel: bbswitch: disabling discrete graphics
Feb 13 18:14:32 al kernel: pci 0000:01:00.0: Refused to change power state, currently in D0
Feb 13 18:14:32 al kernel: ACPI: Cannot transition to non-D0 state from D3
Feb 13 18:14:32 al kernel: bbswitch: Succesfully loaded. Discrete card 0000:01:00.0 is on

This happens because the initial device state is unknown (ACPI_STATE_UNKNOWN). A workaround is implemented in:

  • 5593d95 Linux 3.8 compatibility hack

However, that was a workaround. A patch for Linux is around in mainline now:

commit b3785492268f9f3cdaa9722facb84b266dcf8bf6
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Fri Feb 1 23:43:02 2013 +0100

    ACPI / PM: Do not power manage devices in unknown initial states

I need to ping Rafael when 3.9-rc1 is out, then a backport to 3.8 will be made.

@ArchangeGabriel

Why am I not affected by this issue (currently running 3.8 final) ?

@Lekensteyn
Owner

You are unaffected if nvidia/nouveau are loaded once before bbswitch. It is also possible that you suspended or hibernated (not sure, but very likely to be the case too).

@ArchangeGabriel

Indeed, here is my kern.log from latest boot:

Feb 21 14:26:36 Archange-U43Jc kernel: [   17.802488] nvidia: module license 'NVIDIA' taints kernel.
Feb 21 14:26:36 Archange-U43Jc kernel: [   17.814094] nvidia 0000:01:00.0: enabling device (0000 -> 0003)
Feb 21 14:26:36 Archange-U43Jc kernel: [   17.814113] vgaarb: device changed decodes: PCI:0000:01:00.0,olddecodes=io+mem,decodes=none:owns=none
Feb 21 14:26:36 Archange-U43Jc kernel: [   17.814219] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  313.18  Wed Jan  9 17:02:09 PST 2013

But I'm a bit surprised since nvidia is supposed to be blacklisted... Oh wait... We blacklisted nvidia, nvidia-current, nvidia-current-updates, but not the new flavors... We also need to fix it.

@ArchangeGabriel

Now that it is properly blacklisted again, I can tell you again that I'm not affected AFAICS.

@presianbg

I confirm the problem with latest kernel 3.8 :

presian@IdeaPad-Y570:~$ cat /var/log/kern.log | grep -A5 bbswitch
bbswitch: version 0.5
bbswitch: Found integrated VGA device 0000:00:02.0: _SB_.PCI0.GFX0
bbswitch: Found discrete VGA device 0000:01:00.0: _SB_.PCI0.PEG0.PEGP
bbswitch: detected an Optimus _DSM function
bbswitch: Succesfully loaded. Discrete card 0000:01:00.0 is on
bbswitch: disabling discrete graphics
pci 0000:01:00.0: Refused to change power state, currently in D0
ACPI: Cannot transition to non-D0 state from D3

@Lekensteyn
Owner

You can try the workaround in develop for now, I will probably revert it later, when 3.8 gets patched as the workaround is quite hacky.

@presianbg

ya , the develop brunch works like a charm ! :)

@hadrons123

I use arch linux 3.8.1 stock kernel rebuit with kernel patch from rafel https://patchwork.kernel.org/patch/1917651/ for Lenovo Y580. I had to use bbswitch-git package from AUR for turning OFF nvidia. Otherwise it would remain ON.
@Lekensteyn

What is this patch for ? https://patchwork.kernel.org/patch/1746031/

Do we need it?

@Lekensteyn
Owner

@hadrons123

@Lekensteyn
Owner

I pinged Rafael already, I am still awaiting a reply.

@Lekensteyn Lekensteyn referenced this issue in Bumblebee-Project/Bumblebee
Closed

Inconsistency of bbswitch #358

@sentiono

Patched as suggested http://pastebin.com/kNfqPz2r

Mar 14 12:49:06 sentiono kernel: [ 34.991330] bbswitch: version 0.5
Mar 14 12:49:06 sentiono kernel: [ 34.991339] bbswitch: Found integrated VGA device 0000:00:02.0:_SB_.PCI0.GFX0
Mar 14 12:49:06 sentiono kernel: [ 34.991347] bbswitch: Found discrete VGA device 0000:01:00.0:_SB_.PCI0.PEG0.PEGP
Mar 14 12:49:06 sentiono kernel: [ 34.991457] bbswitch: detected an Optimus _DSM function
Mar 14 12:49:06 sentiono kernel: [ 34.991468] bbswitch: Succesfully loaded. Discrete card 0000:01:00.0 is on

Using "tee /proc/acpi/bbswitch <<< OFF"
Mar 14 12:53:42 sentiono kernel: [ 311.115889] bbswitch: device 0000:01:00.0 is in use by driver 'nvidia', refusing OFF

Note:
Since I was informed that acpi_handle_hack is not required on Acer, I've removed acpi_handle_hack compare to previous state before I patched the bbswitch

@Lekensteyn
Owner

bbswitch 0.6 gained 3.8 compatibility (for Lenovo acpi-handle-hack issues, see #2, this is unrelated).

@Lekensteyn Lekensteyn closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.