Skip to contentSkip to conversation

MHI changes for v6.8

GIT PULL Manivannan Sadhasivam 2 participants 2 messages Dec 18, 2023 – Dec 19, 2023 MHI bus

lore
Share & tools
lore
#0 lore raw

The following changes since commit b85ea95d086471afb4ad062012a4d73cd328fa86:

Linux 6.7-rc1 (2023-11-12 16:19:07 -0800)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi.git tags/mhi-for-v6.8

for you to fetch changes up to 01bd694ac2f682fb8017e16148b928482bc8fa4b:

bus: mhi: host: Drop chan lock before queuing buffers (2023-12-16 10:54:29 +0530)

----------------------------------------------------------------
MHI Host
========

- Added alignment check for event ring read pointer to avoid the potential buffer corruption issue.
- Added support for SDX75 modem which takes longer time to enter READY state.
- Added spinlock to protect concurrent access while queuing transfer ring elements.
- Dropped the read channel lock before invoking the client callback as the client can potentially queue buffers thus ending up wtih soft lockup.

MHI Endpoint
============

- Used kzalloc() to allocate event ring elements instead of allocating the elements on the stack, as the endpoint controller trying to queue them may not be able to use vmalloc memory (using DMA).
- Used slab allocator for allocting the memory for objects used frequently and are of fixed size.
- Added support for interrupt moderation timer feature which is used by the host to limit the number of interrupts raised by the device for an event ring.
- Added async read/write DMA support for transferring data between host and the endpoint. So far MHI EP stack assumed that the data will be transferred synchronously (i.e., it sends completion once the transfer APIs are returned). But this impacts the throughput if the controller is using DMA to do the transfer.

So to add async suport, existing sync transfer APIs are renamed to {read/write}_sync and also introduced two new APIs {read/write}_async for carrying out the async transfer.

Controllers implementing the async APIs should queue the buffers and return immediately without waiting for transfer completion. Once the transfer completion happens later, they should invoke the completion callback so that the MHI EP stack can send the completion event to the host.

The controller driver patches (PCI EPF) for this async support are also merged to the MHI tree with Acks from PCI maintainers.
- Fixed the DMA channel direction in error path of the PCI EPF driver.

----------------------------------------------------------------
Bhaumik Bhatt (1):
bus: mhi: host: Add spinlock to protect WP access when queueing TREs

Krishna chaitanya chundru (1):
bus: mhi: host: Add alignment check for event ring read pointer

Manivannan Sadhasivam (13):
bus: mhi: ep: Do not allocate event ring element on stack
bus: mhi: ep: Use slab allocator where applicable
bus: mhi: ep: Add support for interrupt moderation timer
bus: mhi: ep: Pass mhi_ep_buf_info struct to read/write APIs
bus: mhi: ep: Rename read_from_host() and write_to_host() APIs
bus: mhi: ep: Introduce async read/write callbacks
PCI: epf-mhi: Simulate async read/write using iATU
PCI: epf-mhi: Add support for DMA async read/write operation
PCI: epf-mhi: Enable MHI async read/write support
bus: mhi: ep: Add support for async DMA write operation
bus: mhi: ep: Add support for async DMA read operation
bus: mhi: ep: Add checks for read/write callbacks while registering controllers
PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single()

Qiang Yu (3):
bus: mhi: host: Add a separate timeout parameter for waiting ready
bus: mhi: host: pci_generic: Add SDX75 based modem support
bus: mhi: host: Drop chan lock before queuing buffers

 drivers/bus/mhi/ep/internal.h                |   4 ++
 drivers/bus/mhi/ep/main.c                    | 387 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------
 drivers/bus/mhi/ep/ring.c                    |  60 +++++++++++++++-------
 drivers/bus/mhi/host/init.c                  |   1 +
 drivers/bus/mhi/host/internal.h              |   2 +-
 drivers/bus/mhi/host/main.c                  |  34 +++++++-----
 drivers/bus/mhi/host/pci_generic.c           |  22 ++++++++
 drivers/bus/mhi/host/pm.c                    |  24 ++++++---
 drivers/pci/endpoint/functions/pci-epf-mhi.c | 314 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------
 include/linux/mhi.h                          |   4 ++
 include/linux/mhi_ep.h                       |  36 +++++++++++--
 11 files changed, 680 insertions(+), 208 deletions(-)
Signature · 1 line
மணிவண்ணன் சதாசிவம்
#1 lore raw
Quoted 7 lines · Manivannan Sadhasivam

The following changes since commit b85ea95d086471afb4ad062012a4d73cd328fa86:

Linux 6.7-rc1 (2023-11-12 16:19:07 -0800)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/mani/mhi.git tags/mhi-for-v6.8

Pulled and pushed out, thanks.

greg k-h