Skip to content

Add RC-to-EP doorbell with platform MSI controller

Frank Li imx linux-arm-kernel linux-devicetree linux-pci lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 29 repliesIn review
  2. v13 patches 17 repliesSuperseded

Changes in v2 from the cover letter

- Add missed patch for endpont/pci-epf-test.c
- Move alloc and free to epc driver from epf.
- Provide general help function for EPC driver to alloc platform msi irq.
- Fixed manivannan's comments.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5PCI: endpoint: Add RC-to-EP doorbell support using platform MSI controllerdrivers/pci/endpoint/pci-epc-core.c drivers/pci/endpoint/pci-epf-core.c include/linux/pci-epc.h +1 more+249 -011 replies
2/5PCI: dwc: add doorbell support by use MSI controllerdrivers/pci/controller/dwc/pcie-designware-ep.c+2 -00 replies
3/5PCI: endpoint: pci-epf-test: add doorbell testdrivers/pci/endpoint/functions/pci-epf-test.c+58 -13 replies
4/5misc: pci_endpoint_test: Add doorbell test casedrivers/misc/pci_endpoint_test.c include/uapi/linux/pcitest.h+49 -07 replies
5/5tools: PCI: Add 'B' option for test doorbelltools/pci/pcitest.c+15 -11 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/5] Add RC-to-EP doorbell with platform MSI controller
┌────────────┐   ┌───────────────────────────────────┐   ┌────────────────┐
│            │   │                                   │   │                │
│            │   │ PCI Endpoint                      │   │ PCI Host       │
│            │   │                                   │   │                │
│            │◄──┤ 1.platform_msi_domain_alloc_irqs()│   │                │
│            │   │                                   │   │                │
│ MSI        ├──►│ 2.write_msi_msg()                 ├──►├─BAR<n>         │
│ Controller │   │   update doorbell register address│   │                │
│            │   │   for BAR                         │   │                │
│            │   │                                   │   │ 3. Write BAR<n>│
│            │◄──┼───────────────────────────────────┼───┤                │
│            │   │                                   │   │                │
│            ├──►│ 4.Irq Handle                      │   │                │
│            │   │                                   │   │                │
│            │   │                                   │   │                │
└────────────┘   └───────────────────────────────────┘   └────────────────┘

This patches based on old https://lore.kernel.org/imx/[email protected]/

Original patch only target to vntb driver. But actually it is common method.

This patches add new API to pci-epf-core, so any EP driver can use it.

The key point is comments from Thomas Gleixner, who suggest use new PCI/IMS. But arm platform change still not be merged yet.

git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git devmsi-v2-arm

So I still use existed method implement RC to EP doorbell.

If Thomas Gleixner want to continue work on devmsi-v2-arm, I can help test and update this patch.

Change from v1 to v2
- Add missed patch for endpont/pci-epf-test.c
- Move alloc and free to epc driver from epf.
- Provide general help function for EPC driver to alloc platform msi irq.
- Fixed manivannan's comments.

Frank Li (5):
PCI: endpoint: Add RC-to-EP doorbell support using platform MSI
controller
PCI: dwc: add doorbell support by use MSI controller
PCI: endpoint: pci-epf-test: add doorbell test
misc: pci_endpoint_test: Add doorbell test case
tools: PCI: Add 'B' option for test doorbell

 drivers/misc/pci_endpoint_test.c              |  48 +++++
 .../pci/controller/dwc/pcie-designware-ep.c   |   2 +
 drivers/pci/endpoint/functions/pci-epf-test.c |  59 +++++-
 drivers/pci/endpoint/pci-epc-core.c           | 192 ++++++++++++++++++
 drivers/pci/endpoint/pci-epf-core.c           |  44 ++++
 include/linux/pci-epc.h                       |   6 +
 include/linux/pci-epf.h                       |   7 +
 include/uapi/linux/pcitest.h                  |   1 +
 tools/pci/pcitest.c                           |  16 +-
 9 files changed, 373 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1