]> www.infradead.org Git - users/jedix/linux-maple.git/commit
PCI: endpoint: Align pci_epc_set_msix(), pci_epc_ops::set_msix() nr_irqs encoding
authorNiklas Cassel <cassel@kernel.org>
Wed, 14 May 2025 07:43:19 +0000 (09:43 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 28 May 2025 21:47:56 +0000 (16:47 -0500)
commitde0321bcc5fdd83631f0c2a6fdebfe0ad4e23449
tree36b08613228a5f9ea7793ff800417b597290409a
parentf62da6e7270c2db5aef8a8b14f465896961a9372
PCI: endpoint: Align pci_epc_set_msix(), pci_epc_ops::set_msix() nr_irqs encoding

The kdoc for pci_epc_set_msix() says:
"Invoke to set the required number of MSI-X interrupts."

The kdoc for the callback pci_epc_ops->set_msix() says:
"ops to set the requested number of MSI-X interrupts in the MSI-X
capability register"

pci_epc_ops::set_msix() does however expect the parameter 'interrupts' to
be in the encoding as defined by the Table Size field. Nowhere in the
kdoc does it say that the number of interrupts should be in Table Size
encoding.

It is very confusing that the API pci_epc_set_msix() and the callback
function pci_epc_ops::set_msix() both take a parameter named 'interrupts',
but they expect completely different encodings.

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

Also rename the parameter 'interrupts' to 'nr_irqs', in both the wrapper
function and the callback function, such that the name is unambiguous.

[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>
Cc: stable+noautosel@kernel.org # this is simply a cleanup
Link: https://patch.msgid.link/20250514074313.283156-14-cassel@kernel.org
drivers/pci/controller/cadence/pcie-cadence-ep.c
drivers/pci/controller/dwc/pcie-designware-ep.c
drivers/pci/endpoint/pci-epc-core.c
include/linux/pci-epc.h