From 34ceb75f282952b40b615558f947c3fee533b1d4 Mon Sep 17 00:00:00 2001 From: Andrew Donnellan Date: Tue, 11 Sep 2018 11:07:37 +1000 Subject: hw/npu2-opencapi: Fix setting of supported OpenCAPI templates In opal_npu_tl_set(), we made a typo that means the OPAL_NPU_TL_SET call may not clear the enable bits for templates that were previously enabled but are now disabled. Fix the typo so we clear NPU2_OTL_CONFIG1_TX_TEMP2_EN as well as TEMP{1,3}_EN. Reported-by: Tyler Seredynski Fixes: cd8b82a8e83ed ("npu2-opencapi: Add OpenCAPI OPAL API calls") Cc: stable Signed-off-by: Andrew Donnellan Reviewed-by: Frederic Barrat Signed-off-by: Stewart Smith --- hw/npu2-opencapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/npu2-opencapi.c b/hw/npu2-opencapi.c index 57c2f2f..4d30aa6 100644 --- a/hw/npu2-opencapi.c +++ b/hw/npu2-opencapi.c @@ -2007,8 +2007,8 @@ static int64_t opal_npu_tl_set(uint64_t phb_id, uint32_t __unused bdfn, reg = npu2_scom_read(dev->npu->chip_id, dev->npu->xscom_base, NPU2_OTL_CONFIG1(stack, block), NPU2_MISC_DA_LEN_8B); - reg &= ~(NPU2_OTL_CONFIG1_TX_TEMP1_EN | NPU2_OTL_CONFIG1_TX_TEMP3_EN | - NPU2_OTL_CONFIG1_TX_TEMP1_EN); + reg &= ~(NPU2_OTL_CONFIG1_TX_TEMP1_EN | NPU2_OTL_CONFIG1_TX_TEMP2_EN | + NPU2_OTL_CONFIG1_TX_TEMP3_EN); for (i = 0; i < 4; i++) { /* Skip template 0 as it is implicitly enabled */ if (i && is_template_supported(i, capabilities)) -- cgit v1.1