Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'mhi-for-v6.11' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mani/mhi into char-misc-next

Manivannan writes:

MHI Host
========

- Used unique 'mhi_pci_dev_info' struct for product families instead of reusing
a shared struct. This allows displaying the actual product name for the MHI
devices during driver probe.

- Added support for Foxconn SDX72 based modems, T99W515 and DW5934E.

- Added a 'name' field to 'struct mhi_controller' for allowing the MHI client
drivers to uniquely identify each MHI device based on its product/device name.
This is useful in applying any device specific quirks in the client drivers.

WWAN MHI Client driver
======================

- Due to the build dependency with the MHI patch exposing 'name' field to client
drivers, the WWAN MHI client driver patch that is making use of the 'name'
field to apply custom data mux id for Foxconn modems is also included.
Collected Ack from Networking maintainer for this patch.

MHI EP
======

- Fixed the MHI EP stack to not allocate memory for MHI objects from DMA zone.
This was done accidentally while adding the slab cache support and causes the
MHI EP stack to run out of memory while doing high bandwidth transfers.

* tag 'mhi-for-v6.11' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mani/mhi:
net: wwan: mhi: make default data link id configurable
bus: mhi: host: Allow controller drivers to specify name for the MHI controller
bus: mhi: host: Add support for Foxconn SDX72 modems
bus: mhi: host: pci_generic: Use unique 'mhi_pci_dev_info' for product families
bus: mhi: ep: Do not allocate memory for MHI objects from DMA zone

+131 -31
+7 -7
drivers/bus/mhi/ep/main.c
··· 90 90 struct mhi_ring_element *event; 91 91 int ret; 92 92 93 - event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA); 93 + event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL); 94 94 if (!event) 95 95 return -ENOMEM; 96 96 ··· 109 109 struct mhi_ring_element *event; 110 110 int ret; 111 111 112 - event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA); 112 + event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL); 113 113 if (!event) 114 114 return -ENOMEM; 115 115 ··· 127 127 struct mhi_ring_element *event; 128 128 int ret; 129 129 130 - event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA); 130 + event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL); 131 131 if (!event) 132 132 return -ENOMEM; 133 133 ··· 146 146 struct mhi_ring_element *event; 147 147 int ret; 148 148 149 - event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL | GFP_DMA); 149 + event = kmem_cache_zalloc(mhi_cntrl->ev_ring_el_cache, GFP_KERNEL); 150 150 if (!event) 151 151 return -ENOMEM; 152 152 ··· 438 438 read_offset = mhi_chan->tre_size - mhi_chan->tre_bytes_left; 439 439 write_offset = len - buf_left; 440 440 441 - buf_addr = kmem_cache_zalloc(mhi_cntrl->tre_buf_cache, GFP_KERNEL | GFP_DMA); 441 + buf_addr = kmem_cache_zalloc(mhi_cntrl->tre_buf_cache, GFP_KERNEL); 442 442 if (!buf_addr) 443 443 return -ENOMEM; 444 444 ··· 1481 1481 1482 1482 mhi_cntrl->ev_ring_el_cache = kmem_cache_create("mhi_ep_event_ring_el", 1483 1483 sizeof(struct mhi_ring_element), 0, 1484 - SLAB_CACHE_DMA, NULL); 1484 + 0, NULL); 1485 1485 if (!mhi_cntrl->ev_ring_el_cache) { 1486 1486 ret = -ENOMEM; 1487 1487 goto err_free_cmd; 1488 1488 } 1489 1489 1490 1490 mhi_cntrl->tre_buf_cache = kmem_cache_create("mhi_ep_tre_buf", MHI_EP_DEFAULT_MTU, 0, 1491 - SLAB_CACHE_DMA, NULL); 1491 + 0, NULL); 1492 1492 if (!mhi_cntrl->tre_buf_cache) { 1493 1493 ret = -ENOMEM; 1494 1494 goto err_destroy_ev_ring_el_cache;
+106 -22
drivers/bus/mhi/host/pci_generic.c
··· 399 399 MHI_CHANNEL_CONFIG_DL(13, "MBIM", 32, 0), 400 400 MHI_CHANNEL_CONFIG_UL(32, "DUN", 32, 0), 401 401 MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0), 402 + MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0), 403 + MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0), 402 404 MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0_MBIM", 128, 2), 403 405 MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3), 404 406 }; ··· 421 419 .event_cfg = mhi_foxconn_sdx55_events, 422 420 }; 423 421 424 - static const struct mhi_pci_dev_info mhi_foxconn_sdx24_info = { 425 - .name = "foxconn-sdx24", 426 - .config = &modem_foxconn_sdx55_config, 427 - .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 428 - .dma_data_width = 32, 429 - .mru_default = 32768, 430 - .sideband_wake = false, 422 + static const struct mhi_controller_config modem_foxconn_sdx72_config = { 423 + .max_channels = 128, 424 + .timeout_ms = 20000, 425 + .ready_timeout_ms = 50000, 426 + .num_channels = ARRAY_SIZE(mhi_foxconn_sdx55_channels), 427 + .ch_cfg = mhi_foxconn_sdx55_channels, 428 + .num_events = ARRAY_SIZE(mhi_foxconn_sdx55_events), 429 + .event_cfg = mhi_foxconn_sdx55_events, 431 430 }; 432 431 433 432 static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = { ··· 442 439 .sideband_wake = false, 443 440 }; 444 441 445 - static const struct mhi_pci_dev_info mhi_foxconn_sdx65_info = { 446 - .name = "foxconn-sdx65", 442 + static const struct mhi_pci_dev_info mhi_foxconn_t99w175_info = { 443 + .name = "foxconn-t99w175", 444 + .fw = "qcom/sdx55m/sbl1.mbn", 445 + .edl = "qcom/sdx55m/edl.mbn", 447 446 .config = &modem_foxconn_sdx55_config, 447 + .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 448 + .dma_data_width = 32, 449 + .mru_default = 32768, 450 + .sideband_wake = false, 451 + }; 452 + 453 + static const struct mhi_pci_dev_info mhi_foxconn_dw5930e_info = { 454 + .name = "foxconn-dw5930e", 455 + .fw = "qcom/sdx55m/sbl1.mbn", 456 + .edl = "qcom/sdx55m/edl.mbn", 457 + .config = &modem_foxconn_sdx55_config, 458 + .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 459 + .dma_data_width = 32, 460 + .mru_default = 32768, 461 + .sideband_wake = false, 462 + }; 463 + 464 + static const struct mhi_pci_dev_info mhi_foxconn_t99w368_info = { 465 + .name = "foxconn-t99w368", 466 + .config = &modem_foxconn_sdx55_config, 467 + .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 468 + .dma_data_width = 32, 469 + .mru_default = 32768, 470 + .sideband_wake = false, 471 + }; 472 + 473 + static const struct mhi_pci_dev_info mhi_foxconn_t99w373_info = { 474 + .name = "foxconn-t99w373", 475 + .config = &modem_foxconn_sdx55_config, 476 + .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 477 + .dma_data_width = 32, 478 + .mru_default = 32768, 479 + .sideband_wake = false, 480 + }; 481 + 482 + static const struct mhi_pci_dev_info mhi_foxconn_t99w510_info = { 483 + .name = "foxconn-t99w510", 484 + .config = &modem_foxconn_sdx55_config, 485 + .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 486 + .dma_data_width = 32, 487 + .mru_default = 32768, 488 + .sideband_wake = false, 489 + }; 490 + 491 + static const struct mhi_pci_dev_info mhi_foxconn_dw5932e_info = { 492 + .name = "foxconn-dw5932e", 493 + .config = &modem_foxconn_sdx55_config, 494 + .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 495 + .dma_data_width = 32, 496 + .mru_default = 32768, 497 + .sideband_wake = false, 498 + }; 499 + 500 + static const struct mhi_pci_dev_info mhi_foxconn_t99w515_info = { 501 + .name = "foxconn-t99w515", 502 + .edl = "fox/sdx72m/edl.mbn", 503 + .edl_trigger = true, 504 + .config = &modem_foxconn_sdx72_config, 505 + .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 506 + .dma_data_width = 32, 507 + .mru_default = 32768, 508 + .sideband_wake = false, 509 + }; 510 + 511 + static const struct mhi_pci_dev_info mhi_foxconn_dw5934e_info = { 512 + .name = "foxconn-dw5934e", 513 + .edl = "fox/sdx72m/edl.mbn", 514 + .edl_trigger = true, 515 + .config = &modem_foxconn_sdx72_config, 448 516 .bar_num = MHI_PCI_DEFAULT_BAR_NUM, 449 517 .dma_data_width = 32, 450 518 .mru_default = 32768, ··· 720 646 .driver_data = (kernel_ulong_t) &mhi_quectel_em1xx_info }, 721 647 /* T99W175 (sdx55), Both for eSIM and Non-eSIM */ 722 648 { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0ab), 723 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, 649 + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w175_info }, 724 650 /* DW5930e (sdx55), With eSIM, It's also T99W175 */ 725 651 { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0b0), 726 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, 652 + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5930e_info }, 727 653 /* DW5930e (sdx55), Non-eSIM, It's also T99W175 */ 728 654 { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0b1), 729 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, 655 + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5930e_info }, 730 656 /* T99W175 (sdx55), Based on Qualcomm new baseline */ 731 657 { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0bf), 732 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, 658 + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w175_info }, 733 659 /* T99W175 (sdx55) */ 734 660 { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0c3), 735 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, 661 + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w175_info }, 736 662 /* T99W368 (sdx65) */ 737 663 { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0d8), 738 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx65_info }, 664 + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w368_info }, 739 665 /* T99W373 (sdx62) */ 740 666 { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0d9), 741 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx65_info }, 667 + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w373_info }, 742 668 /* T99W510 (sdx24), variant 1 */ 743 669 { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f0), 744 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx24_info }, 670 + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w510_info }, 745 671 /* T99W510 (sdx24), variant 2 */ 746 672 { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f1), 747 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx24_info }, 673 + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w510_info }, 748 674 /* T99W510 (sdx24), variant 3 */ 749 675 { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f2), 750 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx24_info }, 676 + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w510_info }, 751 677 /* DW5932e-eSIM (sdx62), With eSIM */ 752 678 { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f5), 753 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx65_info }, 679 + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5932e_info }, 754 680 /* DW5932e (sdx62), Non-eSIM */ 755 681 { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe0f9), 756 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx65_info }, 682 + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5932e_info }, 683 + /* T99W515 (sdx72) */ 684 + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe118), 685 + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w515_info }, 686 + /* DW5934e(sdx72), With eSIM */ 687 + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11d), 688 + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info }, 689 + /* DW5934e(sdx72), Non-eSIM */ 690 + { PCI_DEVICE(PCI_VENDOR_ID_FOXCONN, 0xe11e), 691 + .driver_data = (kernel_ulong_t) &mhi_foxconn_dw5934e_info }, 757 692 /* MV31-W (Cinterion) */ 758 693 { PCI_DEVICE(PCI_VENDOR_ID_THALES, 0x00b3), 759 694 .driver_data = (kernel_ulong_t) &mhi_mv31_info }, ··· 777 694 .driver_data = (kernel_ulong_t) &mhi_mv32_info }, 778 695 /* T99W175 (sdx55), HP variant */ 779 696 { PCI_DEVICE(0x03f0, 0x0a6c), 780 - .driver_data = (kernel_ulong_t) &mhi_foxconn_sdx55_info }, 697 + .driver_data = (kernel_ulong_t) &mhi_foxconn_t99w175_info }, 781 698 { } 782 699 }; 783 700 MODULE_DEVICE_TABLE(pci, mhi_pci_id_table); ··· 1086 1003 mhi_cntrl->runtime_get = mhi_pci_runtime_get; 1087 1004 mhi_cntrl->runtime_put = mhi_pci_runtime_put; 1088 1005 mhi_cntrl->mru = info->mru_default; 1006 + mhi_cntrl->name = info->name; 1089 1007 1090 1008 if (info->edl_trigger) 1091 1009 mhi_cntrl->edl_trigger = mhi_pci_generic_edl_trigger;
+16 -2
drivers/net/wwan/mhi_wwan_mbim.c
··· 42 42 #define MHI_MBIM_LINK_HASH_SIZE 8 43 43 #define LINK_HASH(session) ((session) % MHI_MBIM_LINK_HASH_SIZE) 44 44 45 + #define WDS_BIND_MUX_DATA_PORT_MUX_ID 112 46 + 45 47 struct mhi_mbim_link { 46 48 struct mhi_mbim_context *mbim; 47 49 struct net_device *ndev; ··· 93 91 } 94 92 95 93 return NULL; 94 + } 95 + 96 + static int mhi_mbim_get_link_mux_id(struct mhi_controller *cntrl) 97 + { 98 + if (strcmp(cntrl->name, "foxconn-dw5934e") == 0 || 99 + strcmp(cntrl->name, "foxconn-t99w515") == 0) 100 + return WDS_BIND_MUX_DATA_PORT_MUX_ID; 101 + 102 + return 0; 96 103 } 97 104 98 105 static struct sk_buff *mbim_tx_fixup(struct sk_buff *skb, unsigned int session, ··· 607 596 { 608 597 struct mhi_controller *cntrl = mhi_dev->mhi_cntrl; 609 598 struct mhi_mbim_context *mbim; 610 - int err; 599 + int err, link_id; 611 600 612 601 mbim = devm_kzalloc(&mhi_dev->dev, sizeof(*mbim), GFP_KERNEL); 613 602 if (!mbim) ··· 628 617 /* Number of transfer descriptors determines size of the queue */ 629 618 mbim->rx_queue_sz = mhi_get_free_desc_count(mhi_dev, DMA_FROM_DEVICE); 630 619 620 + /* Get the corresponding mux_id from mhi */ 621 + link_id = mhi_mbim_get_link_mux_id(cntrl); 622 + 631 623 /* Register wwan link ops with MHI controller representing WWAN instance */ 632 - return wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_mbim_wwan_ops, mbim, 0); 624 + return wwan_register_ops(&cntrl->mhi_dev->dev, &mhi_mbim_wwan_ops, mbim, link_id); 633 625 } 634 626 635 627 static void mhi_mbim_remove(struct mhi_device *mhi_dev)
+2
include/linux/mhi.h
··· 290 290 291 291 /** 292 292 * struct mhi_controller - Master MHI controller structure 293 + * @name: Device name of the MHI controller 293 294 * @cntrl_dev: Pointer to the struct device of physical bus acting as the MHI 294 295 * controller (required) 295 296 * @mhi_dev: MHI device instance for the controller ··· 368 367 * they can be populated depending on the usecase. 369 368 */ 370 369 struct mhi_controller { 370 + const char *name; 371 371 struct device *cntrl_dev; 372 372 struct mhi_device *mhi_dev; 373 373 struct dentry *debugfs_dentry;