On 12.08.22 10:55, Daniele Palmas wrote:
Hi Koen,

Il giorno gio 11 ago 2022 alle ore 15:24 Koen Vandeputte
<koen.vandepu...@citymesh.com> ha scritto:
Hi All,

I'm currently working on adding MHI support within OpenWRT. (kernel 5.15.59)

I have a few modems laying around here:

- Sierra Wireless EM9191
- Telit FN980
- Fibocom FM150-AE

On all 3 of them, MHI seems to enumerate correctly:

[    8.258921] mhi-pci-generic 0000:01:00.0: BAR 0: assigned [mem
0x01100000-0x01100fff 64bit]
[    8.267488] mhi-pci-generic 0000:01:00.0: enabling device (0140 -> 0142)
[    8.276817] mhi mhi0: Requested to power ON
[    8.288905] mhi mhi0: Power on setup success
[    8.341370] mhi mhi0: Wait for device to enter SBL or Mission mode

Exposed devices:

/dev/wwan0mbim0
/dev/wwan0qcdm0
/dev/wwan0qmi0

And a network device:

mhi_hwip0


Following kernel SYMS are enabled:

CONFIG_MHI_BUS=m
CONFIG_MHI_BUS_DEBUG=y
CONFIG_MHI_BUS_PCI_GENERIC=m
CONFIG_MHI_NET=m
CONFIG_MHI_WWAN_CTRL=m
CONFIG_MHI_WWAN_MBIM=m
CONFIG_WWAN=m


Now the problem is, when sending QMI traffic towards wwan0qmi0, I never
get a reply back on any of them.
When using cdc-wdm  or when wwan0qmi0 is exposed over usb, it works,
but as soon as wwan0qmi0 is exposed over pcie, it fails.

Does anyone have any clue what is missing here?

I suggest you enable dynamic debugging on mhi and wwan to get more
information about what's going on.

My experience is that some hosts have issues with runtime power
management (e.g. the modem is not able to exit M3) and the symptoms
seem to be the same as the ones you describe.

Regards,
Daniele

Hi Daniele,

Thanks for the reply.
Well .. this is interesting.  Looks like my EM919x is always detected as a generic "qcom sdx55"

All looks well-defined within mhi/pci-generic.c and lspci -v reports the proper ID's:


static const struct pci_device_id mhi_pci_id_table[] = {
        /* EM919x (sdx55), use the same vid:pid as qcom-sdx55m */
        { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0306, 0x18d7, 0x0200),
                .driver_data = (kernel_ulong_t) &mhi_sierra_em919x_info },
        /* Telit FN980 hardware revision v1 */
        { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0306, 0x1C5D, 0x2000),
                .driver_data = (kernel_ulong_t) &mhi_telit_fn980_hw_v1_info },
        { PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0306),
                .driver_data = (kernel_ulong_t) &mhi_qcom_sdx55_info },
        { PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0304),
                .driver_data = (kernel_ulong_t) &mhi_qcom_sdx24_info },


01:00.0 Unassigned class [ff00]: Qualcomm Device 0306
    Subsystem: Device 18d7:0200


hmz ..



Here are the logs:


[   10.506776] mhi-pci-generic 0000:01:00.0: MHI PCI device found: qcom-sdx55m [   10.513847] mhi-pci-generic 0000:01:00.0: BAR 0: assigned [mem 0x01100000-0x01100fff 64bit]
[   10.522357] mhi-pci-generic 0000:01:00.0: enabling device (0140 -> 0142)
[   10.532198] mhi mhi0: Requested to power ON
[   10.536490] mhi mhi0: Attempting power on with EE: PASS THROUGH, state: RESET
[   10.547145] mhi mhi0: Power on setup success
[   10.547293] mhi mhi0: Handling state transition: PBL
[   10.556541] mhi mhi0: Device in READY State
[   10.560738] mhi mhi0: Initializing MHI registers
[   10.565457] mhi mhi0: Wait for device to enter SBL or Mission mode
[   10.633687] mhi mhi0: local ee: MISSION MODE state: READY device ee: MISSION MODE state: READY
[   10.657015] mhi mhi0: State change event to state: M0
[   10.662281] mhi mhi0: Received EE event: MISSION MODE
[   10.667577] mhi mhi0: Handling state transition: MISSION MODE
[   10.673524] mhi mhi0: Processing Mission Mode transition
[   10.684850] mhi_net mhi0_IP_HW0: 100: Updating channel state to: START
[   10.707859] mhi_net mhi0_IP_HW0: 100: Channel state change to START successful
[   10.715374] mhi_net mhi0_IP_HW0: 101: Updating channel state to: START
[   10.737501] mhi_net mhi0_IP_HW0: 101: Channel state change to START successful

// start talking QMI to wwan0qmi0

[  131.173212] mhi_wwan_ctrl mhi0_QMI: 14: Updating channel state to: START
[  131.187781] mhi_wwan_ctrl mhi0_QMI: 14: Channel state change to START successful
[  131.195303] mhi_wwan_ctrl mhi0_QMI: 15: Updating channel state to: START
[  131.207145] mhi_wwan_ctrl mhi0_QMI: 15: Channel state change to START successful
[  131.966531] mhi_wwan_ctrl mhi0_QMI: 15: Updating channel state to: RESET
[  131.980574] mhi_wwan_ctrl mhi0_QMI: 15: Channel state change to RESET successful
[  131.988018] mhi mhi0: Marking all events for chan: 15 as stale
[  131.993887] mhi mhi0: Finished marking events as stale events
[  131.999704] mhi_wwan_ctrl mhi0_QMI: mhi_dl_xfer_cb: status: -107 receive_len: 0 [  132.007123] mhi_wwan_ctrl mhi0_QMI: mhi_dl_xfer_cb: status: -107 receive_len: 0 [  132.014565] mhi_wwan_ctrl mhi0_QMI: mhi_dl_xfer_cb: status: -107 receive_len: 0
[  132.021911] mhi_wwan_ctrl mhi0_QMI: 15: successfully reset
[  132.027439] mhi_wwan_ctrl mhi0_QMI: 14: Updating channel state to: RESET
[  132.039934] mhi_wwan_ctrl mhi0_QMI: 14: Channel state change to RESET successful
[  132.047371] mhi mhi0: Marking all events for chan: 14 as stale
[  132.053236] mhi mhi0: Finished marking events as stale events
[  132.058992] mhi_wwan_ctrl mhi0_QMI: mhi_ul_xfer_cb: status: -107 xfer_len: 0 [  132.066075] mhi_wwan_ctrl mhi0_QMI: mhi_ul_xfer_cb: status: -107 xfer_len: 0 [  132.073167] mhi_wwan_ctrl mhi0_QMI: mhi_ul_xfer_cb: status: -107 xfer_len: 0
[  132.080268] mhi_wwan_ctrl mhi0_QMI: 14: successfully reset
[  135.132013] mhi_wwan_ctrl mhi0_QMI: 14: Updating channel state to: START
[  135.146232] mhi_wwan_ctrl mhi0_QMI: 14: Channel state change to START successful
[  135.154006] mhi_wwan_ctrl mhi0_QMI: 15: Updating channel state to: START
[  135.165448] mhi_wwan_ctrl mhi0_QMI: 15: Channel state change to START successful
[  135.924164] mhi_wwan_ctrl mhi0_QMI: 15: Updating channel state to: RESET
[  135.938200] mhi_wwan_ctrl mhi0_QMI: mhi_ul_xfer_cb: status: 0 xfer_len: 12 [  135.945123] mhi_wwan_ctrl mhi0_QMI: mhi_ul_xfer_cb: status: 0 xfer_len: 12 [  135.952012] mhi_wwan_ctrl mhi0_QMI: mhi_ul_xfer_cb: status: 0 xfer_len: 12 [  135.959258] mhi_wwan_ctrl mhi0_QMI: 15: Channel state change to RESET successful
[  135.966710] mhi mhi0: Marking all events for chan: 15 as stale
[  135.972581] mhi mhi0: Finished marking events as stale events
[  135.978398] mhi_wwan_ctrl mhi0_QMI: mhi_dl_xfer_cb: status: -107 receive_len: 0 [  135.985828] mhi_wwan_ctrl mhi0_QMI: mhi_dl_xfer_cb: status: -107 receive_len: 0 [  135.993262] mhi_wwan_ctrl mhi0_QMI: mhi_dl_xfer_cb: status: -107 receive_len: 0
[  136.000638] mhi_wwan_ctrl mhi0_QMI: 15: successfully reset
[  136.006167] mhi_wwan_ctrl mhi0_QMI: 14: Updating channel state to: RESET
[  136.020214] mhi_wwan_ctrl mhi0_QMI: 14: Channel state change to RESET successful
[  136.027650] mhi mhi0: Marking all events for chan: 14 as stale
[  136.033515] mhi mhi0: Finished marking events as stale events
[  136.039286] mhi_wwan_ctrl mhi0_QMI: 14: successfully reset
[  139.091396] mhi_wwan_ctrl mhi0_QMI: 14: Updating channel state to: START
[  139.105574] mhi_wwan_ctrl mhi0_QMI: 14: Channel state change to START successful
[  139.113108] mhi_wwan_ctrl mhi0_QMI: 15: Updating channel state to: START
[  139.124721] mhi_wwan_ctrl mhi0_QMI: 15: Channel state change to START successful
[  139.883546] mhi_wwan_ctrl mhi0_QMI: 15: Updating channel state to: RESET
[  139.897577] mhi_wwan_ctrl mhi0_QMI: mhi_ul_xfer_cb: status: 0 xfer_len: 12 [  139.904502] mhi_wwan_ctrl mhi0_QMI: mhi_ul_xfer_cb: status: 0 xfer_len: 12 [  139.911391] mhi_wwan_ctrl mhi0_QMI: mhi_ul_xfer_cb: status: 0 xfer_len: 12 [  139.918624] mhi_wwan_ctrl mhi0_QMI: 15: Channel state change to RESET successful
[  139.926074] mhi mhi0: Marking all events for chan: 15 as stale
[  139.931919] mhi mhi0: Finished marking events as stale events
[  139.937781] mhi_wwan_ctrl mhi0_QMI: mhi_dl_xfer_cb: status: -107 receive_len: 0 [  139.945189] mhi_wwan_ctrl mhi0_QMI: mhi_dl_xfer_cb: status: -107 receive_len: 0 [  139.952678] mhi_wwan_ctrl mhi0_QMI: mhi_dl_xfer_cb: status: -107 receive_len: 0
[  139.960027] mhi_wwan_ctrl mhi0_QMI: 15: successfully reset
[  139.965554] mhi_wwan_ctrl mhi0_QMI: 14: Updating channel state to: RESET
[  139.979594] mhi_wwan_ctrl mhi0_QMI: 14: Channel state change to RESET successful
[  139.987031] mhi mhi0: Marking all events for chan: 14 as stale
[  139.992895] mhi mhi0: Finished marking events as stale events
[  139.998663] mhi_wwan_ctrl mhi0_QMI: 14: successfully reset

Koen

Reply via email to