ath25: switch default kernel to 5.15
[openwrt/staging/ldir.git] / target / linux / generic / pending-5.10 / 850-0012-PCI-aardvark-Enable-MSI-X-support.patch
1 From 735a4ac9782b96fbe1543c578aa8334364f21abd Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali@kernel.org>
3 Date: Fri, 2 Apr 2021 14:05:24 +0200
4 Subject: [PATCH] PCI: aardvark: Enable MSI-X support
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 According to PCI 3.0 specification, sending both MSI and MSI-X interrupts
10 is done by DWORD memory write operation to doorbell message address. The
11 write operation for MSI has zero upper 16 bits and the MSI interrupt number
12 in the lower 16 bits, while the write operation for MSI-X contains a 32-bit
13 value from MSI-X table.
14
15 Since the driver only uses interrupt numbers from range 0..31, the upper
16 16 bits of the DWORD memory write operation to doorbell message address
17 are zero even for MSI-X interrupts. Thus we can enable MSI-X interrupts.
18
19 Testing proves that kernel can correctly receive MSI-X interrupts from PCIe
20 cards which supports both MSI and MSI-X interrupts.
21
22 Signed-off-by: Pali Rohár <pali@kernel.org>
23 Signed-off-by: Marek Behún <kabel@kernel.org>
24 ---
25 drivers/pci/controller/pci-aardvark.c | 2 +-
26 1 file changed, 1 insertion(+), 1 deletion(-)
27
28 --- a/drivers/pci/controller/pci-aardvark.c
29 +++ b/drivers/pci/controller/pci-aardvark.c
30 @@ -1346,7 +1346,7 @@ static struct irq_chip advk_msi_irq_chip
31
32 static struct msi_domain_info advk_msi_domain_info = {
33 .flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
34 - MSI_FLAG_MULTI_PCI_MSI,
35 + MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX,
36 .chip = &advk_msi_irq_chip,
37 };
38