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

Surface Pro 7 - A Status Report

Open MingcongBai opened this issue 5 years ago • 24 comments

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

  • Linux Kernel 5.3.7 (config).

    • I have included patches 0001, 0002, 0004 from jzed/linux-surface.
  • Mesa 19.1.6.

  • Xorg Server 1.20.5, using the modesetting DDX.

  • Plasma 5.16.5.

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

  • Kernel parameter modprobe.blacklist=intel_lpss_pci, otherwise system hangs as intel-lpss loads.
    • However, CONFIG_MFD_INTEL_LPSS_PCI must be set to m, otherwise noapic must be used.

What Works

  • Keyboard and touchpad, along with all Fn functions.
  • Graphics acceleration, with caveats.
  • WiFi and Bluetooth (Intel AX201).
  • Speakers, with caveats.
  • SD Card Reader.
  • Sensors (temperature).
  • USB Type A/C ports (storage and power, haven't tested video output yet, but there is no reason why it wouldn't work).

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

  • Battery level indication, not even with @qzed 's Surface ACPI patch.
  • Suspend, system does not wake up from s2idle.
  • Hibernation, system fails to resume from swap partition (investigation pending, could be a configuration error).
    • The system also reboots at the end of hibernation, for some reason.
  • The touchpad seems to drop when system is configured to "blank screen" when the Type Cover is closed and re-opened again.
  • Graphics, occasional blue/yellow artifact on the top of the screen.
    • Will test after Mesa update.
  • Speakers when headphone is attached.
    • The speakers make a moderately loud hissing noise.
    • Headphones work however.
  • Touch screen.
    • IPTS firmware pending.
  • Power and volume buttons.
    • Could be due to the aforementioned noapic parameter, which blocks SPI functionalities.
  • GRUB 2.04 (unpatched) hangs for ~10 seconds before the on-screen keyboard indicator comes up on the bottom right corner.
  • OpenGL support level seems to be lower than expected, with Mesa reporting GL_VERSION: 3.0 Mesa 19.1.6.
  • Processor frequency is pinned at 200MHz after s-tui stress, but the throttling goes away after a minute or two.

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

  • When rebooting from any sort of Linux distribution, the UEFI hangs at the Surface logo, failing to boot GRUB.
  • When changing SMT/TPM configuration, after the system is rebooted with configuration(s) saved, the system hangs at the Surface logo.
  • When attempting to hibernate, the system reboots at the end of the hibernation process, hanging at the Surface logo. Subsequent boot fails to resume from the swap partition.

My To-Do's

  • Report firmware issues to Microsoft.
  • Submit missing PCI device names to hwdata.
  • Continue with other testing (I will update this post when I have new plans).
  • See what I can help with linux-surface.

MingcongBai avatar Oct 23 '19 15:10 MingcongBai

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

MingcongBai avatar Oct 23 '19 15:10 MingcongBai

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.

StollD avatar Oct 23 '19 15:10 StollD

Here is the acpidump ouput.

MingcongBai avatar Oct 23 '19 15:10 MingcongBai

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 avatar Oct 23 '19 16:10 MingcongBai

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 avatar Oct 23 '19 16:10 MingcongBai

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.

MingcongBai avatar Oct 23 '19 16:10 MingcongBai

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.

aleksfadini avatar Oct 23 '19 16:10 aleksfadini

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

MingcongBai avatar Oct 23 '19 16:10 MingcongBai

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 avatar Oct 23 '19 16:10 MingcongBai

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

MingcongBai avatar Oct 23 '19 16:10 MingcongBai

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

aleksfadini avatar Oct 23 '19 16:10 aleksfadini

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 avatar Oct 23 '19 16:10 MingcongBai

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

MingcongBai avatar Oct 23 '19 16:10 MingcongBai

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.

chrismin13 avatar Oct 23 '19 17:10 chrismin13

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

MingcongBai avatar Oct 23 '19 17:10 MingcongBai

@ 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:

  • battery state (surface acpi is there but not working out of the box)
  • touchscreen / pen

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 avatar Oct 23 '19 18:10 aleksfadini

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.

aleksfadini avatar Oct 23 '19 19:10 aleksfadini

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:

  • Ubuntu 16.04 (but I'm pretty sure it doesn't matter since the Kernel doesn't boot at all...)
  • Grub 2.02~beta2-36ubuntu3.22
  • Kernel 5.3.7 built with your configuration, GCC 5.4.0
  • Kernel is not signed but I disabled secure boot
  • Same output for lspci

Hugal31 avatar Oct 28 '19 09:10 Hugal31

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?

aleksfadini avatar Oct 28 '19 13:10 aleksfadini

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

Hugal31 avatar Oct 28 '19 14:10 Hugal31

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...

davadev avatar Oct 21 '20 06:10 davadev

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

archseer avatar Oct 21 '20 06:10 archseer

@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?

davadev avatar Nov 03 '20 07:11 davadev

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

stucki avatar Nov 03 '20 13:11 stucki