jakeday / linux-surface

Linux Kernel for Surface Devices
2.59k stars 242 forks source link

Surface Pro 7 - A Status Report #592

Open MingcongBai opened 5 years ago

MingcongBai commented 5 years ago

Quick note before I start, I am aware that there is already #589 but I feel like such a long post is probably better posted as a separate issue - I will be happy to move if this is inappropriate, of course.

Software Configuration

Hardware Configuration

PCI devices:

00:00.0 Host bridge: Intel Corporation Device 8a12 (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Device 8a5a (rev 07)
00:04.0 Signal processing controller: Intel Corporation Device 8a03 (rev 03)
00:05.0 Multimedia controller: Intel Corporation Device 8a19 (rev 03)
00:0d.0 USB controller: Intel Corporation Ice Lake Thunderbolt 3 USB Controller (rev 03)
00:12.0 Serial controller: Intel Corporation Device 34fc (rev 30)
00:14.0 USB controller: Intel Corporation Ice Lake-LP USB 3.1 xHCI Host Controller (rev 30)
00:14.2 RAM memory: Intel Corporation Device 34ef (rev 30)
00:14.3 Network controller: Intel Corporation Device 34f0 (rev 30)
00:15.0 Serial bus controller [0c80]: Intel Corporation Ice Lake-LP Serial IO I2C Controller #0 (rev 30)
00:15.2 Serial bus controller [0c80]: Intel Corporation Ice Lake-LP Serial IO I2C Controller #2 (rev 30)
00:15.3 Serial bus controller [0c80]: Intel Corporation Ice Lake-LP Serial IO I2C Controller #3 (rev 30)
00:16.0 Communication controller: Intel Corporation Device 34e0 (rev 30)
00:16.4 Communication controller: Intel Corporation Device 34e4 (rev 30)
00:19.0 Serial bus controller [0c80]: Intel Corporation Ice Lake-LP Serial IO I2c Controller #4 (rev 30)
00:1d.0 PCI bridge: Intel Corporation Ice Lake-LP PCI Express Root Port #9 (rev 30)
00:1e.0 Communication controller: Intel Corporation Ice Lake-LP Serial IO UART Controller #0 (rev 30)
00:1f.0 ISA bridge: Intel Corporation Ice Lake-LP LPC Controller (rev 30)
00:1f.3 Audio device: Intel Corporation Device 34c8 (rev 30)
00:1f.5 Serial bus controller [0c80]: Intel Corporation Ice Lake-LP SPI Controller (rev 30)
01:00.0 Non-Volatile memory controller: Device 1e0f:0001

USB Devices:

Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 045e:0306 Microsoft Corp. 
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 045e:09c0 Microsoft Corp. Surface Type Cover
Bus 003 Device 003: ID 8087:0026 Intel Corp. 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Additional Files:

What Has to be Done Before Getting a Boot

What Works

What Doesn't Work (Well) - GRUB, Kernel, and Userspace

What Doesn't Work (Well) - Firmware and UEFI

My To-Do's

MingcongBai commented 5 years ago

With hwdata v0.327...

Missing PCI info:

8086:8a12, 8086:8a5a, 8086:8a03, 8086:8a19, 8086:34fc, 8086:34ef, 8086:34f0, 8086:34e0, 8086:34e4, 8086:34c8, 1e0f:0001

Missing USB info:

045e:0306, 8087:0026

StollD commented 5 years ago

Could you upload an acpidump (sudo acpidump > acpidump.out)? That might help later.

For example, the acpidump could show us if IPTS uses a new firmware or one of the ones that are already known. If it doesn't use a new one, there shouldn't be much that would stop it from working.

MingcongBai commented 5 years ago

Here is the acpidump ouput.

MingcongBai commented 5 years ago

An update on "speakers hissing when headphones are plugged in," disabling Auto-Mute Mode from alsamixer works around the issue.

What does "Auto-Mute Mode" do?

MingcongBai commented 5 years ago

As suggested by @aleksfadini in #589, it seems that modprobe.blacklist=intel_lpss_pci is the minimal workaround - this module is marked as built-in in my Kernel configuration, however.

I will test this later today.

MingcongBai commented 5 years ago

Another issue came up after checking power-draw on s-tui with a 2-minute stress run, the processors sustained at around ~2.4GHz frequency with a power draw of ~25W. However, as soon as the stress run completed, the processor was pinned at 200MHz.

The throttling just randomly went away after a minute or two.

aleksfadini commented 5 years ago

Another issue came up after checking power-draw on s-tui with a 2-minute stress run, the processors sustained at around ~2.4GHz frequency with a power draw of ~25W. However, as soon as the stress run completed, the processor was pinned at 200MHz.

The throttling just randomly went away after a minute or two.

We could try to handle that with a governor, cpupower-set frequency or something.

MingcongBai commented 5 years ago

@aleksfadini Maybe, but I think there needs to be more investigation (i.e. trying to reproduce that on Windows).

MingcongBai commented 5 years ago

Speaking of which, I was just checking my dmesg and was greeted by a large amount of Intel DRM related errors...

[ 3863.983087] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=121 end=122) time 119 us, min 1812, max 1823, scanline start 1811, end 1823
[ 3972.419541] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=2797 end=2798) time 115 us, min 1812, max 1823, scanline start 1811, end 1824
[ 4224.913168] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=2199 end=2200) time 119 us, min 1812, max 1823, scanline start 1810, end 1825
[ 4375.360840] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=6627 end=6628) time 148 us, min 1812, max 1823, scanline start 1808, end 1824
[ 4393.156520] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=7694 end=7695) time 138 us, min 1812, max 1823, scanline start 1807, end 1824
[ 4570.470518] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=3835 end=3836) time 139 us, min 1812, max 1823, scanline start 1807, end 1825
[ 4720.972826] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=463 end=464) time 171 us, min 1812, max 1823, scanline start 1808, end 1827
[ 4968.254623] [drm:intel_pipe_update_end [i915]] *ERROR* Atomic update failure on pipe A (start=540 end=541) time 132 us, min 1812, max 1823, scanline start 1810, end 1826
MingcongBai commented 5 years ago

Kernel clocksource was not happy either...

[   30.396679] clocksource: timekeeping watchdog on CPU3: Marking clocksource 'tsc' as unstable because the skew is too large:
[   30.396682] clocksource:                       'hpet' wd_now: 222d1713 wd_last: 21ad7615 mask: ffffffff
[   30.396684] clocksource:                       'tsc' cs_now: 11c0a34b82 cs_last: 11936c07c0 mask: ffffffffffffffff
[   30.396690] tsc: Marking TSC unstable due to clocksource watchdog
[   30.396701] TSC found unstable after boot, most likely due to broken BIOS. Use 'tsc=unstable'.
[   30.396719] sched_clock: Marking unstable (30399182956, -2482440)<-(30405395659, -8695192)
[   30.397428] clocksource: Switched to clocksource hpet
aleksfadini commented 5 years ago

Also, not getting artifacts or touchpad issues so far but will do more testing. Also, I'm not using noapic

MingcongBai commented 5 years ago

Also, not getting artifacts or touchpad issues so far but will do more testing. Also, I'm not using noapic

I'm wondering if the artifacting is related to Panel Self Refresh.

MingcongBai commented 5 years ago

@aleksfadini Can confirm that modprobe.blacklist=intel_lpss_pci is a valid workaround.

chrismin13 commented 5 years ago

That is a beautiful Wi-Fi Chip! So glad that Microsoft FINALLY switched to an Intel chip, and the AX support is the cherry on top!

Hopefully you won't have to bother with different Wi-Fi and bluetooth drivers and the mainline kernel drivers will be enough.

MingcongBai commented 5 years ago

@chrismin13 The mainline kernel, I can confirm, is working 100% well for this chip.

aleksfadini commented 5 years ago

@ MingcongBai What doest it mean:

Touch screen. IPTS firmware pending.

Can you elaborate? Can we make it work somehow?

Yes, the Wi-Fi is amazing. My priorities now are getting to work:

These are my personal goals. If this worked, this Surface would be my dream - powerful multimedia and dev machine with touch capabilites (I do coding and music with bitwig)

Really hoping to get these two working or I'll have to bring it back.

aleksfadini commented 5 years ago

Touchscreen news:

Apparently blacklisting the intel_lpss module allows to boot but that is what inhibits the touchscreen from working. In order to get it to work we should use this kernel patch:

https://pastebin.com/sqPv8ShP

I have on idea how to do it. Can someone do that and update the linux-surface repo for Arch?

This patch should fix it according to this arch wiki link: https://wiki.archlinux.org/index.php/Dell_XPS_13_2-in-1_(7390)

First Boot To boot fully without the boot process hanging one must blacklist the 'intel_lpss_pci' module, which can be done on a live media installation by selecting the boot option you want and pressing 'e', navigating to the end of the boot options string, and adding 'modprobe.blacklist=intel_lpss_pci'. This should allow booting into the full OS and further installation to the internal SSD.

Intel LPSS To fix the intel_lpss_module the patch from this paste must be applied to the kernel.

https://pastebin.com/sqPv8ShP

Remember to be cautious about running code or installing patches from third party sources if you do not know what it does.

This patch should enable the system to boot without blacklisting the module, further enabling access to the touchscreen.

Hugal31 commented 5 years ago

Did you did something else to get the kernel booting?

I tried to reproduce your step on my Surface Pro 7, but it freezes after Grub displays "Loading initial ramdisk ...", no matter how I try with nomodeset, nosplash, debug, even when I add modprobe.blacklist=intel_lpss_pci or noapic. I have:

aleksfadini commented 5 years ago

I did only: modprobe.blacklist=intel_lpss_pci

To isolate the issue, I would first check if on your machine if the current arch live-usb installer boots with that option parameter (you will have to press e before the live usb boots automatically). If you tried that as a next step, we could exclude that something else is happening. Try and report back.

When I say something else, I mean that you might have a slightly different CPU? Mine is the SP7 i7 running the 10nm Intel Core i7-1065G7, that might matter or not.

EDIT: all the rest looks fine on your end, disable secureboot etc. On the other hand, why user an older Ubuntu?

Hugal31 commented 5 years ago

I have the i5-1035G4. Maybe I am missing the microcode for the CPU, as said in the README?

davadev commented 4 years ago

I just wanted to ask, what is the current status at the moment? Quite some time has passed since 2019. Microsoft in between released WSL 2 with custom Linux Kernel, so I was wondering whether it can be used to get all things working on Surface 7 pro...

archseer commented 4 years ago

@davadev https://github.com/linux-surface/linux-surface

davadev commented 4 years ago

@archseer Thanks for the link. I checked it. The pen and Cameras are still not working on Surface Pro 7. Is there any way how to make it work?

stucki commented 4 years ago

@davadev You should ask at the other project, not here. This project is dead!