Hey Thomas!

> I'm trying to use ModemManager with a Sierra Wireless AirPrime EM919X,
> based on a Snapdragon X55 5G Modem, without success.
>
> The EM919X is connected to an i.MX6QDL through a MHI bus on top of a
> PCIe gen2 bus.
>
> I'm using the kernel 5.13.6, modemmanager 1.32.4, libqmi 1.30.0 and
> libmbim 1.26.0.

Wow, that's a MM version from the future! It's 1.16.8 according to
your logs though ;)

>
> Aug  9 15:32:54 target daemon.info dbus-daemon[435]: [system]
> Activating service name='org.freedesktop.ModemManager1' requested by
> ':1.1' (uid=0 pid=507 comm="/usr/sbin/NetworkManager ") (using
> servicehelper)
> Aug  9 15:32:54 target daemon.info ModemManager[531]: <info>
> ModemManager (version 1.16.8) starting in system bus...
> Aug  9 15:32:55 target daemon.info dbus-daemon[435]: [system]
> Successfully activated service 'org.freedesktop.ModemManager1'
> Aug  9 15:32:55 target daemon.info NetworkManager[507]: <info>
> [1628523175.0109] modem-manager: ModemManager not available
> Aug  9 15:32:55 target daemon.info NetworkManager[507]: <info>
> [1628523175.1141] modem-manager: ModemManager now available
> Aug  9 15:32:56 target daemon.warn ModemManager[531]: <warn>
> [wwan0p1QCDM/qcdm] failed to open serial device
> Aug  9 15:32:56 target daemon.warn ModemManager[531]: <warn>  [plugin-
> manager] task 0,wwan0p1QCDM: error when checking support with plugin
> 'generic': (wwan/wwan0p1QCDM) Failed to open QCDM port: Failed to open
> QCDM port: -2

Humm, that should not happen, right @Loic Poulain ? It's true that
it's not a serial device, and I recall some patch avoiding to run
config_fd() on non-serial devices, so it may be related.

> Aug  9 15:32:56 target daemon.debug ModemManager[531]:
> [/dev/wwan0p3QMI] Opening device with flags 'version-info, proxy'...
> Aug  9 15:32:56 target daemon.debug ModemManager[531]:
> [/dev/wwan0p3QMI] created endpoint
> Aug  9 15:32:56 target daemon.debug ModemManager[531]: cannot connect
> to proxy: Could not connect: Connection refused
> Aug  9 15:32:56 target daemon.debug ModemManager[531]: spawning new
> qmi-proxy (try 1)...
> Aug  9 15:32:56 target daemon.debug ModemManager[531]: opening
> device...
> Aug  9 15:32:56 target daemon.debug ModemManager[531]: cannot connect
> to proxy: Could not connect: Connection refused

There is something very wrong in this setup I think; MM tries to spawn
a new qmi-proxy as there is none, but that fails. It shouldn't fail! I
would assume the proxy could be failing to open the wwan0p3QMI port in
the same way as the QCDM one, but wouldn't know.

> Aug  9 15:32:56 target daemon.debug ModemManager[531]: spawning new
> mbim-proxy (try 1)...
> Aug  9 15:32:56 target daemon.debug ModemManager[531]:
> [/dev/wwan0p2MBIM] Couldn't find descriptors file, possibly not using
> cdc_mbim
> Aug  9 15:32:56 target daemon.debug ModemManager[531]:
> [/dev/wwan0p2MBIM] Fallback to default max control message size: 4096

Wait, and this modem exposes both QMI and MBIM ports? I think this is
new, first time I've seen this I think. If I'm not mistaken this is a
decision that the manufacturer takes, right? I think the generic
plugin will try to create a QMI based modem if it finds any QMI
capable port, and otherwise fallback to create a MBIM based modem if
it finds any MBIM capable port. Anyway, we didn't reach that point
yet, just a heads up.

> Aug  9 15:32:56 target daemon.debug ModemManager[531]:
> [/dev/wwan0p3QMI] Checking version info (45 retries)...
> Aug  9 15:32:57 target daemon.info ModemManager[531]: <info>  [base-
> manager] couldn't check support for device
> '/sys/devices/platform/soc/2100000.bus/2184200.usb/ci_hdrc.1/usb1/1-
> 1/1-1.1': not supported by any plugin
> Aug  9 15:32:57 target daemon.info ModemManager[531]: <info>  [base-
> manager] couldn't check support for device
> '/sys/devices/platform/soc/2100000.bus/2188000.ethernet': not supported
> by any plugin
> Aug  9 15:32:57 target daemon.debug ModemManager[531]: transaction 0x2
> aborted, but message is not abortable
> <...>
> Aug  9 15:33:25 target daemon.debug ModemManager[531]: transaction 0x1e
> aborted, but message is not abortable
> Aug  9 15:33:26 target daemon.debug ModemManager[531]: proxy
> configuration failed: closed
> Aug  9 15:33:26 target daemon.debug ModemManager[531]:
> [/dev/wwan0p2MBIM] channel destroyed
> Aug  9 15:33:26 target daemon.debug ModemManager[531]: transaction 0x1f
> aborted, but message is not abortable
> <...>
> Aug  9 15:33:41 target daemon.debug ModemManager[531]: transaction 0x2e
> aborted, but message is not abortable
> Aug  9 15:33:41 target daemon.info ModemManager[531]: <info>  [device
> /sys/devices/platform/soc/1ffc000.pcie/pci0000:00/0000:00:00.0/0000:01:
> 00.0] creating modem with plugin 'generic' and '3' ports
> Aug  9 15:33:41 target daemon.warn ModemManager[531]: <warn>
> [plugin/generic] could not grab port wwan0p3QMI: Cannot add port
> 'wwan/wwan0p3QMI', unhandled port type
> Aug  9 15:33:41 target daemon.warn ModemManager[531]: <warn>
> [plugin/generic] could not grab port wwan0p2MBIM: Cannot add port
> 'wwan/wwan0p2MBIM', unhandled port type

Neither the QMI nor the MBIM probing were successful.

> Aug  9 15:33:41 target daemon.warn ModemManager[531]: <warn>  [base-
> manager] couldn't create modem for device
> '/sys/devices/platform/soc/1ffc000.pcie/pci0000:00/0000:00:00.0/0000:01
> :00.0': Failed to find primary AT port
>
> Moreover, devices are well enumerated and its registers are accessed by
> the driver:
>
> ls /sys/bus/mhi/devices
>     mhi0         mhi0_DIAG    mhi0_IPCR    mhi0_IP_HW0  mhi0_MBIM
> mhi0_QMI
>
> cat /sys/kernel/debug/mhi/mhi0/regdump
> Host PM state: M0 Device state: M0 EE: MISSION MODE
> Device EE: MISSION MODE state: M0
> MHI_REGLEN: 0x100
> MHI_VER: 0x1000000
> MHI_CFG: 0x2040080
> MHI_CTRL: 0x200
> MHI_STATUS: 0x201
> MHI_WAKE_DB: 0x0
> BHI_EXECENV: 0x2
> BHI_STATUS: 0x0
> BHI_ERRCODE: 0x0
> BHI_ERRDBG1: 0x0
> BHI_ERRDBG2: 0x0
> BHI_ERRDBG3: 0x0
>
> Do you have any idea where the issue might come from?
>

Several things to test:
 * I'm going to tag a 1.18-rc1 release (v1.17.900) in a few minutes,
based off git master, please try with that one.
 * Try with qmicli directly on the QMI port, and see what happens.
This is; stop ModemManager, make sure there are no qmi-proxy processes
running, and then run as root e.g. "qmicli -d /dev/wwan0p3QMI
--dms-get-capabilities --verbose". Does that work?
 * Try with mbimcli directly in the MBIM port and see what happens.
This is; stop ModemManager, make sure there are no mbim-proxy
processes running, and then run as root e.g. "mbimcli -d
/dev/wwan0p2MBIM --query-device-caps --verbose". Does that work?
 * If the previous checks run successfully, you should try to launch
the mbim-proxy and qmi-proxy manually, both, with verbose logs and
--no-exit, and then run ModemManager --debug, that way we can see
verbose logs of all involved processes to see what could be the issue.
See 
https://modemmanager.org/docs/modemmanager/debugging/#qmi-proxy-or-mbim-proxy-debug-logs

At some point we should update the Sierra plugin to add support for
these modules there, instead of relying on the generic plugin, as we
have done for SDX55 based modules from Quectel, Cinterion/Thales,
Foxconn and Fibocom.

-- 
Aleksander
https://aleksander.es

Reply via email to