diff options
| author | Niklas Cassel <[email protected]> | 2025-05-14 07:43:16 +0000 |
|---|---|---|
| committer | Bjorn Helgaas <[email protected]> | 2025-05-28 21:47:56 +0000 |
| commit | f7f15fc53245385e39ef0aab4310d1682fd3c079 (patch) | |
| tree | fb61b05948cde47b47e7254bfb1c9cb189d4e1a9 /drivers/pci/controller/pcie-rcar-ep.c | |
| parent | PCI: cadence-ep: Correct PBA offset in .set_msix() callback (diff) | |
| download | kernel-f7f15fc53245385e39ef0aab4310d1682fd3c079.tar.gz kernel-f7f15fc53245385e39ef0aab4310d1682fd3c079.zip | |
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 <[email protected]>
Signed-off-by: Manivannan Sadhasivam <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Cc: [email protected] # this is simply a cleanup
Link: https://patch.msgid.link/[email protected]
Diffstat (limited to 'drivers/pci/controller/pcie-rcar-ep.c')
| -rw-r--r-- | drivers/pci/controller/pcie-rcar-ep.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/controller/pcie-rcar-ep.c b/drivers/pci/controller/pcie-rcar-ep.c index c5e0d025bc43..9da39a4617b6 100644 --- a/drivers/pci/controller/pcie-rcar-ep.c +++ b/drivers/pci/controller/pcie-rcar-ep.c @@ -280,7 +280,7 @@ static int rcar_pcie_ep_get_msi(struct pci_epc *epc, u8 fn, u8 vfn) if (!(flags & MSICAP0_MSIE)) return -EINVAL; - return ((flags & MSICAP0_MMESE_MASK) >> MSICAP0_MMESE_OFFSET); + return 1 << ((flags & MSICAP0_MMESE_MASK) >> MSICAP0_MMESE_OFFSET); } static int rcar_pcie_ep_map_addr(struct pci_epc *epc, u8 fn, u8 vfn, |
