Skip to content

Commit

Permalink
hw/npu2-opencapi: Fix setting of supported OpenCAPI templates
Browse files Browse the repository at this point in the history
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 <tseredynski@gmail.com>
Fixes: cd8b82a ("npu2-opencapi: Add OpenCAPI OPAL API calls")
Cc: stable
Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Reviewed-by: Frederic Barrat <fbarrat@linux.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
ajdlinux authored and stewartsmith committed Sep 18, 2018
1 parent f835684 commit 34ceb75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hw/npu2-opencapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 34ceb75

Please sign in to comment.