mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <mani@kernel.org>
To: Haipeng Lin <jimmie.lin@gmail.com>
Cc: Manivannan Sadhasivam <mani@kernel.org>,
	 Jeff Hugo <jeff.hugo@oss.qualcomm.com>,
	mhi@lists.linux.dev,  linux-arm-msm@vger.kernel.org,
	daleyo@gmail.com,  Johan Hovold <johan@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] bus: mhi: host: pci_generic: Add MBIM-mode config for generic SDX65
Date: Wed, 02 Dec 2026 11:20:59 +0530	[thread overview]
Message-ID: <179619065985.121678.2467009720191804582.b4-reply@b4> (raw)
In-Reply-To: <20261201-mhi-sdx65-mbim-rfc-v4-1-8dbf4ae54083@gmail.com>

On 2026-12-01 21:39 -0500, Haipeng Lin wrote:
> The Surface Pro 11 5G carries an SDX65 that enumerates with Qualcomm's
> generic IDs (17cb:0308, subsystem 17cb:0308) but runs the MBIM-mode
> firmware it ships with for Windows.
> 
> Control is MBIM only (the QMI channel never answers), and data on
> channels 100/101 is framed as MBIM NTBs: the modem reports a WDA data
> format of raw IP with MBIM aggregation, up to 32 KiB downlink.
> 
> The generic qcom-sdx65m entry names channels 100/101 "IP_HW0", which
> binds mhi_net. mhi_net expects raw IP, so no data session can work.
> The MBIM-mode modules in this driver name them "IP_HW0_MBIM" instead
> which binds mhi_wwan_mbim.
> 
> Boards with a Qualcomm-ID modem in MBIM mode have so far been told
> apart by subsystem ID, like the SC8280XP CRD's SDX55 (17cb:010c).
> This modem carries the generic subsystem ID, so add a DMI match table
> that overrides the configuration the PCI IDs selected, and list the
> Snapdragon-based Surface Pro 11 5G machines there. DMI identity comes
> from SMBIOS, which UEFI provides on this machine even when booted with
> devicetree, so the same table serves DT and ACPI hosts.
> 
> There is no known way to query the modem for MBIM mode before the
> channels are set up. As a limitation, a separate SDX65 using generic
> IDs on a matching machine (e.g., via USB4 PCIe tunneling) would also
> get the MBIM config.
> 
> Like the SC8280XP CRD entry, reuse the Foxconn SDX55 channel config
> which works with this firmware. The MRU is 32 KiB to match the
> modem's downlink aggregation size.
> 
> Tested on a Surface Pro 11 5G (Surface_Pro_with_5G_11th_Edition_2077,
> modem firmware 260519-DE-2268f6b-00197) on a v7.3.4-based kernel:
> ModemManager registers the modem on wwan0mbim0, uses wwan0 for data and
> wwan0at0 for AT commands, and connects over LTE and 5G NR.
> 
> Suggested-by: Manivannan Sadhasivam <mani@kernel.org>
> Signed-off-by: Haipeng Lin <jimmie.lin@gmail.com>
> ---
> Hi Mani and Jeff,
> 
> As suggested in Mani's RFC reply this revision switches the machine
> matching from the dt root compatible to a DMI match table. The Surface
> Pro 11 exposes SMBIOS through UEFI even when booted with devicetree so
> the same table serves DT and ACPI hosts.
> 
> I listed the four Snapdragon-based Surface Pro 11 5G SKUs. The Intel-
> based SKUs are left out since I do not know whether they carry the same
> module and have no way to test.
> 
> Jeff - due to significant changes in v4 I dropped your Reviewed-by from
> v3. Please feel free to review v4's updated approach.
> 
> LLM was used to draft the MBIM configuration patch and assisted with
> testing on device.
> 
> Thanks,
> ---
> Changes in v4:
> - Match the machine by DMI instead of the devicetree root compatible,
>   per Mani's suggestion, so ACPI hosts can use the same table.
>   https://lore.kernel.org/mhi/179614425365.121678.10359650275079684909.b4-reply@b4/
> - Match all four Snapdragon-based Surface Pro 11 5G SKUs by DMI SKU.
> - Rebase onto mhi-next (v7.4-rc1 base).
> - Retest on device with current modem firmware 260519-DE-2268f6b-00197.
> - Link to v3: https://lore.kernel.org/r/20261120-mhi-sdx65-mbim-rfc-v3-1-20741d24da0c@gmail.com
> 
> Changes in v3:
> - Drop RFC prefix
> - No code changes
> - Commit message updated to note limitation for SDX65 dongles on
>   matching machines as raised by Jeff Hugo.
> - OEM PK hash method ruled out in discussion: https://lore.kernel.org/all/088d0be9-5d45-4454-b160-efff83e7a647@oss.qualcomm.com
> - Dropped Assisted-by trailer and clarified in cover letter per 7.4 guidance.
> - Link to v2: https://lore.kernel.org/r/20261110-mhi-sdx65-mbim-rfc-v2-1-f1d71a5ac9ab@gmail.com
> 
> Changes in v2:
> - Reuse modem_foxconn_sdx55_config instead of adding a channel table.
>   This adds the DUN channel (tested: answers AT commands) and drops
>   IPCR which is unused by the Surface Pro 11.
> - Link to v1: https://lore.kernel.org/r/20261011-mhi-sdx65-mbim-rfc-v1-1-8089b4d33d5b@gmail.com
> ---
>  drivers/bus/mhi/host/pci_generic.c | 73 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 73 insertions(+)
> 
> diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c
> index a7c0af7c82b2..af9a0513ae6d 100644
> --- a/drivers/bus/mhi/host/pci_generic.c
> +++ b/drivers/bus/mhi/host/pci_generic.c
> @@ -10,6 +10,7 @@
>  
>  #include <linux/delay.h>
>  #include <linux/device.h>
> +#include <linux/dmi.h>
>  #include <linux/mhi.h>
>  #include <linux/module.h>
>  #include <linux/pci.h>
> @@ -692,6 +693,19 @@ static const struct mhi_pci_dev_info mhi_foxconn_t99w760_info = {
>  	.sideband_wake = false,
>  };
>  
> +/* Generic SDX65 (17cb:0308) running MBIM mode firmware */
> +static const struct mhi_pci_dev_info mhi_qcom_sdx65_mbim_info = {
> +	.name = "qcom-sdx65m-mbim",
> +	.fw = "qcom/sdx65m/xbl.elf",
> +	.edl = "qcom/sdx65m/edl.mbn",
> +	.edl_trigger = true,
> +	.config = &modem_foxconn_sdx55_config,
> +	.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
> +	.dma_data_width = 32,
> +	.mru_default = 32768,
> +	.sideband_wake = false,
> +};
> +
>  static const struct mhi_channel_config mhi_mv3x_channels[] = {
>  	MHI_CHANNEL_CONFIG_UL(0, "LOOPBACK", 64, 0),
>  	MHI_CHANNEL_CONFIG_DL(1, "LOOPBACK", 64, 0),
> @@ -1103,6 +1117,56 @@ static const struct pci_device_id mhi_pci_id_table[] = {
>  };
>  MODULE_DEVICE_TABLE(pci, mhi_pci_id_table);
>  
> +/*
> + * DMI-based config overrides for modems advertising generic PCI IDs
> + * that require a different configuration than the generic fallback.
> + */
> +struct mhi_pci_dmi_override {

Let's use 'mhi_pci_dev_override' as we may end up extending this quirk for pure
DT based platforms without SMBIOS. So the comment also needs rewording.

> +	const struct mhi_pci_dev_info *generic_info;

Instead of comparing the generic_info pointer, you should compare the actual PCI
IDs. So you need to have 'const struct pci_device_id' pointer here and populate
the table with the actual device IDs needing the quirk.

Rest LGTM!

- Mani



      reply	other threads:[~2026-12-02  5:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  2:39 Haipeng Lin via B4 Relay
2026-12-02  5:50 ` Manivannan Sadhasivam [this message]

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=179619065985.121678.2467009720191804582.b4-reply@b4 \
    --to=mani@kernel.org \
    --cc=daleyo@gmail.com \
    --cc=jeff.hugo@oss.qualcomm.com \
    --cc=jimmie.lin@gmail.com \
    --cc=johan@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®