linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v12 0/5] userspace MHI client interface driver
@ 2020-11-16 22:46 Hemant Kumar
  2020-11-16 22:46 ` [PATCH v12 1/5] bus: mhi: core: Add helper API to return number of free TREs Hemant Kumar
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Hemant Kumar @ 2020-11-16 22:46 UTC (permalink / raw)
  To: manivannan.sadhasivam, gregkh
  Cc: linux-arm-msm, linux-kernel, jhugo, bbhatt, loic.poulain, netdev,
	skhan, Hemant Kumar

This patch series adds support for UCI driver. UCI driver enables userspace
clients to communicate to external MHI devices like modem and WLAN. UCI driver
probe creates standard character device file nodes for userspace clients to
perform open, read, write, poll and release file operations. These file
operations call MHI core layer APIs to perform data transfer using MHI bus
to communicate with MHI device. It also adds a loopback test application to
verify the UCI LOOPBACK channel. Patch is tested using arm64 based platform.

V12:
- Added loopback test driver under selftest/drivers/mhi. Updated kernel
  documentation for the usage of the loopback test application.
- Addressed review comments for renaming variable names, updated inline
  comments and removed two redundant dev_dbg.

V11:
- Fixed review comments for UCI documentation by expanding TLAs and rewording
  some sentences.

V10:
- Replaced mutex_lock with mutex_lock_interruptible in read() and write() file
  ops call back.

V9:
- Renamed dl_lock to dl_pending _lock and pending list to dl_pending for
  clarity.
- Used read lock to protect cur_buf.
- Change transfer status check logic and only consider 0 and -EOVERFLOW as
  only success.
- Added __int to module init function.
- Print channel name instead of minor number upon successful probe.

V8:
- Fixed kernel test robot compilation error by changing %lu to %zu for
  size_t.
- Replaced uci with UCI in Kconfig, commit text, and comments in driver
  code.
- Fixed minor style related comments.

V7:
- Decoupled uci device and uci channel objects. uci device is
  associated with device file node. uci channel is associated
  with MHI channels. uci device refers to uci channel to perform
  MHI channel operations for device file operations like read()
  and write(). uci device increments its reference count for
  every open(). uci device calls mhi_uci_dev_start_chan() to start
  the MHI channel. uci channel object is tracking number of times
  MHI channel is referred. This allows to keep the MHI channel in
  start state until last release() is called. After that uci channel
  reference count goes to 0 and uci channel clean up is performed
  which stops the MHI channel. After the last call to release() if
  driver is removed uci reference count becomes 0 and uci object is
  cleaned up.
- Use separate uci channel read and write lock to fine grain locking
  between reader and writer.
- Use uci device lock to synchronize open, release and driver remove.
- Optimize for downlink only or uplink only UCI device.

V6:
- Moved uci.c to mhi directory.
- Updated Kconfig to add module information.
- Updated Makefile to rename uci object file name as mhi_uci
- Removed kref for open count

V5:
- Removed mhi_uci_drv structure.
- Used idr instead of creating global list of uci devices.
- Used kref instead of local ref counting for uci device and
  open count.
- Removed unlikely macro.

V4:
- Fix locking to protect proper struct members.
- Updated documentation describing uci client driver use cases.
- Fixed uci ref counting in mhi_uci_open for error case.
- Addressed style related review comments.

V3: Added documentation for MHI UCI driver.

V2:
- Added mutex lock to prevent multiple readers to access same
- mhi buffer which can result into use after free.

Hemant Kumar (5):
  bus: mhi: core: Add helper API to return number of free TREs
  bus: mhi: core: Move MHI_MAX_MTU to external header file
  docs: Add documentation for userspace client interface
  bus: mhi: Add userspace client interface driver
  selftest: mhi: Add support to test MHI LOOPBACK channel

 Documentation/mhi/index.rst                        |   1 +
 Documentation/mhi/uci.rst                          | 109 +++
 drivers/bus/mhi/Kconfig                            |  13 +
 drivers/bus/mhi/Makefile                           |   3 +
 drivers/bus/mhi/core/internal.h                    |   1 -
 drivers/bus/mhi/core/main.c                        |  12 +
 drivers/bus/mhi/uci.c                              | 667 +++++++++++++++++
 include/linux/mhi.h                                |  12 +
 tools/testing/selftests/Makefile                   |   1 +
 tools/testing/selftests/drivers/.gitignore         |   1 +
 tools/testing/selftests/drivers/mhi/Makefile       |   8 +
 tools/testing/selftests/drivers/mhi/config         |   2 +
 .../testing/selftests/drivers/mhi/loopback_test.c  | 789 +++++++++++++++++++++
 13 files changed, 1618 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/mhi/uci.rst
 create mode 100644 drivers/bus/mhi/uci.c
 create mode 100644 tools/testing/selftests/drivers/mhi/Makefile
 create mode 100644 tools/testing/selftests/drivers/mhi/config
 create mode 100644 tools/testing/selftests/drivers/mhi/loopback_test.c

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-11-28 21:58 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-16 22:46 [PATCH v12 0/5] userspace MHI client interface driver Hemant Kumar
2020-11-16 22:46 ` [PATCH v12 1/5] bus: mhi: core: Add helper API to return number of free TREs Hemant Kumar
2020-11-18  9:32   ` Loic Poulain
2020-11-28  6:29     ` Manivannan Sadhasivam
2020-11-28  8:05       ` Greg Kroah-Hartman
2020-11-16 22:46 ` [PATCH v12 2/5] bus: mhi: core: Move MHI_MAX_MTU to external header file Hemant Kumar
2020-11-16 22:46 ` [PATCH v12 3/5] docs: Add documentation for userspace client interface Hemant Kumar
2020-11-16 22:46 ` [PATCH v12 4/5] bus: mhi: Add userspace client interface driver Hemant Kumar
2020-11-26  9:31   ` Loic Poulain
2020-11-16 22:46 ` [PATCH v12 5/5] selftest: mhi: Add support to test MHI LOOPBACK channel Hemant Kumar
2020-11-17 14:52   ` Loic Poulain
2020-11-20  6:10   ` Manivannan Sadhasivam
2020-11-21  3:18     ` Hemant Kumar
2020-11-20 15:26   ` Shuah Khan
2020-11-21  3:44     ` Hemant Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).