2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/pci/endpoint
Niklas Cassel de0321bcc5 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
2025-05-28 16:47:56 -05:00
..
functions PCI: endpoint: pci-epf-vntb: Simplify ctrl/SPAD space allocation 2025-05-28 16:47:37 -05:00
Kconfig PCI: Fix typos 2025-03-08 15:08:45 -06:00
Makefile PCI: Add SPDX GPL-2.0 when no license was specified 2018-01-26 11:45:16 -06:00
pci-ep-cfs.c PCI: endpoint: Remove unused field in struct pci_epf_group 2024-05-28 11:13:48 -05:00
pci-epc-core.c PCI: endpoint: Align pci_epc_set_msix(), pci_epc_ops::set_msix() nr_irqs encoding 2025-05-28 16:47:56 -05:00
pci-epc-mem.c PCI: endpoint: Improve pci_epc_mem_alloc_addr() 2024-10-12 17:25:54 +05:30
pci-epf-core.c PCI: endpoint: Retain fixed-size BAR size as well as aligned size 2025-05-28 16:15:40 -05:00