aboutsummaryrefslogtreecommitdiff
path: root/include/npu2.h
diff options
context:
space:
mode:
authorFrederic Barrat <fbarrat@linux.ibm.com>2019-10-09 21:38:08 +0200
committerOliver O'Halloran <oohall@gmail.com>2019-10-22 17:31:47 +1100
commit40bc636eb6b64473ec9ef167bd2bc91a9c032806 (patch)
treeaa4f89e6cddb12bdee6be30776d4521ce38a21bc /include/npu2.h
parentdbc70aea3a2eec5d8d3c092c2397b2997e35ba60 (diff)
downloadskiboot-40bc636eb6b64473ec9ef167bd2bc91a9c032806.zip
skiboot-40bc636eb6b64473ec9ef167bd2bc91a9c032806.tar.gz
skiboot-40bc636eb6b64473ec9ef167bd2bc91a9c032806.tar.bz2
npu2-opencapi: Improve error reporting to the OS
When resetting an opencapi link, the brick will be fenced temporarily. Therefore we can't rely on the fencing state of the brick any more to check for the health of an opencapi PHB, as we could report errors if queried for a PHB state at the same time a link is being reset. Instead, we flag the device as 'broken' when an error interrupt is received, just before raising an event to the OS. When the OS is querying for the state of a PHB, we only have to look at the 'broken' attribute. Note that there's no recovery possible on P9 when an error interrupt is received unexpectedly, as recovery is not supported by hardware. So when a device/link is marked as 'broken', it stays broken. All the OS can do is log the error and notify the drivers. Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com> Signed-off-by: Frederic Barrat <fbarrat@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'include/npu2.h')
-rw-r--r--include/npu2.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/npu2.h b/include/npu2.h
index 6171cd3..d2a3430 100644
--- a/include/npu2.h
+++ b/include/npu2.h
@@ -118,6 +118,8 @@ struct npu2_dev_nvlink {
const char *slot_label;
};
+#define NPU2_DEV_BROKEN 0x1
+
struct npu2_dev {
enum npu2_dev_type type;
uint32_t link_index;
@@ -126,6 +128,7 @@ struct npu2_dev {
struct dt_node *dt_node;
struct npu2_pcie_bar bars[2];
struct npu2 *npu;
+ long flags;
uint32_t bdfn;
@@ -251,4 +254,6 @@ int64_t npu2_map_lpar(struct phb *phb, uint64_t bdf, uint64_t lparid,
int64_t npu2_set_relaxed_order(struct phb *phb, uint32_t gcid, int pec,
bool enable);
+void npu2_opencapi_set_broken(struct npu2 *npu, int brick);
+
#endif /* __NPU2_H */