]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: endpoint: Align pci_epc_get_msi(), pci_epc_ops::get_msi() return value encoding
authorNiklas Cassel <cassel@kernel.org>
Wed, 14 May 2025 07:43:16 +0000 (09:43 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 28 May 2025 21:47:56 +0000 (16:47 -0500)
commitf7f15fc53245385e39ef0aab4310d1682fd3c079
treefb61b05948cde47b47e7254bfb1c9cb189d4e1a9
parentc8bcb01352a86bc5592403904109c22b66bd916e
PCI: endpoint: Align pci_epc_get_msi(), pci_epc_ops::get_msi() return value encoding

The kdoc for API pci_epc_get_msi() says:
"Invoke to get the number of MSI interrupts allocated by the RC"

The kdoc for the callback pci_epc_ops::get_msi() says:
"ops to get the number of MSI interrupts allocated by the RC from
the MSI capability register"

pci_epc_ops::get_msi() does however return the number of interrupts in the
encoding as defined by the Multiple Message Enable (MME) field of the MSI
Capability structure.

Nowhere in the kdoc does it say that the returned number of interrupts is
in MME encoding. It is very confusing that the API pci_epc_get_msi() and
the callback function pci_epc_ops::get_msi() don't return the same value.

Clean up the API and the callback function to have the same semantics,
i.e. return the number of interrupts, regardless of the internal encoding
of that value.

[bhelgaas: more specific subject]

Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Cc: stable+noautosel@kernel.org # this is simply a cleanup
Link: https://patch.msgid.link/20250514074313.283156-11-cassel@kernel.org
drivers/pci/controller/cadence/pcie-cadence-ep.c
drivers/pci/controller/dwc/pcie-designware-ep.c
drivers/pci/controller/pcie-rcar-ep.c
drivers/pci/controller/pcie-rockchip-ep.c
drivers/pci/endpoint/pci-epc-core.c