Skip to content

Enable dma driver for MIC X100 Coprocessors

Sudeep Dutt lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 6 repliesIn review
  2. v28 patches 7 repliesSuperseded
  3. v18 patches 2 repliesSuperseded

Changes in v3 from the cover letter

a) MIC bus device private pointer cleanup as per feedback from Greg Kroah-Hartman.
b) Fixed minor Makefile conflict after rebasing to v3.16-rc2

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8misc: mic: Add mic bus and dma driver documentationDocumentation/mic/mic_overview.txt+41 -260 replies
2/8misc: mic: add a bus driver for virtual MIC devicesdrivers/misc/mic/Kconfig drivers/misc/mic/Makefile drivers/misc/mic/bus/Makefile +2 more+351 -04 replies
3/8dma: MIC X100 DMA Driverdrivers/dma/Kconfig drivers/dma/Makefile drivers/dma/mic_x100_dma.c +1 more+1080 -02 replies
4/8misc: mic: add threaded irq support in host driverdrivers/misc/mic/host/mic_intr.c drivers/misc/mic/host/mic_intr.h drivers/misc/mic/host/mic_main.c +1 more+96 -600 replies
5/8misc: mic: add dma support in host driverdrivers/misc/mic/Kconfig drivers/misc/mic/host/mic_boot.c drivers/misc/mic/host/mic_device.h +4 more+281 -410 replies
6/8misc: mic: add threaded irq support in card driverdrivers/misc/mic/card/mic_device.c drivers/misc/mic/card/mic_device.h drivers/misc/mic/card/mic_virtio.c+20 -150 replies
7/8misc: mic: add dma support in card driverdrivers/misc/mic/Kconfig drivers/misc/mic/card/mic_device.h drivers/misc/mic/card/mic_x100.c+61 -40 replies
8/8misc: mic: add support for loading/unloading dma driverDocumentation/mic/mpssd/mpss+7 -70 replies

Reviews trailers per patch

7 of 8 patches have a Reviewed-by or Acked-by.

PatchAshutosh DixitNikhil RaoSudeep Dutt
1/8R-b R-b R-b
2/8R-b R-b
3/8R-b R-b R-b
4/8R-b R-b R-b
5/8R-b
6/8R-b R-b R-b
7/8R-b
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v3 thread

Cover letter [PATCH char-misc-next v3 0/8] Enable dma driver for MIC X100 Coprocessors

ChangeLog:
=========
v2 => v3:
a) MIC bus device private pointer cleanup as per feedback from Greg Kroah-Hartman.
b) Fixed minor Makefile conflict after rebasing to v3.16-rc2

v1 => v2: https://lkml.org/lkml/2014/5/29/981
a) MIC bus driver cleanups and device release callback fix in patch 2, as per feedback from Greg Kroah-Hartman.

v1: Initial post @ https://lkml.org/lkml/2014/5/27/819

These patches are being sent to char-misc because there is a dependency between the patches for dma driver and other drivers.

Description:
============
This set of patches add support for MIC X100 dma driver.
MIC PCIe card has a dma controller with 8 channels. These channels are shared between the host s/w and the card s/w. 0 to 3 are used by host nd 4 to 7 by card. As the dma device doesn't show up as PCIe device, a virtual bus called mic bus is created and virtual dma devices are created on it by the host/card drivers. On host the channels are private and used only by the host driver to transfer data for the virtio devices.

Here is a higher level block diagram.

                                      |
               +----------+           |             +----------+
               | Card OS  |           |             | Host OS  |
               +----------+           |             +----------+
                                      |
        +-------+ +--------+ +------+ | +---------+  +--------+ +--------+
        | Virtio| |Virtio  | |Virtio| | |Virtio   |  |Virtio  | |Virtio  |
        | Net   | |Console | |Block | | |Net      |  |Console | |Block   |
        | Driver| |Driver  | |Driver| | |backend  |  |backend | |backend |
        +-------+ +--------+ +------+ | +---------+  +--------+ +--------+
            |         |         |     |      |            |         |
            |         |         |     |User  |            |         |
            |         |         |     |------|------------|---------|-------
            +-------------------+     |Kernel +--------------------------+
                      |               |       | Virtio over PCIe IOCTLs  |
                      |               |       +--------------------------+
+-----------+         |               |                   |  +-----------+
| MIC DMA   |         |               |                   |  | MIC DMA   |
| Driver    |         |               |                   |  | Driver    |
+-----------+         |               |                   |  +-----------+
      |               |               |                   |        |
+---------------+     |               |                   |  +----------------+
|MIC virtual Bus|     |               |                   |  |MIC virtual Bus |
+---------------+     |               |                   |  +----------------+
      |               |               |                   |              |
      |   +--------------+            |            +---------------+     |
      |   |Intel MIC     |            |            |Intel MIC      |     |
      +---|Card Driver   |            |            |Host Driver    |     |
          +--------------+            |            +---------------+-----+
                      |               |                   |
             +-------------------------------------------------------------+
             |                                                             |
             |                    PCIe Bus                                 |
             +-------------------------------------------------------------+

The following series of patches are partitioned as follows:

Patch 1: Add mic bus and dma driver documentation. Patch 2: Add a bus driver for virtual MIC devices. Patch 3: MIC X100 DMA Driver.
Patch 4: Add threaded irq support in host driver.
This is needed as the dma driver uses threaded irq.
Patch 5: Use dma to transfer data between MIC and host.
Authors: Siva Yerramreddy, Ashutosh Dixit
Patch 6: Add threaded irq support in mic_request_card_irq.
This is needed as the dma driver uses threaded irq.
Patch 7: Add dma device on mic bus.
Patch 8: Modify the mpss script to load/unload mic_x100_dma.ko.

The patches have been compiled/validated against v3.16-rc2. Tested using dmatest module with module parameter "threads_per_chan=60". These patches have also been scanned by Fengguang Wu's 0-day infrastructure and no issues have been reported.

Thanks to Dan Williams, Vinod Koul, Jon Mason, Dave Jiang for the initial review.

Siva Yerramreddy (7):
misc: mic: Add mic bus and dma driver documentation
dma: MIC X100 DMA Driver
misc: mic: add threaded irq support in host driver
misc: mic: add dma support in host driver
misc: mic: add threaded irq support in card driver
misc: mic: add dma support in card driver
misc: mic: add support for loading/unloading dma driver

Sudeep Dutt (1):
misc: mic: add a bus driver for virtual MIC devices

 Documentation/mic/mic_overview.txt |  67 ++--
 Documentation/mic/mpssd/mpss       |  14 +-
 drivers/dma/Kconfig                |  19 +
 drivers/dma/Makefile               |   1 +
 drivers/dma/mic_x100_dma.c         | 774 +++++++++++++++++++++++++++++++++++++
 drivers/dma/mic_x100_dma.h         | 286 ++++++++++++++
 drivers/misc/mic/Kconfig           |  21 +-
 drivers/misc/mic/Makefile          |   1 +
 drivers/misc/mic/bus/Makefile      |   5 +
 drivers/misc/mic/bus/mic_bus.c     | 218 +++++++++++
 drivers/misc/mic/card/mic_device.c |  23 +-
 drivers/misc/mic/card/mic_device.h |   9 +-
 drivers/misc/mic/card/mic_virtio.c |   7 +-
 drivers/misc/mic/card/mic_x100.c   |  55 ++-
 drivers/misc/mic/host/mic_boot.c   |  83 +++-
 drivers/misc/mic/host/mic_device.h |  24 ++
 drivers/misc/mic/host/mic_intr.c   | 121 +++---
 drivers/misc/mic/host/mic_intr.h   |  27 +-
 drivers/misc/mic/host/mic_main.c   |   5 +-
 drivers/misc/mic/host/mic_virtio.c | 187 +++++++--
 drivers/misc/mic/host/mic_virtio.h |  21 +-
 drivers/misc/mic/host/mic_x100.c   |   8 +
 include/linux/mic_bus.h            | 110 ++++++
 23 files changed, 1935 insertions(+), 151 deletions(-)
 create mode 100644 drivers/dma/mic_x100_dma.c
 create mode 100644 drivers/dma/mic_x100_dma.h
 create mode 100644 drivers/misc/mic/bus/Makefile
 create mode 100644 drivers/misc/mic/bus/mic_bus.c
 create mode 100644 include/linux/mic_bus.h
Signature · 1 line
1.8.2.1