From: Damien Le Moal <dlemoal@kernel.org>
To: "Niklas Cassel" <cassel@kernel.org>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Manivannan Sadhasivam" <manivannan.sadhasivam@linaro.org>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Kishon Vijay Abraham I" <kishon@kernel.org>,
"Alan Douglas" <adouglas@cadence.com>
Cc: Wilfred Mallawa <wilfred.mallawa@wdc.com>, linux-pci@vger.kernel.org
Subject: Re: [PATCH 2/2] PCI: cadence-ep: Fix broken set_msix() callback
Date: Fri, 2 May 2025 04:02:17 +0900 [thread overview]
Message-ID: <5db4d54a-38bc-42b4-a9d0-558d2573d720@kernel.org> (raw)
In-Reply-To: <20250430123158.40535-4-cassel@kernel.org>
On 4/30/25 21:32, Niklas Cassel wrote:
> While the parameter 'interrupts' to the functions pci_epc_set_msi() and
> pci_epc_set_msix() represent the actual number of interrupts, and
> pci_epc_get_msi() and pci_epc_get_msix() return the actual number of
> interrupts.
>
> These endpoint library functions just mentioned will however supply
> "interrupts - 1" to the EPC callback functions pci_epc_ops->set_msi() and
> pci_epc_ops->set_msix(), and likewise add 1 to return value from
> pci_epc_ops->get_msi() and pci_epc_ops->get_msix(), even though the
> parameter name for the callback function is also named 'interrupts'.
>
> While the set_msix() callback function in pcie-cadence-ep writes the
> Table Size field correctly (N-1), the calculation of the PBA offset
> is wrong because it calculates space for (N-1) entries instead of N.
>
> This results in e.g. the following error when using QEMU with PCI
> passthrough on a device which relies on the PCI endpoint subsystem:
> failed to add PCI capability 0x11[0x50]@0xb0: table & pba overlap, or they don't fit in BARs, or don't align
>
> Fix the calculation of PBA offset in the MSI-X capability.
>
> Fixes: 3ef5d16f50f8 ("PCI: cadence: Add MSI-X support to Endpoint driver")
> Signed-off-by: Niklas Cassel <cassel@kernel.org>
Looks good to me.
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
--
Damien Le Moal
Western Digital Research
next prev parent reply other threads:[~2025-05-01 19:02 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 12:31 [PATCH 1/2] PCI: dwc: ep: Fix broken set_msix() callback Niklas Cassel
2025-04-30 12:32 ` [PATCH 2/2] PCI: cadence-ep: " Niklas Cassel
2025-05-01 2:04 ` Wilfred Mallawa
2025-05-01 19:02 ` Damien Le Moal [this message]
2025-05-01 2:04 ` [PATCH 1/2] PCI: dwc: ep: " Wilfred Mallawa
2025-05-01 19:01 ` Damien Le Moal
2025-05-10 5:57 ` Manivannan Sadhasivam
2025-05-10 11:43 ` Niklas Cassel
2025-05-12 7:30 ` Manivannan Sadhasivam
2025-05-12 9:28 ` Niklas Cassel
2025-05-12 16:56 ` Niklas Cassel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5db4d54a-38bc-42b4-a9d0-558d2573d720@kernel.org \
--to=dlemoal@kernel.org \
--cc=adouglas@cadence.com \
--cc=bhelgaas@google.com \
--cc=cassel@kernel.org \
--cc=kishon@kernel.org \
--cc=kw@linux.com \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=robh@kernel.org \
--cc=wilfred.mallawa@wdc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox