aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederic Barrat <fbarrat@linux.ibm.com>2019-10-09 21:38:10 +0200
committerVasant Hegde <hegdevasant@linux.vnet.ibm.com>2020-03-11 11:01:28 +0530
commit9d37f291983c83b78999e7b47e1b07d6f4f6caac (patch)
tree1a7c7b1b1721eec86943c7300597c6c58a20d40c
parent651a16973cd2da178f909a255a2f6450c792bd40 (diff)
downloadskiboot-9d37f291983c83b78999e7b47e1b07d6f4f6caac.zip
skiboot-9d37f291983c83b78999e7b47e1b07d6f4f6caac.tar.gz
skiboot-9d37f291983c83b78999e7b47e1b07d6f4f6caac.tar.bz2
npu2-opencapi: Handle OPAL_UNMAP_PE operation on set_pe() callback
[ Upstream commit 9d5faafc56f5cac7ba848bc684835353e039f048 ] 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@linux.ibm.com> Reviewed-by: Christophe Lombard <clombard@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
-rw-r--r--hw/npu2-opencapi.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c
index 6d36c5b..2f66aca 100644
--- a/hw/npu2-opencapi.c
+++ b/hw/npu2-opencapi.c
@@ -1523,7 +1523,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);
/*
@@ -1535,6 +1535,11 @@ 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_MAP_PE && action != OPAL_UNMAP_PE)
+ return OPAL_PARAMETER;
+
+ if (action == OPAL_UNMAP_PE)
+ pe_num = -1;
dev->linux_pe = pe_num;
return OPAL_SUCCESS;
}