Re: [PATCH 2/2] PCI: dwc: ep: Add MSI-X Enable checks before raising MSI-X to the host
From: Niklas Cassel
Date: Fri Feb 27 2026 - 05:13:57 EST
On Wed, Feb 25, 2026 at 09:53:59PM +0530, Manivannan Sadhasivam wrote:
> PCIe spec r7, sec 7.7.2.2 mandates that a Function should raise MSI-X only
> if the MSI-X Enable bit is set and MSI enable bit is clear.
>
> Hence, add those checks to be spec compliant.
>
> Suggested-by: Bjorn Helgaas <helgaas@xxxxxxxxxx>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxxxxxxxx>
> ---
> drivers/pci/controller/dwc/pcie-designware-ep.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c
> index fcbd648e049e..47bc33346342 100644
> --- a/drivers/pci/controller/dwc/pcie-designware-ep.c
> +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c
> @@ -1018,6 +1018,15 @@ int dw_pcie_ep_raise_msix_irq(struct dw_pcie_ep *ep, u8 func_no,
> if (!ep_func || !ep_func->msix_cap)
> return -EINVAL;
>
> + /*
> + * PCIe spec r7, sec 7.7.2.2 mandates that a Function should raise MSI-X
> + * only if the MSI-X Enable bit is set and MSI Enable bit is clear.
> + */
> + if (!dw_pcie_ep_msix_enabled(ep, ep_func, func_no) ||
> + (dw_pcie_ep_msix_enabled(ep, ep_func, func_no) &&
> + dw_pcie_ep_msi_enabled(ep, ep_func, func_no)))
> + return -EOPNOTSUPP;
Same comment as patch 1/2.
Kind regards,
Niklas