Bumblebee-Project / Bumblebee

Bumblebee daemon and client rewritten in C
http://www.bumblebee-project.org/
GNU General Public License v3.0
1.29k stars 142 forks source link

Kernel crash when disabling graphics twice #1002

Open randomshinichi opened 5 years ago

randomshinichi commented 5 years ago

Thinkpad T430 on Xubuntu 18.04 Kinda trivial problem really but so far it was not easy getting Bumblebee to work properly, so hopefully fixing this will raise the code quality.

[  369.266794] bbswitch: disabling discrete graphics
[  369.267649] ------------[ cut here ]------------
[  369.267651] pci 0000:01:00.0: disabling already-disabled device
[  369.267666] WARNING: CPU: 3 PID: 2759 at /build/linux-60XibS/linux-4.15.0/drivers/pci/pci.c:1646 pci_disable_device+0x9c/0xc0
[  369.267667] Modules linked in: ccm acpi_call(OE) bbswitch(OE) cmac bnep zfs(PO) zunicode(PO) zavl(PO) icp(PO) zcommon(PO) znvpair(PO) spl(O) btusb btrtl btbcm btintel bluetooth uvcvideo videobuf2_vmalloc videobuf2_memops ecdh_generic videobuf2_v4l2 videobuf2_core videodev media cdc_mbim cdc_ncm usbnet mii cdc_wdm cdc_acm wmi_bmof intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel pcbc aesni_intel snd_hda_codec_realtek aes_x86_64 snd_hda_codec_generic crypto_simd glue_helper arc4 cryptd intel_cstate intel_rapl_perf iwldvm joydev mac80211 input_leds serio_raw snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep snd_seq_midi snd_seq_midi_event snd_rawmidi iwlwifi snd_pcm thinkpad_acpi snd_seq nvram snd_seq_device snd_timer
[  369.267718]  cfg80211 lpc_ich snd mei_me mei wmi soundcore mac_hid shpchp sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 btrfs xor zstd_compress raid6_pq i915 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt psmouse fb_sys_fops e1000e drm ahci ptp pps_core libahci sdhci_pci sdhci ipmi_devintf ipmi_msghandler video [last unloaded: nvidia]
[  369.267747] CPU: 3 PID: 2759 Comm: bash Tainted: P           OE    4.15.0-29-generic #31-Ubuntu
[  369.267748] Hardware name: LENOVO 2347DE9/2347DE9, BIOS G1ETA1WW (2.61 ) 12/03/2013
[  369.267751] RIP: 0010:pci_disable_device+0x9c/0xc0
[  369.267752] RSP: 0018:ffff9db5c1d6fe08 EFLAGS: 00010282
[  369.267754] RAX: 0000000000000000 RBX: ffff8d15f662c000 RCX: ffffffffba262828
[  369.267755] RDX: 0000000000000001 RSI: 0000000000000096 RDI: 0000000000000247
[  369.267756] RBP: ffff9db5c1d6fe18 R08: 0000000000000033 R09: 00000000000003e7
[  369.267757] R10: 0000000000000000 R11: 0000000000000000 R12: ffff8d15f65e40f0
[  369.267758] R13: 00005580d15b62b0 R14: 00005580d15b62b0 R15: ffff8d15f1bb8100
[  369.267760] FS:  00007fc38836d740(0000) GS:ffff8d15fe2c0000(0000) knlGS:0000000000000000
[  369.267761] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  369.267762] CR2: 00005580d15b62b1 CR3: 00000001abbee001 CR4: 00000000001606e0
[  369.267763] Call Trace:
[  369.267771]  bbswitch_off+0xbb/0x230 [bbswitch]
[  369.267774]  bbswitch_proc_write+0xb5/0xcc [bbswitch]
[  369.267777]  proc_reg_write+0x45/0x70
[  369.267781]  __vfs_write+0x1b/0x40
[  369.267784]  vfs_write+0xb1/0x1a0
[  369.267786]  SyS_write+0x55/0xc0
[  369.267789]  do_syscall_64+0x73/0x130
[  369.267794]  entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[  369.267796] RIP: 0033:0x7fc387a54154
[  369.267797] RSP: 002b:00007fff589a0e68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[  369.267799] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007fc387a54154
[  369.267800] RDX: 0000000000000004 RSI: 00005580d15b62b0 RDI: 0000000000000001
[  369.267801] RBP: 00005580d15b62b0 R08: 000000000000000a R09: 0000000000000003
[  369.267802] R10: 000000000000000a R11: 0000000000000246 R12: 00007fc387d30760
[  369.267803] R13: 0000000000000004 R14: 00007fc387d2c2a0 R15: 00007fc387d2b760
[  369.267804] Code: 00 c6 05 ea 15 12 01 01 4d 85 e4 74 36 48 8d bb a0 00 00 00 e8 c6 5b 15 00 4c 89 e2 48 89 c6 48 c7 c7 08 e5 f1 b9 e8 d4 d3 b9 ff <0f> 0b eb 82 48 89 df e8 d8 fe ff ff 80 a3 c1 07 00 00 f7 5b 41 
[  369.267839] ---[ end trace ce290673d382e865 ]---
[  369.285323] pci_raw_set_power_state: 14 callbacks suppressed
[  369.285327] pci 0000:01:00.0: Refused to change power state, currently in D0
[  369.287102] thinkpad_acpi: EC reports that Thermal Table has changed
[  578.595185] bbswitch: enabling discrete graphics
[  578.865569] thinkpad_acpi: EC reports that Thermal Table has changed
[  583.165532] bbswitch: disabling discrete graphics
[  583.188031] thinkpad_acpi: EC reports that Thermal Table has changed
root@berserker:~# 

Side note: I get different problems every time I reinstall the OS with an Ansible script. Currently optirun won't work, I always get something like X Error Bad Value (X_GLX...this changes) when running glxgears. But it ran before, and once I even fixed it by unplugging the battery, rebooting. This trick doesn't work this time.

I can't bother atm and I'm just modprobe nvidia and restarting X when I want to run something heavy.

ml31415 commented 5 years ago

Same bug here, though it doesn't crash the machine at least.

[   62.391957] pci 0000:03:00.0: disabling already-disabled device
[   62.391979] WARNING: CPU: 1 PID: 2429 at drivers/pci/pci.c:1914 pci_disable_device+0x91/0xb0
[   62.391981] Modules linked in: ccm rfcomm cmac bnep binfmt_misc nls_iso8859_1 intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp mei_hdcp kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul snd_hda_codec_conexant snd_hda_codec_generic snd_hda_codec_hdmi ledtrig_audio snd_hda_intel ghash_clmulni_intel snd_hda_codec snd_hda_core snd_hwdep arc4 snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi snd_seq aesni_intel uvcvideo videobuf2_vmalloc videobuf2_memops aes_x86_64 crypto_simd videobuf2_v4l2 cryptd videobuf2_common glue_helper iwlmvm intel_cstate btusb videodev btrtl btbcm mac80211 btintel bluetooth input_leds joydev snd_seq_device intel_rapl_perf asus_nb_wmi asus_wmi serio_raw sparse_keymap snd_timer media mxm_wmi iwlwifi ecdh_generic intel_pch_thermal snd cfg80211 mei_me lpc_ich processor_thermal_device int340x_thermal_zone soundcore intel_soc_dts_iosf mei acpi_als kfifo_buf industrialio acpi_pad mac_hid int3400_thermal acpi_thermal_rel sch_fq_codel bbswitch(OE) lp parport
[   62.392039]  ip_tables x_tables autofs4 i915 i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ahci drm libahci psmouse video wmi
[   62.392054] CPU: 1 PID: 2429 Comm: powersave.sh Tainted: G     U     OE     5.1.2-050102-generic #201905141830
[   62.392056] Hardware name: ASUSTeK COMPUTER INC. UX303LNB/UX303LNB, BIOS UX303LNB.203 12/10/2014
[   62.392061] RIP: 0010:pci_disable_device+0x91/0xb0
[   62.392064] Code: 4d 85 e4 75 07 4c 8b a3 c0 00 00 00 48 8d bb b0 00 00 00 e8 61 0e 17 00 4c 89 e2 48 c7 c7 d0 fb 93 bd 48 89 c6 e8 c1 6b b5 ff <0f> 0b eb 8d 48 89 df e8 e3 fe ff ff 80 a3 d1 07 00 00 df 5b 41 5c
[   62.392066] RSP: 0018:ffffb179c3d33e00 EFLAGS: 00010286
[   62.392069] RAX: 0000000000000000 RBX: ffff9e0fa0389000 RCX: 0000000000000000
[   62.392071] RDX: 0000000000000033 RSI: ffffffffbe1648d3 RDI: 0000000000000246
[   62.392073] RBP: ffffb179c3d33e10 R08: ffffffffbe1648a0 R09: 0000000000022700
[   62.392075] R10: 0000002773792e5a R11: ffffffffbe1648a0 R12: ffff9e0fa036ac10
[   62.392076] R13: 000055ddb7a324a0 R14: 000055ddb7a324a0 R15: 0000000000000000
[   62.392080] FS:  00007f287c17a740(0000) GS:ffff9e0fa2a80000(0000) knlGS:0000000000000000
[   62.392082] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   62.392084] CR2: 00007f287bb517f0 CR3: 000000031ee14006 CR4: 00000000003606e0
[   62.392086] Call Trace:
[   62.392097]  bbswitch_off+0xbb/0x230 [bbswitch]
[   62.392102]  bbswitch_proc_write+0xb5/0xcc [bbswitch]
[   62.392108]  proc_reg_write+0x3e/0x60
[   62.392112]  __vfs_write+0x1b/0x40
[   62.392116]  vfs_write+0xab/0x1b0
[   62.392120]  ksys_write+0x5c/0xd0
[   62.392124]  __x64_sys_write+0x1a/0x20
[   62.392130]  do_syscall_64+0x5a/0x110
[   62.392135]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[   62.392138] RIP: 0033:0x7f287b875154
[   62.392141] Code: 89 02 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 8d 05 b1 07 2e 00 8b 00 85 c0 75 13 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 f3 c3 66 90 41 54 55 49 89 d4 53 48 89 f5
[   62.392143] RSP: 002b:00007fff2a011d78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
[   62.392146] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f287b875154
[   62.392148] RDX: 0000000000000004 RSI: 000055ddb7a324a0 RDI: 0000000000000001
[   62.392149] RBP: 000055ddb7a324a0 R08: 000000000000000a R09: 0000000000000003
[   62.392151] R10: 000000000000000a R11: 0000000000000246 R12: 00007f287bb51760
[   62.392153] R13: 0000000000000004 R14: 00007f287bb4d2a0 R15: 00007f287bb4c760
[   62.392157] ---[ end trace 13bfb1f9f5d04285 ]---