Thread (8 messages) 8 messages, 3 authors, 2019-11-09

Re: [PATCH 3/3] powerpc/pseries: Fixup config space size of OpenCAPI devices

From: Andrew Donnellan <hidden>
Date: 2019-11-05 05:03:25

On 22/10/19 6:52 pm, christophe lombard wrote:
Fix up the pci config size of the OpenCAPI PCIe devices in the pseries
environment.
Most of OpenCAPI PCIe devices have 4096 bytes of configuration space.
It's not "most of", it's "all" - the OpenCAPI Discovery and 
Configuration Spec requires the use of extended capabilities that fall 
in the 0x100-0xFFF range.
quoted hunk ↗ jump to hunk
Signed-off-by: Christophe Lombard <redacted>
---
  arch/powerpc/platforms/pseries/pci.c | 9 +++++++++
  1 file changed, 9 insertions(+)
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
index 1eae1d09980c..3397784767b0 100644
--- a/arch/powerpc/platforms/pseries/pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -291,6 +291,15 @@ static void fixup_winbond_82c105(struct pci_dev* dev)
  DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105,
  			 fixup_winbond_82c105);
  
+static void fixup_opencapi_cfg_size(struct pci_dev *pdev)
+{
+	if (!machine_is(pseries))
+		return;
+
+	pdev->cfg_size = PCI_CFG_SPACE_EXP_SIZE;
+}
+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IBM, 0x062b, fixup_opencapi_cfg_size);
An OpenCAPI device can have any PCI ID, is there a particular reason 
we're limiting this to 1014:062b? On PowerNV, we check the PHB type to 
determine whether the device is OpenCAPI or not, what's the equivalent 
for pseries?
+
  int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
  {
  	struct device_node *dn, *pdn;
-- 
Andrew Donnellan              OzLabs, ADL Canberra
ajd@linux.ibm.com             IBM Australia Limited
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help