Bug 121691

Summary: Bumblebee doesn’t switch off the discreet card (kernels newer than 4.1)
Product: Drivers Reporter: Eugen (eugen.balintescu)
Component: Video(Other)Assignee: drivers_video-other
Status: NEW ---    
Severity: normal CC: fademind, peter
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: Newer than 4.1 Subsystem:
Regression: Yes Bisected commit-id:

Description Eugen 2016-07-08 18:59:21 UTC
Hello,

If I use a kernel newer that 4.1, bumblebee doesn't switch the discreet card off after use.
I can only run a program with primusrun. If I close it, I can't run another unless I reboot the laptop and that takes a very long time.
I get

[eugen@manjaro ~]$ cat /proc/acpi/bbswitch
0000:04:00.0 ON

Running dmesg I get

[   76.846847] bbswitch: enabling discrete graphics
[   76.968754] nvidia: module license 'NVIDIA' taints kernel.
[   76.968758] Disabling lock debugging due to kernel taint
[   76.977982] nvidia-nvlink: Nvlink Core is being initialized, major device number 245
[   76.978003] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  364.19  Tue Apr 19 14:44:55 PDT 2016
[   77.036333] vgaarb: this pci device is not a vga device
[   77.039645] ACPI Warning: \_SB_.PCI0.RP05.PXSX._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[   77.039676] ACPI Warning: \_SB_.PCI0.RP05.PXSX._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[   77.039690] ACPI Warning: \_SB_.PCI0.RP05.PXSX._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[   77.039713] ACPI Warning: \_SB_.PCI0.RP05.PXSX._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[   77.039727] ACPI Warning: \_SB_.PCI0.RP05.PXSX._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[   77.039764] ACPI Warning: \_SB_.PCI0.RP05.PXSX._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[   77.039777] ACPI Warning: \_SB_.PCI0.RP05.PXSX._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[   77.054350] ACPI Warning: \_SB_.PCI0.RP05.PXSX._DSM: Argument #4 type mismatch - Found [Buffer], ACPI requires [Package] (20150930/nsarguments-95)
[   77.194044] vgaarb: this pci device is not a vga device
[   77.264798] nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  364.19  Tue Apr 19 14:15:03 PDT 2016
[  360.150412] INFO: task Xorg:1829 blocked for more than 120 seconds.
[  360.150417]       Tainted: P           O    4.4.14-3-MANJARO #1
[  360.150418] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  360.150420] Xorg            D ffff880203803af8     0  1829    572 0x00400004
[  360.150424]  ffff880203803af8 00ffffffa1049701 ffff880255263700 ffff8802395a3700
[  360.150426]  ffff880203804000 ffff880203803cb0 ffff880203803ca8 0000000000000000
[  360.150428]  ffff8802395a3700 ffff880203803b10 ffffffff815a2cac 7fffffffffffffff
[  360.150431] Call Trace:
[  360.150436]  [<ffffffff815a2cac>] schedule+0x3c/0x90
[  360.150439]  [<ffffffff815a56f6>] schedule_timeout+0x1d6/0x260
[  360.150526]  [<ffffffffa0d99d92>] ? os_acquire_spinlock+0x12/0x20 [nvidia]
[  360.150583]  [<ffffffffa0d99d92>] ? os_acquire_spinlock+0x12/0x20 [nvidia]
[  360.150585]  [<ffffffff815a3821>] wait_for_common+0xc1/0x180
[  360.150589]  [<ffffffff810a1110>] ? wake_up_q+0x70/0x70
[  360.150591]  [<ffffffff815a38fd>] wait_for_completion+0x1d/0x20
[  360.150594]  [<ffffffff8108d002>] flush_workqueue+0x132/0x5e0
[  360.150676]  [<ffffffffa126a88b>] ? _nv014870rm+0x1b/0x40 [nvidia]
[  360.150734]  [<ffffffffa0d99bde>] os_flush_work_queue+0x4e/0x60 [nvidia]
[  360.150814]  [<ffffffffa12bcc77>] rm_disable_adapter+0x77/0x130 [nvidia]
[  360.150816]  [<ffffffff810bf400>] ? up+0x10/0x50
[  360.150873]  [<ffffffffa0d9d023>] ? nv_uvm_notify_stop_device+0x63/0x80 [nvidia]
[  360.150929]  [<ffffffffa0d8e78d>] ? nv_close_device+0xed/0x130 [nvidia]
[  360.150985]  [<ffffffffa0d909b4>] ? nvidia_close+0xd4/0x2c0 [nvidia]
[  360.151041]  [<ffffffffa0d8e39c>] ? nvidia_frontend_close+0x2c/0x50 [nvidia]
[  360.151043]  [<ffffffff811e52dc>] ? __fput+0x9c/0x1f0
[  360.151045]  [<ffffffff811e549e>] ? ____fput+0xe/0x10
[  360.151047]  [<ffffffff81093b74>] ? task_work_run+0x84/0xa0
[  360.151049]  [<ffffffff8100369a>] ? exit_to_usermode_loop+0xba/0xc0
[  360.151051]  [<ffffffff81003bde>] ? syscall_return_slowpath+0x4e/0x60
[  360.151054]  [<ffffffff815a68c8>] ? int_ret_from_sys_call+0x25/0x8f
[  480.153934] INFO: task Xorg:1829 blocked for more than 120 seconds.
[  480.153939]       Tainted: P           O    4.4.14-3-MANJARO #1
[  480.153940] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  480.153942] Xorg            D ffff880203803af8     0  1829    572 0x00400004
[  480.153945]  ffff880203803af8 00ffffffa1049701 ffff880255263700 ffff8802395a3700
[  480.153948]  ffff880203804000 ffff880203803cb0 ffff880203803ca8 0000000000000000
[  480.153950]  ffff8802395a3700 ffff880203803b10 ffffffff815a2cac 7fffffffffffffff
[  480.153952] Call Trace:
[  480.153958]  [<ffffffff815a2cac>] schedule+0x3c/0x90
[  480.153961]  [<ffffffff815a56f6>] schedule_timeout+0x1d6/0x260
[  480.154047]  [<ffffffffa0d99d92>] ? os_acquire_spinlock+0x12/0x20 [nvidia]
[  480.154104]  [<ffffffffa0d99d92>] ? os_acquire_spinlock+0x12/0x20 [nvidia]
[  480.154106]  [<ffffffff815a3821>] wait_for_common+0xc1/0x180
[  480.154110]  [<ffffffff810a1110>] ? wake_up_q+0x70/0x70
[  480.154112]  [<ffffffff815a38fd>] wait_for_completion+0x1d/0x20
[  480.154114]  [<ffffffff8108d002>] flush_workqueue+0x132/0x5e0
[  480.154196]  [<ffffffffa126a88b>] ? _nv014870rm+0x1b/0x40 [nvidia]
[  480.154254]  [<ffffffffa0d99bde>] os_flush_work_queue+0x4e/0x60 [nvidia]
[  480.154333]  [<ffffffffa12bcc77>] rm_disable_adapter+0x77/0x130 [nvidia]
[  480.154336]  [<ffffffff810bf400>] ? up+0x10/0x50
[  480.154393]  [<ffffffffa0d9d023>] ? nv_uvm_notify_stop_device+0x63/0x80 [nvidia]
[  480.154449]  [<ffffffffa0d8e78d>] ? nv_close_device+0xed/0x130 [nvidia]
[  480.154504]  [<ffffffffa0d909b4>] ? nvidia_close+0xd4/0x2c0 [nvidia]
[  480.154560]  [<ffffffffa0d8e39c>] ? nvidia_frontend_close+0x2c/0x50 [nvidia]
[  480.154562]  [<ffffffff811e52dc>] ? __fput+0x9c/0x1f0
[  480.154564]  [<ffffffff811e549e>] ? ____fput+0xe/0x10
[  480.154566]  [<ffffffff81093b74>] ? task_work_run+0x84/0xa0
[  480.154568]  [<ffffffff8100369a>] ? exit_to_usermode_loop+0xba/0xc0
[  480.154570]  [<ffffffff81003bde>] ? syscall_return_slowpath+0x4e/0x60
[  480.154573]  [<ffffffff815a68c8>] ? int_ret_from_sys_call+0x25/0x8f
[  600.156922] INFO: task Xorg:1829 blocked for more than 120 seconds.
[  600.156926]       Tainted: P           O    4.4.14-3-MANJARO #1
[  600.156927] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  600.156929] Xorg            D ffff880203803af8     0  1829    572 0x00400004
[  600.156933]  ffff880203803af8 00ffffffa1049701 ffff880255263700 ffff8802395a3700
[  600.156935]  ffff880203804000 ffff880203803cb0 ffff880203803ca8 0000000000000000
[  600.156938]  ffff8802395a3700 ffff880203803b10 ffffffff815a2cac 7fffffffffffffff
[  600.156940] Call Trace:
[  600.156945]  [<ffffffff815a2cac>] schedule+0x3c/0x90
[  600.156948]  [<ffffffff815a56f6>] schedule_timeout+0x1d6/0x260
[  600.157011]  [<ffffffffa0d99d92>] ? os_acquire_spinlock+0x12/0x20 [nvidia]
[  600.157059]  [<ffffffffa0d99d92>] ? os_acquire_spinlock+0x12/0x20 [nvidia]
[  600.157061]  [<ffffffff815a3821>] wait_for_common+0xc1/0x180
[  600.157064]  [<ffffffff810a1110>] ? wake_up_q+0x70/0x70
[  600.157066]  [<ffffffff815a38fd>] wait_for_completion+0x1d/0x20
[  600.157069]  [<ffffffff8108d002>] flush_workqueue+0x132/0x5e0
[  600.157146]  [<ffffffffa126a88b>] ? _nv014870rm+0x1b/0x40 [nvidia]
[  600.157196]  [<ffffffffa0d99bde>] os_flush_work_queue+0x4e/0x60 [nvidia]
[  600.157273]  [<ffffffffa12bcc77>] rm_disable_adapter+0x77/0x130 [nvidia]
[  600.157276]  [<ffffffff810bf400>] ? up+0x10/0x50
[  600.157323]  [<ffffffffa0d9d023>] ? nv_uvm_notify_stop_device+0x63/0x80 [nvidia]
[  600.157368]  [<ffffffffa0d8e78d>] ? nv_close_device+0xed/0x130 [nvidia]
[  600.157414]  [<ffffffffa0d909b4>] ? nvidia_close+0xd4/0x2c0 [nvidia]
[  600.157459]  [<ffffffffa0d8e39c>] ? nvidia_frontend_close+0x2c/0x50 [nvidia]
[  600.157461]  [<ffffffff811e52dc>] ? __fput+0x9c/0x1f0
[  600.157463]  [<ffffffff811e549e>] ? ____fput+0xe/0x10
[  600.157465]  [<ffffffff81093b74>] ? task_work_run+0x84/0xa0
[  600.157467]  [<ffffffff8100369a>] ? exit_to_usermode_loop+0xba/0xc0
[  600.157469]  [<ffffffff81003bde>] ? syscall_return_slowpath+0x4e/0x60
[  600.157472]  [<ffffffff815a68c8>] ? int_ret_from_sys_call+0x25/0x8f
[  720.159838] INFO: task Xorg:1829 blocked for more than 120 seconds.
[  720.159842]       Tainted: P           O    4.4.14-3-MANJARO #1
[  720.159843] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[  720.159845] Xorg            D ffff880203803af8     0  1829    572 0x00400004
[  720.159849]  ffff880203803af8 00ffffffa1049701 ffff880255263700 ffff8802395a3700
[  720.159852]  ffff880203804000 ffff880203803cb0 ffff880203803ca8 0000000000000000
[  720.159854]  ffff8802395a3700 ffff880203803b10 ffffffff815a2cac 7fffffffffffffff
[  720.159856] Call Trace:
[  720.159861]  [<ffffffff815a2cac>] schedule+0x3c/0x90
[  720.159864]  [<ffffffff815a56f6>] schedule_timeout+0x1d6/0x260
[  720.159947]  [<ffffffffa0d99d92>] ? os_acquire_spinlock+0x12/0x20 [nvidia]
[  720.160004]  [<ffffffffa0d99d92>] ? os_acquire_spinlock+0x12/0x20 [nvidia]
[  720.160006]  [<ffffffff815a3821>] wait_for_common+0xc1/0x180
[  720.160009]  [<ffffffff810a1110>] ? wake_up_q+0x70/0x70
[  720.160011]  [<ffffffff815a38fd>] wait_for_completion+0x1d/0x20
[  720.160014]  [<ffffffff8108d002>] flush_workqueue+0x132/0x5e0
[  720.160096]  [<ffffffffa126a88b>] ? _nv014870rm+0x1b/0x40 [nvidia]
[  720.160154]  [<ffffffffa0d99bde>] os_flush_work_queue+0x4e/0x60 [nvidia]
[  720.160234]  [<ffffffffa12bcc77>] rm_disable_adapter+0x77/0x130 [nvidia]
[  720.160236]  [<ffffffff810bf400>] ? up+0x10/0x50
[  720.160293]  [<ffffffffa0d9d023>] ? nv_uvm_notify_stop_device+0x63/0x80 [nvidia]
[  720.160349]  [<ffffffffa0d8e78d>] ? nv_close_device+0xed/0x130 [nvidia]
[  720.160405]  [<ffffffffa0d909b4>] ? nvidia_close+0xd4/0x2c0 [nvidia]
[  720.160460]  [<ffffffffa0d8e39c>] ? nvidia_frontend_close+0x2c/0x50 [nvidia]
[  720.160462]  [<ffffffff811e52dc>] ? __fput+0x9c/0x1f0
[  720.160464]  [<ffffffff811e549e>] ? ____fput+0xe/0x10
[  720.160466]  [<ffffffff81093b74>] ? task_work_run+0x84/0xa0
[  720.160468]  [<ffffffff8100369a>] ? exit_to_usermode_loop+0xba/0xc0
[  720.160470]  [<ffffffff81003bde>] ? syscall_return_slowpath+0x4e/0x60
[  720.160473]  [<ffffffff815a68c8>] ? int_ret_from_sys_call+0x25/0x8f

I was told to report this regression here. Someone else on the manjaro forum has the exact problem.
My laptop is an Acer Aspire E 17, i5-5200U, Nvidia GeForce 840M

Thanks for your help
Comment 1 Peter Wu 2016-07-16 11:10:20 UTC
Newer than 4.1 or including 4.1? In that case you might want to try adding the boot option acpi_osi="!Windows 2015"

Please attach your acpidump info as well (ideally create the tarball as described at https://bugs.launchpad.net/lpbugreporter/+bug/752542 and upload it there).

Can you reproduce the problem with the nouveau driver without Bumblebee or bbswitch?
Comment 2 Eugen 2016-07-16 14:16:36 UTC
I don't have any problems with kernel 4.1, only with the kernels that came after.

I attached my acpidump as you asked:
https://bugs.launchpad.net/lpbugreporter/+bug/752542/comments/782

Please check this here:
https://github.com/Bumblebee-Project/Bumblebee/issues/780

Someone asked me there to try nouveau instead of nvidia and the problem was the same.

Thanks