From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796190667; b=2N78NVHRNt+nFFh6x//zq3iD5Vi6gFFr0Put7ahh4LDyQ5FseVZfgeGy/S7mFqkk3+3H XNg425fM6aSzt1Hv2rzMuBi6CNunzRlG4e7mgahxvLxtbDiffp1wUQSLMS5TzhsKi7EvS 6dKmpsDUMhP8vuo5R4yBQpp4eEIO7maLwqjL+5s4Z9q1nDeA/QqUrPglyebavLpr3vC49 5KDMmtBIvCGixhBVaeyQGyNLok425pwtG1kmzD/1B8bQuQy8SFGFq93luVH9ZFOUjfD/K IjXpLj4mPtJYO6yJ4Dn+cJubXaOnlFo35PF7SuKexZXZ2Pd04A2Yb/ScQlhFofPGlng== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796190667; h=Received:DKIM-Signature:MIME-Version:Content-Type: Content-Transfer-Encoding:Subject:From:To:Cc:In-Reply-To:References: Date:Message-Id:X-Mailer:X-Developer-Signature:X-Developer-Key; bh=RhDWhZSUEr7wlqZZiHzRqWBQfjzOCRND6t8eq+9z7bI=; b=XVAYsZnuTboWbUKNWJez/+E7wlieyyS/g/pMDbbZ3miGSnEexoAv9N7NZqWjsdHeq0me qpV8xSVhCiYom/fK3VDChQBgDkLnfcQsymDrfWibGwfH0YxSnmUTyaYUZpekY8d2UoTTc nCzRlhGq6WanRRvfmnU/JPv4ub5sZYXw47JVl+8kESEOOwQ1zz3akin8QbzaG7Odzayhh ReTxevI2Flr0C4O+X3RVT6fv6gEV6wUcVNPej/+yP3063uYew2YmpRxv8NCcbs3fpZ3AC f2huqbAsA/XVGyWrrCQbo/1yreX3b2OD836rw6CCawgB/FoA5IfeHCl40gE6ZDPWR3A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QlBLmBcR; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 358ED606A331; Wed, 2 Dec 2026 05:51:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=QlBLmBcR Received: by smtp.kernel.org (Postfix) with ESMTPSA id 379FA1F000C1; Wed, 2 Dec 2026 05:51:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796190666; bh=RhDWhZSUEr7wlqZZiHzRqWBQfjzOCRND6t8eq+9z7bI=; h=Subject:From:To:Cc:In-Reply-To:References:Date; b=QlBLmBcR3j8glw9UThALVig9vHWjAw714hNq1QHOD317z24oaDwx6QkxnRtmxpggA PGAPOJ6vuDw64qXX3UzBaXBhWn8Imdf3qlIekmJQ3+0onRTiSkea38+kPS3kCrJWhH ud3IailLdrMBLLcSuefayssXhEFCOOXaSIgDDZReVSwRW9F/sFdYfmg+nZP6ZBpDPV Aitt2Rh0kWrsYrt3wUsijO2C6EqX7etdO0tyke279mq0ggBmIWNs15NChvO+wjRqSH JR7bFxgoP+YeZQeAWB6nc0N+dBefDfdU20Ct0kFLi8fJV4/9zWsbEfAZrQARoLq2PP m9ntmwRPb6iyw== X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: Re: [PATCH v4] bus: mhi: host: pci_generic: Add MBIM-mode config for generic SDX65 From: Manivannan Sadhasivam To: Haipeng Lin Cc: Manivannan Sadhasivam , Jeff Hugo , mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, daleyo@gmail.com, Johan Hovold , linux-kernel@vger.kernel.org In-Reply-To: <20261201-mhi-sdx65-mbim-rfc-v4-1-8dbf4ae54083@gmail.com> References: <20261201-mhi-sdx65-mbim-rfc-v4-1-8dbf4ae54083@gmail.com> Date: Wed, 02 Dec 2026 11:20:59 +0530 Message-Id: <179619065985.121678.2467009720191804582.b4-reply@b4> X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6154; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=KM6HEXJIIiPuJE2mcfc0DrAZ3lyCq9dgWY9IuSEe998=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBrD7HHAxANKqEJ70wNEGWN1NUWpM2XZt2l6KVLt jrUsXtywBOJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCaw+xxwAKCRBVnxHm/pHO 9bDPB/0dUd0Ryrhoq2uBqlKwbqBbfQ+Dcl0E+4QP+MG6IPlayK7Km2tbOKxjuIRXkQkKY1gFPzU 8jDeMDkcNf2zbaMLlj8ySmtsZ/B6Zdoe+pSA0dGb1ijIjZ7bfT/HRM/R2mSEutx55dxm/+WUtxM RCh3Rnz90b1QXm0BffOKAAl9tGn/aDP/gi/CGRTwc375YS/YAe/KeR7npzeRY4GC87PKaoABKlM 5quY+Ur4VORFAMAtGNw+HWUWeMoqjHRx0vkA0/27tjb9iS9+3PZhwujjCha9uTrcnuj83nO46Vf mQJ2rJ6ASEpSnTezV3m+httWUcWgcd0cuR3w9qmOgVHiBTZG X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 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 > Signed-off-by: Haipeng Lin > --- > 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 > #include > +#include > #include > #include > #include > @@ -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