[Skiboot] [PATCH 15/16] npu2-opencapi: Handle OPAL_UNMAP_PE operation on set_pe() callback

Frederic Barrat fbarrat at linux.ibm.com
Mon Sep 9 22:31:50 AEST 2019


In a hot-unplug scenario, the OS will try to unmap the PE. Skiboot
doesn't do anything with the linux PE for opencapi other than being a
mailbox, but at least let's be consistent.

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

diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c
index af309362..46aeb6d3 100644
--- a/hw/npu2-opencapi.c
+++ b/hw/npu2-opencapi.c
@@ -1488,7 +1488,7 @@ static int64_t npu2_opencapi_set_pe(struct phb *phb,
 				    uint8_t __unused bcompare,
 				    uint8_t __unused dcompare,
 				    uint8_t __unused fcompare,
-				    uint8_t __unused action)
+				    uint8_t action)
 {
 	struct npu2_dev *dev = phb_to_npu2_dev_ocapi(phb);
 	/*
@@ -1500,6 +1500,8 @@ static int64_t npu2_opencapi_set_pe(struct phb *phb,
 	 * functions on the device, the OS can define many PEs, we
 	 * only keep one, the OS will handle it.
 	 */
+	if (action == OPAL_UNMAP_PE)
+		pe_num = -1;
 	dev->linux_pe = pe_num;
 	return OPAL_SUCCESS;
 }
-- 
2.21.0



More information about the Skiboot mailing list