xmm7360 / xmm7360-pci

PCI driver for Fibocom L850-GL modem based on Intel XMM7360 modem
403 stars 81 forks source link

L850GL in a Lenovo ThinkPad X1 Yoga 20LD... with Manjaro Linux #209

Open KataFF opened 10 months ago

KataFF commented 10 months ago

Hi, I'm struggling to get my Fibocom L850GL LTE modem working under Manjaro Linux on a 3th Gen Lenovo ThinkPad X1 Yoga.

I installed this driver along with the xmm7360-usb-modeswitch via Pamac from the AUR, but was unable to get it to connect to the internet even via USB mode. I initially seeked some help in the AUR comments. I've been trying to make it run for some 3 weeks now, and I don't create issues for nothing but this time I've run out of ideas. Note, that this is going to be quite lengthy, so I'll provide a short tldr and an in-detail version.

TL;DR aka short version

What does not work

What was tested and works

Some extra info:

inxi -M: Machine: Type: Convertible System: LENOVO product: 20LD002MMX v: ThinkPad X1 Yoga 3rd serial: Mobo: LENOVO model: 20LD002MMX v: SDK0J40697 WIN serial: UEFI: LENOVO v: N25ET63W (1.49 ) date: 12/20/2022 CPU: Intel i7-8550U (without Intel vPro - which is the difference between the 20LG... yoga in #108, also he was using Mint) Firmware Version (GNOME Settings > Mobile Network > Modem Details): 18500.5001.00.02.24.09 updated on 2023-08-08 on Windows 10 to 18500.5001.07.05.27.12 via the newest driver package from Lenovo Support website.

dmesg -w | grep xmm7360 with xmm7360.service enabled so that it runs during boot:

[    3.482431] xmm7360 0000:04:00.0: enabling device (0000 -> 0002)
[    3.483064] xmm7360 0000:04:00.0: modem is ready

lspci -s 04:00.0 -kvn:

04:00.0 0d40: 8086:7360 (rev 01)
    Subsystem: 8086:0020
    Flags: bus master, fast devsel, latency 0, IRQ 141, IOMMU group 14
    Memory at <redacted> (64-bit, non-prefetchable) [size=4K]
    Memory at <redacted> (64-bit, non-prefetchable) [size=1K]
    Capabilities: [40] Power Management version 3
    Capabilities: [50] MSI: Enable+ Count=1/4 Maskable- 64bit+
    Capabilities: [70] Express Endpoint, MSI 00
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [148] Latency Tolerance Reporting
    Capabilities: [150] L1 PM Substates
    Kernel driver in use: xmm7360
    Kernel modules: iosm, xmm7360

The full in-detail version - what I did and how step-by-step.

This is all on newest up-to-date Manjaro linux. Note that kernel is configured with -iosm=on (running some KVMs). I installed the PCI driver with pamac after enabling AUR support:

pamac install modem-manager-gui acpi_call-dkms xmm7360-usb-modeswitch-git xmm7360-pci-dkms-git xmm7360-pci-utils-git 

I rebooted the PC after install, but noted iosm driver is still in use (with lspci -k). I tried rmmod iosm and modprobe xmm7360 manually after booting and logging into the GNOME Shell, on linux 6.1.41 it did show the new driver as a second modem in mmcli --list-modems, on linux 6.5.rc3 it did not show up after changing the kernel driver module.

Thanks to advice from @thotypous I created /etc/modprobe.d/xmm7360.conf containing:

blacklist iosm

It now uses xmm7360 module on boot. FYI carried out the rest described below on linux 6.5.rc3 mainline kernel. (Note: I later tried on 6.5.rc5 with same results).

I edited /etc/xmm7360 for my provider (T-Mobile), also enabled dbus=True (wanted to test Network Manager integration). Attempted to init the modem with systemctl start xmm7360.service as root some time after booting, but it failed due to timeout while "RPC executing UtaMsCallPsAttachApnConfigReq": https://pastebin.com/MjK1suhv (same pastebin as in short version).

I then tried enabling it so it would run at boot with systemctl enable xmm7360.service, which copied the service to /etc/systemd/system/graphical.target.wants/xmm7360.service. This started causing a kernel panic on boot originating from the xmm7360 module. I think I was booting the linux kernel directly from the UEFI. I booted via GRUB, and now the kernel panic is gone for some reason, but the python RPC script still times out. I also tested on 6.4.6 kernel, still times out. I tried manually running the init script directly with python /usr/lib/xmm7360-pci-git/rpc/open_xdatachannel.py -c /etc/xmm7360(I got that directly from the systemd service), alas no luck.

After that, I tried passing the modem to a Windows 10 VM via IOMMU and libvirt-vfio (through virt-manager and using libvfio as the driver, like you would for a GPU pass-through), but it was not detected by the VM.

Feeling defeated, I used a Ventoy/Windows 10 To Go pendrive I prepared myself some time earlier to boot Windows 10 on the Thinkpad's bare hardware (which is something I very much wanted to avoid since buying this thing). There, I downloaded the "Lenovo System Update" (the succesor to "Lenovo Vantage" from the official Lenovo website, checking checksums and whatnot, and run it. I installed a driver for everything except a Intel ME FW update. After a reboot, the modem worked out-of-the-box on Windows, so I know that the hardware is functional.

At the moment I unblacklisted the iosm module (this brought back the wwan0at* channels, which do not appear when booting purely with xmm7360 and iosm blacklisted!) and disabled the xmm7360 service. I then tried some AT commands on wwan0at1, and it seems to work - see screenshot next line: Screenshot from 2023-08-16 01-01-56

I tried the procedure described in #204, but it did not work (it did however get past the UtaMsCallPsAttachApnConfigReq, but got stuck on unsolicited messages, no error but the lte up script did not return to shell).

Any ideas of what else I might try? Worst case scenario I'll probably end up using my android phone as a router, but I'd rather not (e.g. I trust my laptop a little more than the unrooted Android spyphone, also I don't have a dual SIM (so I'd have to change my number and notify everyone of that change...), phone can get lost/stolen etc.)