jakeday / linux-surface

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

Surface Laptop 3 15" - 8250_wm needed to use keyboard at decrypt stage #621

Closed PandorasFox closed 4 years ago

PandorasFox commented 4 years ago

I've installed the latest from qzed's fork, and made sure the proper modules are in my mkinitcpio / the proper kernel+initrd are being used.

USB keyboards work perfectly at the decrypt stage (prior to mounting /), but the internal notebook keyboard doesn't work. I can drop to an emergency shell and verify that the surface_sam_* modules are all loaded. After decrypting, the notebook keyboard (and touchpad) both work fine.

dmesg doesn't reveal anything useful - just that the keeb/touchpad are init'd by surface_sam_sid_vhf after the decrypt stage. I'm pretty much just stuck here, since I'm not sure exactly what I'm missing - I have the udev hook, I have the surface_sam modules, and it all works after decrypting. There's no other dependencies shown by lsmod, either.

PandorasFox commented 4 years ago

Alright, I made an initrd with every module that's loaded after the decrypt & remount stage and the keyboard now works, so I'll figure out which module is missing from my initrd (and probably make a pull adding that?)

PandorasFox commented 4 years ago

Alright, I've slimmed my initrd modules down to explicitly listing out:

Any less than that and the keyboard doesn't work in the init ramfs. I have no clue why the 8250_dw module is needed at all (modprobe -r'ing it causes my keyboard to no longer work, with no other modules unloading).

The following modules are actually loaded (and are possibly soft deps of the above modules, but are pulled in by other mkinitcpio hooks):

qzed commented 4 years ago

@PandorasFox Thank you for testing! The 8250_dw is a UART/Serial driver that is needed for the communication with the embedded controller. You can (probably) drop some of the SAM modules if you want to shrink that down (surface_sam_vhf shouldn't be required for the SL3 at all, the SAN one should also not be necessary for the keyboard). I've added a wiki page based on your info (https://github.com/qzed/linux-surface/wiki/Surface-Laptop-3). Feel free to expand that if I've missed something.

PandorasFox commented 4 years ago

Thanks! That looks perfect to me.

PandorasFox commented 4 years ago

Although not part of the keyboard issue, I did also just solve my wifi issues (signals only appeared very weakly, ie -90 to -70 dBm, when they should have been much higher) from following this bit of this reddit post

remove /usr/lib/firmware/ath10k/QCA6174[/hw3.0]/board-2.bin replace /usr/lib/firmware/ath10k/QCA6174[/hw3.0]/board.bin with http://www.killernetworking.com/support/K1535_Debian/board.bin

Thankfully, the surface Go and the SL3 15" share the same wireless card and someone else already figured that out.

I figured I'd drop this here for now until I do a proper write-up somewhere of what all needs to be done on a SL3 to get it in perfect working order, since it's pretty close now.