Skip to content

Commit

Permalink
npu2-hw-procedures: Don't set iovalid for opencapi devices
Browse files Browse the repository at this point in the history
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@linux.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
fbarrat authored and stewartsmith committed Mar 20, 2019
1 parent bef1ddc commit 8cf6758
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hw/npu2-hw-procedures.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8cf6758

Please sign in to comment.