drivers: pci: pcieport: Allow AER service only on root ports
From: Suneel Garapati <[email protected]>
Some AER interrupt capability registers may not be present on non Root ports. Since there is no way to check presence of ROOT_ERR_COMMAND and ROOT_ERR_STATUS registers. Allow AER service only on root ports.
Otherwise AER interrupt message number is read incorrectly causing MSIX vector registration to fail and fallback to legacy unnecessarily.
--- drivers/pci/pcie/portdrv_core.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/pci/pcie/portdrv_core.c +9 -0
@@ -221,7 +221,16 @@ static int get_port_device_capability(struct pci_dev *dev) }#ifdef CONFIG_PCIEAER +/* +* Some AER interrupt capability registers may not be present on +* non Root ports. Since there is no way to check presence of +* ROOT_ERR_COMMAND and ROOT_ERR_STATUS registers. Allow AER +* service only on root ports. Refer PCIe rev5.0 spec v1.0 7.8.4. +* Otherwise AER interrupt message number is read incorrectly +* causing MSIX vector registration to fail and fallback to legacy. +*/ if (dev->aer_cap &&pci_aer_available () && +pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT && (pcie_ports_native || host->native_aer)) { services |=PCIE_PORT_SERVICE_AER ;
Signature · 1 line
2.25.1
Please note "git log --oneline drivers/pci/pcie/portdrv_core.c" and make your patch follow the style.
Quoted 9 lines · Daniel Walker
From: Suneel Garapati <[email protected]>
Some AER interrupt capability registers may not be present on non Root ports. Since there is no way to check presence of
ROOT_ERR_COMMANDandROOT_ERR_STATUSregisters. Allow AER service only on root ports.
Otherwise AER interrupt message number is read incorrectly causing MSIX vector registration to fail and fallback to legacy unnecessarily.
Wrap to fill 75 columns.
Add blank lines between paragraphs.
Use complete sentences ("Since there is ..." is not a sentence).
Capitalize consistently ("Root ports" vs "root ports").
Use register names I can find in the spec or with grep ("ROOT_ERR_COMMAND" and "ROOT_ERR_STATUS" do not appear in the source).
s/MSIX/MSI-X/ to match spec usage.
Also applies to code comment below.
Quoted 1 line
Signed-off-by Suneel Garapati <[email protected]>
Needs to include your (Daniel's) Signed-off-by; see:
Quoted 11 lines
Reviewed-by Chandrakala Chavva <[email protected]>Reviewed-by Sunil Kovvuri Goutham <[email protected]>--- drivers/pci/pcie/portdrv_core.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/pci/pcie/portdrv_core.c +0
-0
drivers/pci/pcie/portdrv_core.c static int get_port_device_capability(struct pci_dev *dev) · line 228
Quoted 8 lines
drivers/pci/pcie/portdrv_core.c +5
-0@@ -221,7 +221,16 @@ static int get_port_device_capability(struct pci_dev *dev) }#ifdef CONFIG_PCIEAER +/* +* Some AER interrupt capability registers may not be present on +* non Root ports. Since there is no way to check presence of +* ROOT_ERR_COMMAND and ROOT_ERR_STATUS registers. Allow AER +* service only on root ports. Refer PCIe rev5.0 spec v1.0 7.8.4.
Sec 7.8.4 talks about Root Ports and Root Complex Event Collectors together, so I would think you would treat them the same here.
Quoted 11 lines
drivers/pci/pcie/portdrv_core.c +4
-0+* Otherwise AER interrupt message number is read incorrectly +* causing MSIX vector registration to fail and fallback to legacy. +*/ if (dev->aer_cap &&pci_aer_available () && +pci_pcie_type (dev) ==PCI_EXP_TYPE_ROOT_PORT && (pcie_ports_native || host->native_aer)) { services |=PCIE_PORT_SERVICE_AER ;Signature · 1 line
2.25.1