# EM9291 in Linux Preventing Shutdown

**URL:** <https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866>\
**Category:** MC/EM Series\
**Created:** [October 21, 2024, 6:10pm UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866 "2024-10-21T18:10:37Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![jp11](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jp11](https://forum.sierrawireless.com/u/jp11)\
**Post date:** [October 21, 2024, 6:10pm UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/1 "2024-10-21T18:10:37Z")

</div>

I have an EM9291 install in a machine who’s target OS is Fedora Core 40. I’ve also tried these steps with Fedora Workstation and Ubuntu 22.

The issue is that when we do a `shutdown -h now` the system will shutdown and then power back on. However, if we use Windows, this is not an issue, the system shutdowns normally.

I’ve tried using ModemManager and nmcli to disable the modem, but it doesn’t help. I installed Fedora Workstation 40 to try the install the drivers, but this also seems to not work.

I disabled and stopped ModemManager per the instructions and then compiled the drivers.

The drivers compile successfully and say they install, but there are no wwan0\* devices in /dev. In addition, no ttyUSB devices are listed.

I confirmed the modem is working properly in Windows and the serial ports enumerate.

My question is three-fold:

1. How do I get the system to shutdown?
2. How do I get the drivers to properly install in Linux?
3. Do you have a signed RPM for the drivers? That would make life a lot easier.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [October 22, 2024, 12:52am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/2 "2024-10-22T00:52:56Z")

</div>

If you remove the module from the machine, does the shutdown work?

Btw, did you install this usb driver downloaded from here?

[https://source.sierrawireless.com/resources/airprime/software/mbpl/mbpl-software-latest/](https://source.sierrawireless.com/resources/airprime/software/mbpl/mbpl-software-latest/)

---

<div class="post-metadata">

**Author:** ![jp11](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jp11](https://forum.sierrawireless.com/u/jp11)\
**Post date:** [October 22, 2024, 3:52am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/3 "2024-10-22T03:52:45Z")

</div>

Yes, if you remove the modem from the machine, the shutdown in Linux is okay.

I installed the driver you linked, but it doesn’t seem to have an effect. I’ve disable secure boot and the TPM on the computer for testing.

I also tried to upgrade the firmware to SWIX65C\_02.17.08.00, to it seemed like it worked in Windows, but Linux still shows 02.15.01.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [October 22, 2024, 5:33am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/4 "2024-10-22T05:33:55Z")

</div>

How about usb thumb drive?  
Will it power on the linux?

Did you also check the BIOS setting?

> <https://unix.stackexchange.com/questions/659215/usb-device-wont-turn-off-on-shutdown-or-suspend>

How do you check the firmware version?  
It is strange that the firmware version is different between windows and linux.

---

<div class="post-metadata">

**Author:** ![jp11](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jp11](https://forum.sierrawireless.com/u/jp11)\
**Post date:** [October 22, 2024, 10:26pm UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/5 "2024-10-22T22:26:48Z")

</div>

Hi,

We solved the power off issue, it was an interaction between `WAKE#` and the BIOS.

However, I still don’t think the driver is working properly in Linux. I tried loading the modem firmware with the following commands with the built-in qcserial driver but got the following:

```auto
$ sudo ./fw-download-toolhostx86_64 -f ../image -p /dev/wwan0mbim0 -c MBIM
Application version: 1.0.2405.0
INFO: QDL Port:
INFO: Device Path: /dev/wwan0mbim0
INFO: Device Port: 0-0
INFO: FW Path: ../image
Target image Info:
Carrier :VERIZON
FW Version :02.17.08.00
Model ID :SWIX65C
Package ID :000
PRI Version:030.090
SKU :9999999
Switching device into download mode for image switch ...
Modem Needs FW
Modem Needs PRI
Waiting for modem to disconnect from the host ...
Modem disconnected from host.
Waiting for modem to come up in BOOT and HOLD mode ...
Modem not coming up in BOOT and HOLD mode in 60 seconds. Please check parameters. Application terminates.

```

Note: in this configuration only have the following devices: `wwan0mbim0 wwan0qcdm0 wwan0qmi0`

I then tried to build and load the R40 drivers. They build and insert properly, but I don’t see anything enumerate in /dev. All the wwan device are gone and I don’t see a `ttyUSB` device or anything else.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [October 23, 2024, 12:20am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/6 "2024-10-23T00:20:41Z")

</div>

you can see the command parameter for fwdownload tool here:

> [@Help with EM7565 Firmware and PRI File Update on Linux](https://forum.sierrawireless.com/t/help-with-em7565-firmware-and-pri-file-update-on-linux/33761/16):
>
> I just tried in Ubuntu 18 with EM7565, no problem is found for FW upgrade: owner@ubuntu:~/QMI/MBPL/MBPL\_SDK\_R39\_ENG2-fwdwl.bin/SampleApps/fw-download-tool$ sudo ./bin/fw-download-toolhostx86\_64 -l pcie\_mbim.log -f /home/owner/Desktop/EM75xx\_FW/SWI9X50C\_01.14.22.00\_GENERIC\_002.059\_001/ -m 4 -d /dev/ttyUSB0 -p /dev/cdc-wdm0 -t 1 -w SWI9X50C\_01.14.22.00.cwe -n SWI9X50C\_01.14.22.00\_GENERIC\_002.059\_001.nvu Application version: 1.0.2402.1 INFO: QDL Port: /dev/ttyUSB0 INFO: Device Path: /dev/cdc-wdm0…

If there is no /dev/ttyUSB enumerated, you cannot download the firmware

I used this MBPL\_DRIVERS\_R31\_ENG2-usb-src.tar.gz in ubuntu 18 with EM9291.  
[MBPL\_DRIVERS\_R31\_ENG2-usb-src.tar.gz](https://forum.sierrawireless.com/uploads/short-url/uCeLfXwrh8CLBmg06yFlW7SfD5p.gz) (24.9 KB)

Kernel log shows wwan0 network interface, /dev/ttyUSB0 (AT port) and /dev/ttyUSB1 (DM port) for USB serial port

---

<div class="post-metadata">

**Author:** ![jp11](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jp11](https://forum.sierrawireless.com/u/jp11)\
**Post date:** [October 23, 2024, 3:01am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/7 "2024-10-23T03:01:44Z")

</div>

Hi,

There are no ttyUSB devices enumerated even though it looks like the qcserial driver is loaded correctly. I only see `wwan0mbim0 wwan0qcdm0 wwan0qmi0`.

lspci shows  
`05:00.0 Unassigned class [ff00]: Qualcomm Technologies, Inc Device 0308`

lsusb doesn’t show anything.

I built and installed the R31 version you linked.

```auto
core@p5-0000-core:~$ modinfo qcserial
filename: /lib/modules/6.11.3-200.fc40.x86_64/kernel/drivers/usb/serial/qcserial.ko
version: 1.11.2302.2
license: GPL v2
description: Qualcomm USB Serial driver
author: Qualcomm Inc
srcversion: 069540C0FE9457C8D7D7861
alias: usb:v03F0p581Dd*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v413Cp81D2d*dc*dsc*dp*ic*isc*ip*in*
...
alias: usb:v1199p9078d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v1199p9070d*dc*dsc*dp*ic*isc*ip*in*
alias: usb:v1199p68C0d*dc*dsc*dp*ic*isc*ip*in*
depends: usb_wwan
retpoline: Y
name: qcserial
vermagic: 6.11.3-200.fc40.x86_64 SMP preempt mod_unload
parm: debug:enable/disable driver logging (bool)

```

```auto
core@p5-0000-core:~$ modinfo qmi_wwan
filename: /lib/modules/6.11.3-200.fc40.x86_64/kernel/drivers/net/usb/qmi_wwan.ko
version: 1.7.2302.2
license: GPL
description: Qualcomm MSM Interface (QMI) WWAN driver
author: Bjørn Mork <bjorn@mork.no>
srcversion: 93537AC544D2B4799778C60
alias: usb:v1410pA021d*dc*dsc*dp*ic*isc*ip*in00*
alias: usb:v12D1p14F1d*dc*dsc*dp*ic*isc*ip*in00*
alias: usb:v1199p901Bd*dc*dsc*dp*ic*isc*ip*in00*
...
alias: usb:v12D1p*d*dc*dsc*dp*icFFisc01ip39in*
alias: usb:v12D1p*d*dc*dsc*dp*icFFisc01ip09in*
depends: usbnet,cdc-wdm
retpoline: Y
name: qmi_wwan
vermagic: 6.11.3-200.fc40.x86_64 SMP preempt mod_unload
parm: debug:enable/disable driver logging (bool)

```

```auto
$ modinfo usb_wwan
filename: /lib/modules/6.11.3-200.fc40.x86_64/kernel/drivers/usb/serial/usb_wwan.ko
version: 1.2.2302.2
license: GPL v2
description: USB Driver for GSM modems
author: Matthias Urlichs <smurf@smurf.noris.de>
srcversion: E6191639FA7FA9BE194C778
depends:
retpoline: Y
name: usb_wwan
vermagic: 6.11.3-200.fc40.x86_64 SMP preempt mod_unload
parm: debug:enable/disable driver logging (bool)

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [October 23, 2024, 3:11am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/8 "2024-10-23T03:11:40Z")

</div>

What is the VID PID on dmesg?  
On my side, I can see the following:

 ![image](https://us1.discourse-cdn.com/flex025/uploads/sierrawireless/original/2X/0/005d23cfdb700a0409aa1d135e158e88118a1077.jpeg)

---

<div class="post-metadata">

**Author:** ![jp11](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jp11](https://forum.sierrawireless.com/u/jp11)\
**Post date:** [October 23, 2024, 3:49am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/9 "2024-10-23T03:49:54Z")

</div>

I don’t get any cdc or usb enumeration. Unfortunately, I can’t post the full output of dmesg, but I tried to capture the relevant sections.

```auto
core@p5-0000-core:~$ cat dmesg.log | grep usb
[0.319555] usbcore: registered new interface driver usbfs
[0.319555] usbcore: registered new interface driver hub
[0.319555] usbcore: registered new device driver usb
[0.590548] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.11
[0.590553] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[0.590555] usb usb1: Product: xHCI Host Controller
[0.590556] usb usb1: Manufacturer: Linux 6.11.3-200.fc40.x86_64 xhci-hcd
[0.590557] usb usb1: SerialNumber: 0000:00:0d.0
[0.590924] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.11
[0.590928] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[0.590930] usb usb2: Product: xHCI Host Controller
[0.590931] usb usb2: Manufacturer: Linux 6.11.3-200.fc40.x86_64 xhci-hcd
[0.590933] usb usb2: SerialNumber: 0000:00:0d.0
[0.593024] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.11
[0.593028] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[0.593030] usb usb3: Product: xHCI Host Controller
[0.593031] usb usb3: Manufacturer: Linux 6.11.3-200.fc40.x86_64 xhci-hcd
[0.593033] usb usb3: SerialNumber: 0000:00:14.0
[0.594330] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.11
[0.594332] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[0.594334] usb usb4: Product: xHCI Host Controller
[0.594335] usb usb4: Manufacturer: Linux 6.11.3-200.fc40.x86_64 xhci-hcd
[0.594336] usb usb4: SerialNumber: 0000:00:14.0
[0.595012] usbcore: registered new interface driver usbserial_generic
[0.595016] usbserial: USB Serial support registered for generic
[0.604907] usbcore: registered new interface driver usbhid
[0.604912] usbhid: USB HID core driver
[0.831986] usb 3-3: new full-speed USB device number 2 using xhci_hcd
[0.964062] usb 3-3: New USB device found, idVendor=0461, idProduct=4e25, bcdDevice= 1.32
[0.964315] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[0.964514] usb 3-3: Product: HP Wireless Keyboard Kit
[0.964710] usb 3-3: Manufacturer: Hewlett Packard
[0.968971] input: Hewlett Packard HP Wireless Keyboard Kit as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/0003:0461:4E25.0001/input/input3
[1.052959] hid-generic 0003:0461:4E25.0001: input,hidraw0: USB HID v1.11 Keyboard [Hewlett Packard HP Wireless Keyboard Kit] on usb-0000:00:14.0-3/input0
[1.489555] input: Hewlett Packard HP Wireless Keyboard Kit Consumer Control as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/0003:0461:4E25.0002/input/input4
[1.541843] input: Hewlett Packard HP Wireless Keyboard Kit System Control as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/0003:0461:4E25.0002/input/input5
[1.542292] input: Hewlett Packard HP Wireless Keyboard Kit as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/0003:0461:4E25.0002/input/input6
[1.542363] hid-generic 0003:0461:4E25.0002: input,hiddev96,hidraw1: USB HID v1.11 Device [Hewlett Packard HP Wireless Keyboard Kit] on usb-0000:00:14.0-3/input1
[1.730349] input: Hewlett Packard HP Wireless Keyboard Kit as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.2/0003:0461:4E25.0003/input/input8
[1.731842] hid-generic 0003:0461:4E25.0003: input,hidraw2: USB HID v1.11 Mouse [Hewlett Packard HP Wireless Keyboard Kit] on usb-0000:00:14.0-3/input2
[1.847803] usb 3-7: new full-speed USB device number 3 using xhci_hcd
[1.975878] usb 3-7: New USB device found, idVendor=0cf3, idProduct=e600, bcdDevice= 0.01
[1.976605] usb 3-7: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[3.359366] usbcore: registered new interface driver cdc_wdm
[3.360862] usbcore: registered new interface driver cdc_ether
[3.363413] usbcore: registered new interface driver cdc_ncm
[3.364733] usbcore: registered new interface driver cdc_mbim
[3.365697] usb_wwan: loading out-of-tree module taints kernel.
[3.366383] usb_wwan: module verification failed: signature and/or required key missing - tainting kernel
[3.369018] usbcore: registered new interface driver qmi_wwan
[3.370514] usbcore: registered new interface driver qcserial
[3.370523] usbserial: USB Serial support registered for Qualcomm USB modem
[3.370526] usbserial: USB Serial support registered for Qualcomm USB modem
[3.724409] usbcore: registered new interface driver btusb
core@p5-0000-core:~$ cat dmesg.log | grep Qu
[0.144378] DMAR-IR: Queued invalidation will be enabled to support x2apic and Intr-remapping.
[1.170369] systemd[1]: Queued start job for default target initrd.target.
[3.327946] systemd[1]: Mounting dev-mqueue.mount - POSIX Message Queue File System...
[3.355857] systemd[1]: Mounted dev-mqueue.mount - POSIX Message Queue File System.
[3.370523] usbserial: USB Serial support registered for Qualcomm USB modem
[3.370526] usbserial: USB Serial support registered for Qualcomm USB modem
[3.623114] EXT4-fs (nvme0n1p3): mounted filesystem 080c3d47-1a8a-4d42-95c5-979f8d8ede38 ro with ordered data mode. Quota mode: none.
core@p5-0000-core:~$ cat dmesg.log | grep mbim
[3.364733] usbcore: registered new interface driver cdc_mbim
[3.698059] wwan wwan0: port wwan0mbim0 attached
core@p5-0000-core:~$ cat dmesg.log | grep mhi
[3.572672] mhi-pci-generic 0000:05:00.0: MHI PCI device found: qcom-sdx65m
[3.572678] mhi-pci-generic 0000:05:00.0: BAR 0 [mem 0x51701000-0x51701fff 64bit]: assigned
[3.572768] mhi-pci-generic 0000:05:00.0: enabling device (0000 -> 0002)
[3.575989] mhi mhi0: Requested to power ON
[3.575999] mhi mhi0: Power on setup success
[4.191713] mhi mhi1: Requested to power ON
[4.191725] mhi mhi1: Power on setup success
[4.647805] mhi mhi1: Wait for device to enter SBL or Mission mode

```

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [October 23, 2024, 3:59am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/10 "2024-10-23T03:59:12Z")

</div>

I wonder if you really connect the EM9291 module to the board, I don’t even see Vendor ID 1199

Please check the status of pin 20 and pin 22 to see whether you are setting USB as communication port:

> [@Problems Getting EM9191 Working with M.2 to USB Adapters](https://forum.sierrawireless.com/t/problems-getting-em9191-working-with-m-2-to-usb-adapters/31434):
>
> Hello everyone, I’ve recently acquired an EM9191 modem and am attempting to use it with an M.2 to USB adapter. However, I’m encountering some issues. Despite having Windows 10 and installing the necessary drivers from the manufacturer’s website, the modem does not seem to be recognized by my system at all. When I connect it, nothing appears, and I’m unsure of how to proceed. Has anyone used this setup or faced similar challenges? I would greatly appreciate any advice or guidance on the steps I…

---

<div class="post-metadata">

**Author:** ![jp11](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jp11](https://forum.sierrawireless.com/u/jp11)\
**Post date:** [October 26, 2024, 11:28am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/11 "2024-10-26T11:28:45Z")

</div>

Thank you for pointing me in that direction. Indeed, pins 20 and 22 were disconnected. However, this seemed to cause another issue.

We have a custom board carrier board with a NVMe drive (using 4x PCI), and several other network devices using various other PCI lanes.

When we pull `PCIE_DIS` to 1.8V and `VBUS_SENSE` to 3.3V, the module causes the NVMe drive to not report to the BIOS. The system become unusable because it cannot boot.  
If I remove the module, the NVMe drive is accessible and works properly.

If we leave `PCIE_DIS` open and leave `VBUS_SENSE` pulled high, the system operates normally except the 9291 does not report on USB, but it does show up as a PCIe device.

I have two questions:

1. Does the 9291 do something to the PCIe lanes when `PCIE_DIS` is pulled high? Is there something we can do to change that behavior?
2. Is it possible to use the device in PCIe mode and still be able to load firmware and execute AT commands? We would also like to use the GPS as part of the standard `gpsd` service is Linux. Is this possible in PCIe mode?

Thanks for you help.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [October 26, 2024, 12:02pm UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/12 "2024-10-26T12:02:07Z")

</div>

You need to see the specification of em9291  
The pin is controlling whether it is for usb or pcie communication

Btw, did you install the pcie driver?  
[https://source.sierrawireless.com/resources/airprime/software/mbpl/mbpl-software-latest/](https://source.sierrawireless.com/resources/airprime/software/mbpl/mbpl-software-latest/)

---

<div class="post-metadata">

**Author:** ![jp11](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jp11](https://forum.sierrawireless.com/u/jp11)\
**Post date:** [October 26, 2024, 1:12pm UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/13 "2024-10-26T13:12:46Z")

</div>

I reviewed the specification and we are pulling the pins high according to that. When we do that, the nvme stops working.

I installed those drivers, but they don’t seem to have any effect on the system. I’m not able to load the firmware to the device.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [October 26, 2024, 1:26pm UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/14 "2024-10-26T13:26:24Z")

</div>

So you have installed the pcie driver?

Btw, why does the nvme driver stop working?  
Did you debug this?  
How about connecting the em9291 module with usb after the system boots?

---

<div class="post-metadata">

**Author:** ![jp11](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jp11](https://forum.sierrawireless.com/u/jp11)\
**Post date:** [October 28, 2024, 7:41am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/15 "2024-10-28T07:41:33Z")

</div>

I attempted to install PCIe drivers, but I hit the following problems.

1. `MBPL_DRIVERS_R40_ENG3-bin.tar.gz` seems to only have Ubuntu\_x64 and kernel 5.3. We run Fedora Core with kernel 6.11
2. `MBPL_DRIVERS_R40_ENG3-usb-pcie-src.tar.gz` has the directories `usb` and `linaro`. The `usb` driver builds fine, but the `linaro` won’t build and has the following error:

```auto
~/sw/r40/linaro$ make
make -C /lib/modules/6.11.3-200.fc40.x86_64/build M=/var/home/core/sw/r40/linaro ccflags-y="-DCONFIG_MHI_BUS_DEBUG"
make[1]: Entering directory '/usr/src/kernels/6.11.3-200.fc40.x86_64'
  CC [M] /var/home/core/sw/r40/linaro/host/init.o
/var/home/core/sw/r40/linaro/host/init.c:1447:18: error: initialization of ‘int (*)(struct device *, const struct device_driver *)’ from incompatible pointer type ‘int (*)(struct device *, struct device_driver *)’ [-Wincompatible-pointer-types]
 1447 | .match = mhi_match,
      | ^ ~~~~~~~~
/var/home/core/sw/r40/linaro/host/init.c:1447:18: note: (near initialization for ‘mhi_bus_type.match’)
make[4]: *** [scripts/Makefile.build:244: /var/home/core/sw/r40/linaro/host/init.o] Error 1
make[3]: *** [scripts/Makefile.build:485: /var/home/core/sw/r40/linaro/host] Error 2
make[2]: *** [/usr/src/kernels/6.11.3-200.fc40.x86_64/Makefile:1966: /var/home/core/sw/r40/linaro] Error 2
make[1]: *** [Makefile:236: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/kernels/6.11.3-200.fc40.x86_64'
make: *** [Makefile:20: all] Error 2

```

Just FYI, when the device is in USB mode, causes the whole PCI bus to go down. I’ve tried a few EM9291s with the same issue.

If I bring up the system with the EM9291 installed and then install it after boot, it causes all the PCIe devices to disconnect and the system becomes non-functional because the NVMe drive is now offline (inaccessible.)

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [October 28, 2024, 8:08am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/16 "2024-10-28T08:08:58Z")

</div>

I don’t see problem to compile in Ubuntu 20.

Can you try Ubuntu 20?

```auto

owner@ubuntu:~/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro$ make
make -C /lib/modules/5.15.0-91-generic/build M=/home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro ccflags-y="-DCONFIG_MHI_BUS_DEBUG"
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-91-generic'
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/init.o
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/main.o
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/pm.o
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/boot.o
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/debugfs.o
  LD [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/mhi.o
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/pci_generic.o
  LD [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/mhi_pci_semtech.o
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/uci.o
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_wwan_ctrl.o
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_wwan_mbim.o
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_dtr.o
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/qrtr/mhi.o
  LD [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/qrtr/qrtr-mhi.o
  MODPOST /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/Module.symvers
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/mhi.mod.o
  LD [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/mhi.ko
  BTF [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/mhi.ko
Skipping BTF generation for /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/mhi.ko due to unavailability of vmlinux
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/mhi_pci_semtech.mod.o
  LD [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/mhi_pci_semtech.ko
  BTF [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/mhi_pci_semtech.ko
Skipping BTF generation for /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/mhi_pci_semtech.ko due to unavailability of vmlinux
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/uci.mod.o
  LD [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/uci.ko
  BTF [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/uci.ko
Skipping BTF generation for /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/host/uci.ko due to unavailability of vmlinux
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/qrtr/qrtr-mhi.mod.o
  LD [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/qrtr/qrtr-mhi.ko
  BTF [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/qrtr/qrtr-mhi.ko
Skipping BTF generation for /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/qrtr/qrtr-mhi.ko due to unavailability of vmlinux
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_dtr.mod.o
  LD [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_dtr.ko
  BTF [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_dtr.ko
Skipping BTF generation for /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_dtr.ko due to unavailability of vmlinux
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_wwan_ctrl.mod.o
  LD [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_wwan_ctrl.ko
  BTF [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_wwan_ctrl.ko
Skipping BTF generation for /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_wwan_ctrl.ko due to unavailability of vmlinux
  CC [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_wwan_mbim.mod.o
  LD [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_wwan_mbim.ko
  BTF [M] /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_wwan_mbim.ko
Skipping BTF generation for /home/owner/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro/wwan/mhi_wwan_mbim.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-91-generic'
owner@ubuntu:~/QMI/MBPL/MBPL_DRIVERS_R40_ENG3-usb-pcie-src/linaro$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.6 LTS
Release:	20.04
Codename:	focal

```

---

<div class="post-metadata">

**Author:** ![jp11](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jp11](https://forum.sierrawireless.com/u/jp11)\
**Post date:** [October 28, 2024, 8:53am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/17 "2024-10-28T08:53:36Z")

</div>

I fixed it by changing the signature to:

```auto
int mhi_match(struct device *dev, const struct device_driver *drv) {

```

I now see the `wwan0at0` interface. Is it possible to access the GPS in PCIe mode? We would like to access it using `gpsd`. We are looking to get a GPS time source into `chrony` and this seems to be the easiest method. If there is another method, we would be happy to use that too.

Are the MHI and USB interfaces considered equivalent?

Just FYI, Ubuntu 20 LTS reaches end of general support in May 2025.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [October 28, 2024, 9:36am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/18 "2024-10-28T09:36:33Z")

</div>

does this help?

> [@EM9191 - NMEA GPS Stream - Can not find the ttyUSB Interface](https://forum.sierrawireless.com/t/em9191-nmea-gps-stream-can-not-find-the-ttyusb-interface/28701/12):
>
> I have just tried the virtual port, it is working fine for my Ubuntu 18 to output NMEA frame in virtual port: sudo apt-get install libmbim-utils make sure MBIM port is enabled in AT!USBCOMP? connect antenna to AUX antenna port power on the EM9191 with FW SWIX55C\_03.09.11.00 Make sure GPSENABLE has been enabled in AT!CUSTOM? type AT!GPSAUTOSTART=1 kernel log should show the following: [355.731518] usb 3-2.1: Product: Sierra Wireless EM9191 [355.731519] usb 3-2.1: Manufacturer: Sierra Wirel…

---

<div class="post-metadata">

**Author:** ![jp11](https://avatars.discourse-cdn.com/v4/letter/j/6bbea6/32.png) [@jp11](https://forum.sierrawireless.com/u/jp11)\
**Post date:** [October 28, 2024, 11:22pm UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/19 "2024-10-28T23:22:01Z")

</div>

I get to the part where it says to set GPS to autostart and but `/dev/cdc-wdm0` doesn’t enumerate.

Here is the minicom log

```auto
AT
OK
AT!USBCOMP?
Config Index: 1
Config Type: 4 (MBIM V2)
Interface bitmask: 00001009 (diag,modem,mbim)

OK
AT!CUSTOM?
!CUSTOM:
             GPSENABLE 0x01
             GPSSEL 0x01
             IMCONFIG 0x02
             IPV6ENABLE 0x01
             UIM2ENABLE 0x01
             SIMLPM 0x01
             USBSERIALENABLE 0x01
             SCRUBEN 0x01
             CSDDISABLE 0x01
             ICMPINTSRVDIS 0x01
             SIMLPA 0x01

OK
AT!GPSAUTOSTART=1
OK

```

dmesg shows this:

```auto
~$ sudo dmesg | grep usb
[0.291543] usbcore: registered new interface driver usbfs
[0.291543] usbcore: registered new interface driver hub
[0.291543] usbcore: registered new device driver usb
[0.552359] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.11
[0.552361] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[0.552363] usb usb1: Product: xHCI Host Controller
[0.552364] usb usb1: Manufacturer: Linux 6.11.3-200.fc40.x86_64 xhci-hcd
[0.552366] usb usb1: SerialNumber: 0000:00:0d.0
[0.552475] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.11
[0.552477] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[0.552479] usb usb2: Product: xHCI Host Controller
[0.552480] usb usb2: Manufacturer: Linux 6.11.3-200.fc40.x86_64 xhci-hcd
[0.552481] usb usb2: SerialNumber: 0000:00:0d.0
[0.554581] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.11
[0.554583] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[0.554585] usb usb3: Product: xHCI Host Controller
[0.554586] usb usb3: Manufacturer: Linux 6.11.3-200.fc40.x86_64 xhci-hcd
[0.554587] usb usb3: SerialNumber: 0000:00:14.0
[0.555896] usb usb4: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.11
[0.555898] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[0.555899] usb usb4: Product: xHCI Host Controller
[0.555901] usb usb4: Manufacturer: Linux 6.11.3-200.fc40.x86_64 xhci-hcd
[0.555902] usb usb4: SerialNumber: 0000:00:14.0
[0.556471] usbcore: registered new interface driver usbserial_generic
[0.556475] usbserial: USB Serial support registered for generic
[0.565882] usbcore: registered new interface driver usbhid
[0.565886] usbhid: USB HID core driver
[0.797730] usb 3-7: new full-speed USB device number 2 using xhci_hcd
[0.928293] usb 3-7: New USB device found, idVendor=0cf3, idProduct=e600, bcdDevice= 0.01
[0.928682] usb 3-7: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[3.509156] usbcore: registered new interface driver cdc_wdm
[3.512541] usbcore: registered new interface driver cdc_ether
[3.516899] usbcore: registered new interface driver cdc_ncm
[3.518707] usbcore: registered new interface driver cdc_mbim
[3.521726] usbcore: registered new interface driver qmi_wwan
[3.523307] usbcore: registered new interface driver qcserial
[3.523741] usbserial: USB Serial support registered for Qualcomm USB modem
[3.524152] usbserial: USB Serial support registered for Qualcomm USB modem
[3.921939] Modules linked in: sunrpc rapl intel_cstate btmtk bluetooth intel_uncore processor_thermal_mbox mei spi_intel_pci soundcore i2c_i801 cec wmi_bmof int340x_thermal_zone spi_intel i2c_smbus intel_soc_dts_iosf intel_pmc_core intel_vsec int3400_thermal pmt_telemetry fjes(-) pmt_class acpi_thermal_rel acpi_tad acpi_pad mhi_pci_semtech(OE) qcserial(OE) qmi_wwan(OE) usb_wwan(OE) cdc_mbim cdc_ncm cdc_ether cdc_wdm usbnet mii ath11k_pci(OE) mhi(OE) ath11k(OE) mac80211 libarc4 cfg80211 rfkill qmi_helpers nfnetlink overlay xfs nvme_tcp crct10dif_pclmul crc32_pclmul crc32c_intel nvme_fabrics polyval_clmulni nvme polyval_generic nvme_keyring nvme_core ghash_clmulni_intel sha512_ssse3 sha256_ssse3 igc sha1_ssse3 wdat_wdt nvme_auth video wmi pinctrl_tigerlake be2iscsi bnx2i cnic uio cxgb4i cxgb4 tls cxgb3i cxgb3 mdio libcxgbi libcxgb qla4xxx iscsi_boot_sysfs iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi scsi_dh_rdac scsi_dh_emc scsi_dh_alua ip6_tables ip_tables fuse dm_multipath
[4.006038] usbcore: registered new interface driver btusb

```

tail of dmesg

```auto
[7.558489] fbcon: i915drmfb (fb0) is primary device
[9.797194] Console: switching to colour frame buffer device 240x67
[9.821421] i915 0000:00:02.0: [drm] fb0: i915drmfb frame buffer device
[24.124080] systemd-journald[1013]: /var/log/journal/ed135f74695646ad9803f565ac5d4449/user-1000.journal: Journal file uses a different sequence number ID, rotating.

```

ls of /dev

```auto
$ ls /dev
acpi_thermal_rel cpu_dma_latency fd kmsg mhi0_QDSS nvme0 pps0 ptp2 shm tty10 tty19 tty27 tty35 tty43 tty51 tty6 ttyS1 ttyS18 ttyS26 ttyS6 usbmon1 vcs4 vcsa6 vga_arbiter wwan0qmi0
autofs disk full kvm mqueue nvme0n1 pps1 ptp3 snapshot tty11 tty2 tty28 tty36 tty44 tty52 tty60 ttyS10 ttyS19 ttyS27 ttyS7 usbmon2 vcs5 vcsu vhci zero
block dma_heap fuse log mtd nvme0n1p1 pps2 ptp4 snd tty12 tty20 tty29 tty37 tty45 tty53 tty61 ttyS11 ttyS2 ttyS28 ttyS8 usbmon3 vcs6 vcsu1 vhost-net
btrfs-control dri gpiochip0 loop-control mtd0 nvme0n1p2 pps3 ptp5 stderr tty13 tty21 tty3 tty38 tty46 tty54 tty62 ttyS12 ttyS20 ttyS29 ttyS9 usbmon4 vcsa vcsu2 vhost-vsock
bus drm_dp_aux0 hpet mapper mtd0ro nvme0n1p3 pps4 pts stdin tty14 tty22 tty30 tty39 tty47 tty55 tty63 ttyS13 ttyS21 ttyS3 udmabuf userfaultfd vcsa1 vcsu3 watchdog
char drm_dp_aux1 hugepages mcelog net nvme0n1p4 pps5 random stdout tty15 tty23 tty31 tty4 tty48 tty56 tty7 ttyS14 ttyS22 ttyS30 uhid vcs vcsa2 vcsu4 watchdog0
console drm_dp_aux2 hwrng mei0 ng0n1 nvram ptmx rfkill tty tty16 tty24 tty32 tty40 tty49 tty57 tty8 ttyS15 ttyS23 ttyS31 uinput vcs1 vcsa3 vcsu5 wwan0at0
core drm_dp_aux3 initctl mem null port ptp0 rtc tty0 tty17 tty25 tty33 tty41 tty5 tty58 tty9 ttyS16 ttyS24 ttyS4 urandom vcs2 vcsa4 vcsu6 wwan0mbim0
cpu drm_dp_aux4 input mhi0_IP_HW_ADPL nvme-fabrics ppp ptp1 rtc0 tty1 tty18 tty26 tty34 tty42 tty50 tty59 ttyS0 ttyS17 ttyS25 ttyS5 usbmon0 vcs3 vcsa5 vfio wwan0qcdm0

```

`VBUS_SENSE` is pulled to 3.3V, `PCIE_DIS` is floating.

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex025/user_avatar/forum.sierrawireless.com/jyijyi/32/4766_2.png) [@jyijyi](https://forum.sierrawireless.com/u/jyijyi)\
**Post date:** [October 29, 2024, 12:59am UTC](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/20 "2024-10-29T00:59:40Z")

</div>

Do you see the mbim interface enumerated just like the following?

> [@EM9291 in Linux Preventing Shutdown](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866/8):
>
> What is the VID PID on dmesg? On my side, I can see the following:

For example, I can see the wwan0qmi0 and wwan0mbim0 interface in your log

BTW, it seems your environment is still using PCIE interface for your module

[Next page](https://forum.sierrawireless.com/t/em9291-in-linux-preventing-shutdown/33866.md?page=2)
