From: Slark Xiao slark_xiao@163.com
[ Upstream commit 376358bb9770e5313d22d8784511497096cdb75f ]
Since there are too many variants available for Foxconn T99W696 modem, and they all share the same configuration, use PCI_ANY_ID as the subsystem device ID to match each possible SKUs and support all of them.
Signed-off-by: Slark Xiao slark_xiao@163.com [mani: reworded subject/description and dropped the fixes tag] Signed-off-by: Manivannan Sadhasivam manivannan.sadhasivam@oss.qualcomm.com Link: https://patch.msgid.link/20250819020013.122162-1-slark_xiao@163.com Signed-off-by: Sasha Levin sashal@kernel.org ---
LLM Generated explanations, may be completely bogus:
YES
- What changed: The PCI ID table in `drivers/bus/mhi/host/pci_generic.c` broadens Foxconn T99W696 matching by replacing several hardcoded subsystem device IDs with a single entry that uses `PCI_ANY_ID` for the subsystem device: - New entry: `drivers/bus/mhi/host/pci_generic.c:929` - `{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, PCI_VENDOR_ID_FOXCONN, PCI_ANY_ID), .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w696_info },` - This consolidates prior SKU-specific entries (e.g., `0xe142`, `0xe143`, `0xe144`, `0xe145`, `0xe146`) into one match-all line for the same device family. The result is that all Foxconn T99W696 variants with QCOM vendor `0x0308` and subsystem vendor `FOXCONN` will match the correct device data.
- Why this matters for users: All those SKUs use the same MHI configuration data, `mhi_foxconn_t99w696_info`: - `drivers/bus/mhi/host/pci_generic.c:655` defines `mhi_foxconn_t99w696_info` which points to `modem_foxconn_sdx61_config` and includes the expected channels (including NMEA) and event config appropriate for these modems. - Without the change, unlisted T99W696 SKUs can fall back to the generic SDX65 entry directly below (`drivers/bus/mhi/host/pci_generic.c:931`), mapping to `mhi_qcom_sdx65_info` (`drivers/bus/mhi/host/pci_generic.c:403`), which may not expose the Foxconn-specific channel layout (e.g., NMEA), leading to reduced functionality or improper operation.
- Scope and risk: - Small and contained: It only adjusts one entry in the ID table; no logic, APIs, or structures change. The probe path remains identical; `mhi_pci_probe()` consumes `id->driver_data` to select the controller config (`drivers/bus/mhi/host/pci_generic.c:1298`), and `mhi_pci_driver.id_table` uses this table (`drivers/bus/mhi/host/pci_generic.c:1700`). - Constrained matching: The broadened match still requires `(vendor=QCOM, device=0x0308, subsystem_vendor=FOXCONN)`. It does not affect other vendors or non-Foxconn subsystems. It simply captures additional T99W696 SKUs that share the same configuration. - Ordering is correct: The Foxconn-specific match precedes the generic `PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0308)` entry (`drivers/bus/mhi/host/pci_generic.c:931`), ensuring Foxconn SKUs bind to the correct `mhi_foxconn_t99w696_info` rather than the generic SDX65 config. - Regression risk is minimal: This is a classic ID-table-only enablement that widens support for hardware already handled by the driver with identical configuration; it neither introduces new features nor changes driver behavior for existing matched devices.
- Stable criteria assessment: - Fixes a user-visible issue: Ensures more T99W696 SKUs bind to the correct configuration instead of a generic one. - Minimal and localized: One table entry; no architectural or behavioral changes beyond matching. - No side effects beyond fixing the match coverage for a confined subsystem (MHI PCI host). - While there is no explicit “Cc: stable@” tag, this kind of ID-table expansion to enable existing hardware is standard and low-risk for stable backports.
Conclusion: This is a low-risk, ID-only match fix that improves hardware support for users with additional Foxconn T99W696 SKUs. It should be backported.
drivers/bus/mhi/host/pci_generic.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c index 4edb5bb476baf..4564e2528775e 100644 --- a/drivers/bus/mhi/host/pci_generic.c +++ b/drivers/bus/mhi/host/pci_generic.c @@ -917,20 +917,8 @@ static const struct pci_device_id mhi_pci_id_table[] = { /* Telit FE990A */ { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, 0x1c5d, 0x2015), .driver_data = (kernel_ulong_t) &mhi_telit_fe990a_info }, - /* Foxconn T99W696.01, Lenovo Generic SKU */ - { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, PCI_VENDOR_ID_FOXCONN, 0xe142), - .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w696_info }, - /* Foxconn T99W696.02, Lenovo X1 Carbon SKU */ - { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, PCI_VENDOR_ID_FOXCONN, 0xe143), - .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w696_info }, - /* Foxconn T99W696.03, Lenovo X1 2in1 SKU */ - { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, PCI_VENDOR_ID_FOXCONN, 0xe144), - .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w696_info }, - /* Foxconn T99W696.04, Lenovo PRC SKU */ - { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, PCI_VENDOR_ID_FOXCONN, 0xe145), - .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w696_info }, - /* Foxconn T99W696.00, Foxconn SKU */ - { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, PCI_VENDOR_ID_FOXCONN, 0xe146), + /* Foxconn T99W696, all variants */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0308, PCI_VENDOR_ID_FOXCONN, PCI_ANY_ID), .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w696_info }, { PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0308), .driver_data = (kernel_ulong_t) &mhi_qcom_sdx65_info },