[Skiboot] [PATCH 1/3] npu2-hw-procedures: Don't set iovalid for opencapi devices

Frederic Barrat fbarrat at linux.ibm.com
Sat Mar 16 03:44:38 AEDT 2019

set_iovalid() is called on the PHY reset path. The hw logic it touches
is meaningless for opencapi. It's not hurting as long as all the links
under the NPU are in opencapi mode, but in case of mixing opencapi and
nvlink, we'll be in troubles: the code finds which bit to modify based
on the brick index, which varies depending on the mode. So calling
that function on an opencapi device may modify a nvlink brick! For
example, for brick index 3.

So we simply avoid doing anything when calling set_iovalid() for an
opencapi device.

Signed-off-by: Frederic Barrat <fbarrat at linux.ibm.com>
 hw/npu2-hw-procedures.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/npu2-hw-procedures.c b/hw/npu2-hw-procedures.c
index a10ccb7c..3ee646cd 100644
--- a/hw/npu2-hw-procedures.c
+++ b/hw/npu2-hw-procedures.c
@@ -218,6 +218,9 @@ static void set_iovalid(struct npu2_dev *ndev, bool raise)
 	uint64_t addr, val, mask;
 	int rc;
+	if (ndev->type == NPU2_DEV_TYPE_OPENCAPI)
+		return;
 	addr = (ndev->pl_xscom_base & 0x3F000000) | 0x9;
 	mask = PPC_BIT(6 + obus_brick_index(ndev));
 	val = raise ? mask : 0;

More information about the Skiboot mailing list