All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Webb <chris@arachsys.com>
To: mhi@lists.linux.dev
Subject: PCIe MBIM modem not creating a wwan netdev
Date: Tue, 30 Jul 2024 23:11:24 +0100	[thread overview]
Message-ID: <ZqllDCWfiKravZAo@arachsys.com> (raw)

I have a router board with a Quectel RM520N-GL 5G module that speaks either
USB or PCIe. In USB mode, I have

  CONFIG_USB_USBNET=y
  CONFIG_USB_NET_CDC_MBIM=y

and everything works: I get a /dev/wwan0mbim to bring up the modem and a
wwan0 netdev to use with the negotiated config.

If I switch the modem to PCIe MHI mode and compile in

  CONFIG_MHI_BUS=y
  CONFIG_MHI_BUS_PCI_GENERIC=y
  CONFIG_WWAN=y
  CONFIG_MHI_WWAN_CTRL=y
  CONFIG_MHI_WWAN_MBIM=y

the modem is recognised as one of the models listed in
drivers/bus/mhi/host/pci_generic.c. dmesg reports

  mhi-pci-generic 0000:01:00.0: MHI PCI device found: qcom-sdx65m
  mhi-pci-generic 0000:01:00.0: BAR 0 [mem 0x20000000-0x20000fff 64bit]: assigned
  mhi-pci-generic 0000:01:00.0: enabling device (0000 -> 0002)
  mhi mhi0: Requested to power ON
  mhi mhi0: Power on setup success
  wwan wwan0: port wwan0qcdm0 attached
  wwan wwan0: port wwan0mbim0 attached
  wwan wwan0: port wwan0qmi0 attached

and this gives me character devices /dev/wwan0mbim0, /dev/wwan0qcdm0
and /dev/wwan0qmi0... but no corresponding wwan0 network interface.

I can successfully bring up the modem over mbim exactly as in the USB case:

  # mbim /dev/wwan0mbim0 open
  # mbim /dev/wwan0mbim0 subscriber
  ready-state initialized
  sim-icc-id 8xxxxxxxxxxxxxxxxxxx
  subscriber-id 23xxxxxxxxxxxx
  telephone-number +447xxxxxxxxx
  # mbim /dev/wwan0mbim0 connect ipv4:internet
  session-id 0
  activation-state activated
  ip-type ipv4
  # mbim /dev/wwan0mbim0 config
  address 10.248.62.56/28
  gateway 10.248.62.57
  dns 192.168.253.31
  dns 192.168.253.31
  mtu 1500
  #

but I have no netdev to configure the negotiated address on:

  # ip link
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
  2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq master br0 state DOWN mode DEFAULT group default qlen 1000
      link/ether 94:83:c4:a6:cf:d7 brd ff:ff:ff:ff:ff:ff
  3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP mode DEFAULT group default qlen 1000
      link/ether 94:83:c4:a6:cf:d8 brd ff:ff:ff:ff:ff:ff
  4: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
      link/ether 94:83:c4:a6:cf:d9 brd ff:ff:ff:ff:ff:ff
  5: wlan1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
      link/ether 94:83:c4:a6:cf:d7 brd ff:ff:ff:ff:ff:ff
  6: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
      link/ether 94:83:c4:a6:cf:d7 brd ff:ff:ff:ff:ff:ff

(If I add CONFIG_MHI_NET=y, I get 'raw' links like

  2: mhi_swip0: <POINTOPOINT,NOARP> mtu 16384 qdisc noop state DOWN mode DEFAULT group default qlen 1000
      link/[519]
  3: mhi_hwip0: <POINTOPOINT,NOARP> mtu 16384 qdisc noop state DOWN mode DEFAULT group default qlen 1000
      link/[519]

but no wwan0 link. Configuring the address on a raw link doesn't work.)

I added a printk to mhi_mbim_probe() of drivers/net/wwan/mhi_wwan_mbim.c
and this never fires, which might explain why no netdev is created? The
same thing happens on linux 6.10.2 and the head of Linus' tree at the
time I write this. I also reproduced on an older 6.9.12 kernel.

Is this a bug (with my modem?) or there something more than the above
I need to enable for the network device to be created as well as the
character devices, as in the USB case?

For what it's worth, my complete 'make savedefconfig' is

  https://github.com/arachsys-hosts/gl-x3000/blob/master/config/linux.cfg

Best wishes,

Chris.

             reply	other threads:[~2024-07-30 22:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-30 22:11 Chris Webb [this message]
2024-08-04 18:13 ` PCIe MBIM modem not creating a wwan netdev Chris Webb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZqllDCWfiKravZAo@arachsys.com \
    --to=chris@arachsys.com \
    --cc=mhi@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.