]> git.ipfire.org Git - thirdparty/linux.git/commit
PCI: endpoint: pci-epf-vntb: Report 0-based doorbell vector via ntb_db_event()
authorKoichiro Den <den@valinux.co.jp>
Wed, 13 May 2026 02:49:14 +0000 (11:49 +0900)
committerBjorn Helgaas <bhelgaas@google.com>
Mon, 22 Jun 2026 20:31:11 +0000 (15:31 -0500)
commit91fb4488cd615a39360bc4160a10cb3236189ba1
treecec553686a225270803dbe00ab1428e5561f7622
parent18355c1e986582aaff2c488b1a2ce79bac8f3cf9
PCI: endpoint: pci-epf-vntb: Report 0-based doorbell vector via ntb_db_event()

ntb_db_event() expects the vector number to be relative to the first
doorbell vector starting at 0.

pci-epf-vntb reserves vector 0 for link events and uses higher vector
indices for doorbells. By passing the raw slot index to ntb_db_event(),
it effectively assumes that doorbell 0 maps to vector 1.

However, because the host uses a legacy slot layout and writes doorbell
0 into the third slot, doorbell 0 ultimately appears as vector 2 from
the NTB core perspective.

Adjust pci-epf-vntb to:

  - skip the unused second slot, and

  - report doorbells as 0-based vectors (DB#0 -> vector 0).

This change does not introduce a behavioral difference until
.db_vector_count()/.db_vector_mask() are implemented, because without
those callbacks NTB clients effectively ignore the vector number.

Fixes: e35f56bb0330 ("PCI: endpoint: Support NTB transfer between RC and EP")
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260513024923.451765-4-den@valinux.co.jp
drivers/pci/endpoint/functions/pci-epf-vntb.c