diff mbox

[5/8] phb4: Call pci config filters

Message ID 20170605225924.11416-5-benh@kernel.crashing.org
State Accepted
Headers show

Commit Message

Benjamin Herrenschmidt June 5, 2017, 10:59 p.m. UTC
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 hw/phb4.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox

Patch

diff --git a/hw/phb4.c b/hw/phb4.c
index e4a90a6..0f57833 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -325,6 +325,12 @@  static int64_t phb4_pcicfg_read(struct phb4 *p, uint32_t bdfn,
 		return OPAL_HARDWARE;
 	}
 
+	/* Handle per-device filters */
+	rc = pci_handle_cfg_filters(&p->phb, bdfn, offset, size,
+				    (uint32_t *)data, false);
+	if (rc != OPAL_PARTIAL)
+		return rc;
+
 	/* Handle root complex MMIO based config space */
 	if (bdfn == 0)
 		return phb4_rc_read(p, offset, size, data);
@@ -428,6 +434,12 @@  static int64_t phb4_pcicfg_write(struct phb4 *p, uint32_t bdfn,
 		return OPAL_HARDWARE;
 	}
 
+	/* Handle per-device filters */
+	rc = pci_handle_cfg_filters(&p->phb, bdfn, offset, size,
+				    (uint32_t *)&data, true);
+	if (rc != OPAL_PARTIAL)
+		return rc;
+
 	/* Handle root complex MMIO based config space */
 	if (bdfn == 0)
 		return phb4_rc_write(p, offset, size, data);