diff mbox

[06/14] phb4: Disable device config space access when fenced

Message ID 20170726105013.24948-6-mikey@neuling.org
State Accepted
Headers show

Commit Message

Michael Neuling July 26, 2017, 10:50 a.m. UTC
On DD2 you can't access device config space when fenced, so just
disable access whenever we are fenced.

Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 hw/phb4.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/hw/phb4.c b/hw/phb4.c
index 250e1e80ee..12a05f44c3 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -430,6 +430,8 @@  static int64_t phb4_pcicfg_read(struct phb4 *p, uint32_t bdfn,
 	if (p->flags & PHB4_AIB_FENCED) {
 		if (!(p->flags & PHB4_CFG_USE_ASB))
 			return OPAL_HARDWARE;
+		if (bdfn != 0)
+			return OPAL_HARDWARE;
 		use_asb = true;
 	} else if ((p->flags & PHB4_CFG_BLOCKED) && bdfn != 0) {
 		return OPAL_HARDWARE;
@@ -521,6 +523,8 @@  static int64_t phb4_pcicfg_write(struct phb4 *p, uint32_t bdfn,
 	if (p->flags & PHB4_AIB_FENCED) {
 		if (!(p->flags & PHB4_CFG_USE_ASB))
 			return OPAL_HARDWARE;
+		if (bdfn != 0)
+			return OPAL_HARDWARE;
 		use_asb = true;
 	} else if ((p->flags & PHB4_CFG_BLOCKED) && bdfn != 0) {
 		return OPAL_HARDWARE;