linux-surfacebook icon indicating copy to clipboard operation
linux-surfacebook copied to clipboard

hibernation fails

Open casainho opened this issue 8 years ago • 47 comments

Thanks for sharing!! If you have any guess why hibernation fails or where I should report...

I would like to report that I am now running Ubuntu on SP4, with kernel 4.9.3. The Ubuntu base kernel 4.9.3 have buttons and wifi working but misses: keyboard and touchscreen. This kernel also hibernates.

I built the Ubuntu kernel 4.9.3 based on this information: https://github.com/afzalarsalan/linux-surfacebook -- I think is the most recent kernel for Surface Pro 4!!

If I build the kernel using the touchscreen patch, the touchscreen works but the hibernation fails :-( -- so I built another time but without the touchscreen patch and I use it like that, because I do not use touchscreen but I need hibernation. Anyway, I keep both version of kernel and so I can use touchscreen If I need for some reason.

Instructions for building this kernel for Ubuntu: * git clone --branch v4.9.3 git://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack --depth=1 * Download the Ubuntu patches here: http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9.3/ and apply them to the base kernel * apply multitouch(keyboard) and wifi patch from https://github.com/afzalarsalan/linux-surfacebook * create the folder: firmware/intel/ipts on linux source directory and put inside the file ipts_fw_config.bin * install ubuntu kernel 4.9.3 and them copy the .config file from /boot folder to the linux source directory. Then edit .config file to add "CONFIG_INTEL_IPTS=m" after the line "CONFIG_INTEL_MEI_TXE=m" * make menuconfig (exit if you don't need to edit) * make -j8 * sudo make modules_install * sudo make install

After hibernation, wifi do not work but you can run this script that will put it working: /bin/bash ip link set wlp2s0 down modprobe -r mwifiex_pcie modprobe mwifiex_pcie service network-manager restart

casainho avatar Jan 13 '17 17:01 casainho

Hmm, appreciate your time in looking into this. I knew hibernation would seem to randomly work for some reason and now I know why. That's an interesting interaction and hopefully I can find some way to alleviate this problem. Thanks for the info!

afzalarsalan avatar Jan 16 '17 02:01 afzalarsalan

Well, after many tests I found that this kernel (4.9.4, and I am using the Ubuntu patchs on it) fails to hibernate, using the touchscreen patch or even without it. Very few times it hibernates ok, like 5% of time.

I am back to 4.4.39 that hibernates always (and I am using the Ubuntu patchs on it).

Anyway I am keeping 4.9.4 with touchscreen, even if does not hibernate. For some reason I may need to use touchscreen. I don't feel Ubuntu and all other software is ready for touch - but anyway, the on screen keyboard (Orca) and Ubuntu Unity seem good for touch.

casainho avatar Jan 22 '17 10:01 casainho

Well i'm on SP4 havent yet set wifi but hibernation don't work ^^ Plus if i take out and put back the type cover, i have to reboot for it to work :P

alkeryn avatar Jan 31 '17 21:01 alkeryn

The type cover thing is something that's been prominent across all kernels and as far as I know there's no patch for it. It's also something I can't fix because I don't have a Surface Pro 4 and surprisingly Surface Book detachment works for the most part (although there's little use for it)

afzalarsalan avatar Jan 31 '17 22:01 afzalarsalan

I've done everything plus the touch part i've add "options CONFIG_INTEL_IPTS=m" in /boot/loader/entries/surface.conf (i'm using systemd-boot should i do it differently ?) and copied all the .bin in /lib/firmware/intel/ipts/ and /lib/firmare/i915/ and made the links ( ln ) and touchscreen still don't work plus i don't have composing on cinnamon for some reason have you an idea how to fix it ? :P plus when i try the echo 0 > /sys/kernel/debug/ipts/mode thing it say there is an I/O error ^^

alkeryn avatar Feb 01 '17 03:02 alkeryn

for the echo 0 > ... thing i recommend putting it in rc.local (just google it). Make sure you enable rc.local to start up on boot (by default it doesn't with ubuntu 16.04+). This is of course assuming you're on ubuntu. Here's a prebuilt kernel for the sp4 that uses builds from this repo which works just fine. https://www.reddit.com/r/SurfaceLinux/comments/5pwaa6/superkerneltouch_for_sp4_ubuntu/ However hibernation doesn't work

brianc118 avatar Feb 01 '17 11:02 brianc118

I'm on arch linux, i compiled from source, installed the kernel, copied the files and linked them and set the kernel in the bootloader but still no touchscreen and i don't understand ^^

alkeryn avatar Feb 01 '17 15:02 alkeryn

Okay, let's start from the usual culprits.... 1) Make sure you're actually booting this kernel and not the stock one because this makes another vmlinuz instead of replacing the stock one. 2) In regards to the linking of the binaries to their correct names, try using different version numbers than the one recommended here under the IPTS section. I end up having to use the version ending in 76 for my Surface Book as it's the only one that ends up being fully functional on my laptop. The ones ending in 78 end up giving me zero touch response like what you are experiencing. For Arch Linux, literally all you need to do is install this package and link the binaries. You mention something about "options CONFIG_INTEL_IPTS=m" which from what I can tell does nothing. ro root=UUID=c1c897b4-b0bf-4af3-bbb8-1af23d0c23df initrd=/boot/intel-ucode.img initrd=/boot/initramfs-linux-surfacebook.img quiet That's my personal configuration on my personal laptop meaning that the only option would be "quiet". From this point, in order to debug this, you would probably need to post your boot log (make sure to scan for personal information before posting)

afzalarsalan avatar Feb 01 '17 21:02 afzalarsalan

You don't need to move over any of the i915 stuff because it's provided by the linux-firmware package. In fact if you overwrote any of the prior existing files, you probably want to delete them and reinstall the linux-firmware package because 9/10 the binaries from that package are newer than what's on the internet.

afzalarsalan avatar Feb 01 '17 21:02 afzalarsalan

Well i removed windows so i just have the 078 and 079 do you know where i could find 076 ? :) Well i already mooved the i915 stuff so how do i revert it back as you recomand ?

alkeryn avatar Feb 01 '17 22:02 alkeryn

Wow that's pretty hardcore, much respect. For the i915 stuff, just delete the stuff you added and then reinstall the linux-firmware package which will replace the files again. I've temporarily uploaded the binaries here but I'll take them down pretty soon because I don't know what the redistribution rights for these files are

afzalarsalan avatar Feb 01 '17 22:02 afzalarsalan

Thank you a lot :) you are a hero =) By linux firmware you speak about the compiled kernel ? :)

alkeryn avatar Feb 01 '17 22:02 alkeryn

Nah there's an Arch Linux package called linux-firmware.

afzalarsalan avatar Feb 01 '17 22:02 afzalarsalan

By the way you seems to know a lot about linux, i'm a dev, i know how to use linux well enough (know most commands ect ..) but do you know where i can learn exactly how it work or have a better understanding of the kernel ? :)

alkeryn avatar Feb 01 '17 22:02 alkeryn

Well 76 didn't change a thing so i try with 79 I tried 076 078 and 079 none of them work I'm sure I'm on surfacebook kernel because the type cover work and a screenfetch tell me that i'm using the right kenel, plus showing the comand line wit Ctrl + alt F2 says I'm on 4.9.5 surfacebook ^^

alkeryn avatar Feb 01 '17 23:02 alkeryn

So i didn't touched anything, rebooted twice and now it work for some reason xD i don't understand at all But the pen button dont work :P

alkeryn avatar Feb 01 '17 23:02 alkeryn

Yeah you have connect to the Pen via bluetooth and pair it to Linux. Don't really know the process of making the buttons work since that's not a use case I have personally. I'm pretty sure someone on the internet has figured it out though.

On Wed, Feb 1, 2017 at 5:26 PM, Alkeryn [email protected] wrote:

So i didn't touched anything, rebooted twice and now it work for some reason xD i don't understand at all But the pen button dont work :P

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/afzalarsalan/linux-surfacebook/issues/2#issuecomment-276816869, or mute the thread https://github.com/notifications/unsubscribe-auth/AHMCcKvogdEYlvU3n_z0e5an6Xy48pydks5rYRSzgaJpZM4LjIDF .

afzalarsalan avatar Feb 01 '17 23:02 afzalarsalan

Well thank you for all your help =) plus do you have any idea how to make the pointer disapear when whe use the finger it's like cinnamon think it's a mouse xD But wow i even have pressure sensitivity :D and it work even better than on windows xD

alkeryn avatar Feb 01 '17 23:02 alkeryn

I think that might just be an Xorg thing since when I use it with Gnome Shell and Wayland, the pointer disappears as soon as I touch the screen.

On Wed, Feb 1, 2017 at 5:29 PM, Alkeryn [email protected] wrote:

Well thank you for all your help =) plus do you have any idea how to make the pointer disapear when whe use the finger it's like cinnamon think it's a mouse xD

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/afzalarsalan/linux-surfacebook/issues/2#issuecomment-276817477, or mute the thread https://github.com/notifications/unsubscribe-auth/AHMCcDIBR3q6hZXOM_hUNSh2j65fllsVks5rYRVigaJpZM4LjIDF .

afzalarsalan avatar Feb 01 '17 23:02 afzalarsalan

Well i will try gnome shell but how did you switched to wayland ? i only know xorg and is wayland great ? :3 Confirm no pointer on gnome :D

alkeryn avatar Feb 01 '17 23:02 alkeryn

Wayland is now the default option when using Gnome Shell, it's actually a dependency on the gnome package now

On Wed, Feb 1, 2017 at 5:40 PM, Alkeryn [email protected] wrote:

Well i will try gnome shell but how did you switched to wayland ? :3

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/afzalarsalan/linux-surfacebook/issues/2#issuecomment-276819640, or mute the thread https://github.com/notifications/unsubscribe-auth/AHMCcBh7JZoUq1JI7Ty3BUOqjQ9E9j0Cks5rYRfagaJpZM4LjIDF .

afzalarsalan avatar Feb 01 '17 23:02 afzalarsalan

So pointer disapear when using touchscreen but still the same with pen will search if there is a way to use a smaller one for the pen like on windows the 2 last thing to fix are hibernation, suspend and unplug replug the keyboard ^^

alkeryn avatar Feb 01 '17 23:02 alkeryn

Well i still use cinnamon on my main computer but you convinced me to use gnome on the sp4 :P

alkeryn avatar Feb 02 '17 00:02 alkeryn

I just realized that the reason hibernate has never worked for me is because currently the Linux Secure Boot implementation doesn't support hibernate and that's the mode I currently use my Linux install in. Going to have to mark this as no fix as there isn't much point on working on this issue until upstream supports Linux on Secure Boot for any laptop.

afzalarsalan avatar Feb 08 '17 08:02 afzalarsalan

Feels free to create another issue for other kernel issues.

afzalarsalan avatar Feb 08 '17 08:02 afzalarsalan

I went again to test and no, it does not hibernate for me even with Secured Boot disable on bios. I were/am always with Secure Boot and Trust Platform Module disable on bios of my SP4.

casainho avatar Feb 08 '17 10:02 casainho

For some reason I can always hibernate. I am using this prebuilt kernel, which uses this repo as base.

However, when I resume from hibernate, neither touch nor wifi works. Does anyone have any clue as to how to fix this?

brianc118 avatar Feb 16 '17 09:02 brianc118

I would presume you don't use UEFI Secure Boot, in which I could see working. Honestly both of those drivers are hella sketch so if you unload and reload those driver modules it should start working again.

On Feb 16, 2017 3:54 AM, "Brian Chen" [email protected] wrote:

For some reason I can always hibernate. I am using this https://www.reddit.com/r/SurfaceLinux/comments/5pwaa6/superkerneltouch_for_sp4_ubuntu/ prebuilt kernel, which uses this repo as base.

However, when I resume from hibernate, neither touch nor wifi works. Does anyone have any clue as to how to fix this?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/afzalarsalan/linux-surfacebook/issues/2#issuecomment-280285127, or mute the thread https://github.com/notifications/unsubscribe-auth/AHMCcHOQn2bgQM1Txu2Bhi132eYTmuUoks5rdBy9gaJpZM4LjIDF .

afzalarsalan avatar Feb 16 '17 10:02 afzalarsalan

I've tried unloading/reloading MWIFIEX but that doesn't work (by itself at least). What else should I try?

sudo rmmod mwifiex_pcie
sudo modprobe mwifiex_pcie

I'm on ubuntu 16.04 btw

brianc118 avatar Feb 16 '17 10:02 brianc118

My script:

#/bin/bash

ip link set wlp2s0 down modprobe -r mwifiex_pcie modprobe mwifiex_pcie service network-manager restart


When I hibernate, it will not work at the first hibernation. I run it, hibernate again, run it and finally wifi will work again. I am using kernel 4.4.39.

For me hibernation is very important as I have many windows open and I don't want to wast time everytime to open them...

2017-02-16 10:15 GMT+00:00 Brian Chen [email protected]:

I've tried unloading/reloading MWIFIEX but that doesn't work (by itself at least). What else should I try?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/afzalarsalan/linux-surfacebook/issues/2#issuecomment-280290254, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI-uCvQKcsDK3cuaMWknWMXYhZEwpLBks5rdCHFgaJpZM4LjIDF .

-- Cumprimentos, Jorge Pinto E-mail: [email protected] Telemóvel: 927145983

casainho avatar Feb 16 '17 10:02 casainho

16.10 but on 16.04 worked the same. Try network-manager and networking services, try restart one after the other... it may work.

2017-02-16 10:54 GMT+00:00 Brian Chen [email protected]:

Doesn't work for me. Are you on 16.04/16.10?

My wifi options setting just disappears in gnome.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/afzalarsalan/linux-surfacebook/issues/2#issuecomment-280299079, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI-uOVc9eC-cjx0qDIFH7t-vzjnRXXbks5rdCrOgaJpZM4LjIDF .

-- Cumprimentos, Jorge Pinto E-mail: [email protected] Telemóvel: 927145983

casainho avatar Feb 16 '17 11:02 casainho

This is very weird. I've got wifi working after resume now. I added the line

ip link set wlp2s0 up

Furthermore, multitouch works after resume. Before resume I had single touch.

brianc118 avatar Feb 16 '17 11:02 brianc118

The lack of stability is not good but...

Can you please resume what you get?

  • touchscreen?
  • wifi?
  • keyboard?
  • power and volume buttons?
  • hibernation with all of them?

2017-02-16 11:04 GMT+00:00 Brian Chen [email protected]:

This is very weird. I've got wifi working after resume now. I added the line

ip link set wlp2s0 up

Furthermore, multitouch works after resume. Before resume I had single touch.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/afzalarsalan/linux-surfacebook/issues/2#issuecomment-280301306, or mute the thread https://github.com/notifications/unsubscribe-auth/AAI-uCGQvFQ4U6Qwo7EvBzuhaAANVlXIks5rdC1AgaJpZM4LjIDF .

-- Cumprimentos, Jorge Pinto E-mail: [email protected] Telemóvel: 927145983

casainho avatar Feb 16 '17 11:02 casainho

Just tried again. I think I can reliably get wifi, keyboard, power/vol buttons working after hibernate. Touch only worked once after resume (multitouch), but I can live without that. However hibernate doesn't seem to always work, but it works most of the time.

brianc118 avatar Feb 16 '17 11:02 brianc118

Apparently someone has found a way to make this work reliably so I'm going to open this up for testing on that soon.

afzalarsalan avatar Mar 08 '17 03:03 afzalarsalan

If you have something to test, please tell me and I will. I really need hibernation and a way to get wifi working after hibernation (as normal, without need to rehibernate and run some commands).

casainho avatar Mar 08 '17 08:03 casainho

I've merged some rather innocuous changes for Linux 4.9 which seems to have miraculously fixed hibernating, go figure. You can checkout and build the linux-49-dev branch or if you have some faith, here are the packages I built based on that branch. I'm quite shocked it works at all but hey maybe I'm just lucky.

afzalarsalan avatar Mar 08 '17 12:03 afzalarsalan

I'll merge these in if I get some consensus on their effect

afzalarsalan avatar Mar 08 '17 12:03 afzalarsalan

Also please make sure you've followed these instructions before people come here to panic. Saves everyone some time

afzalarsalan avatar Mar 08 '17 12:03 afzalarsalan

Thanks. Started building right now. I am on Linux Ubuntu and so my process is:

  • use the 4.9.13 kernel
  • apply Ubuntu patches
  • apply your patches for wifi, touch and keyboard
  • add ipts firmware
  • install Ubuntu 4.9.13 kernel and get the .config, changing to add "CONFIG_INTEL_IPTS=m"
  • build Then I will add/use the script hibernate.sh and report here.

casainho avatar Mar 08 '17 15:03 casainho

I'm guessing you know where to place said script?

afzalarsalan avatar Mar 08 '17 15:03 afzalarsalan

Yes, thanks. I am looking at your PKGBUILD file :-)

casainho avatar Mar 08 '17 15:03 casainho

Just checking 👍

afzalarsalan avatar Mar 08 '17 15:03 afzalarsalan

After building and testing a few times, it still does not hibernate for me. Also the touchscreen didn't work. To make sure the hibernate.sh script did work before hibernation, I did run each command by hand.

casainho avatar Mar 08 '17 18:03 casainho

Well, after all this testing, the wifi seems to be always working after the hibernation :-) Seems the content of the hibernate.sh script solved my only issue with wifi after hibernation :-) I will keep using kernel 4.4.39 were hibernation is working well - the only thing missing is the touchscreen but I can live with it.

casainho avatar Mar 08 '17 18:03 casainho

I will test your new kernel friday night better not mess with my system during the week will report asap ^^

alkeryn avatar Mar 09 '17 04:03 alkeryn

Ok so i tried the new kernel on SP4, here is what happen When trying to hibernate: -Screen blink -Turn on again -Show GDM background -Freeze

When trying to sleep / suspend -Screen blink -Turn on again on desktop -Turn off -Freeze with black screen

alkeryn avatar Mar 11 '17 07:03 alkeryn