aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJoel Stanley <joel@jms.id.au>2018-06-05 16:43:37 +0930
committerStewart Smith <stewart@linux.ibm.com>2018-06-18 22:13:43 -0500
commitb2054c43315dff703b41de4e6536986d1fcf0030 (patch)
tree8165a6409fea1191b58a64b5018e6a280c3ecb9e /hw
parentc3f20185ff5d7359e08a4e7e90252f1fe3abb27d (diff)
downloadskiboot-b2054c43315dff703b41de4e6536986d1fcf0030.zip
skiboot-b2054c43315dff703b41de4e6536986d1fcf0030.tar.gz
skiboot-b2054c43315dff703b41de4e6536986d1fcf0030.tar.bz2
psi: Properly mask errors in SEMR
It looks like this code intended to read PSIHB SEMR, mask out some of the values, and write it back. Instead it writes the mask to the register. Found using scan-build. Fixes: 39addc6a0f1f ("PSI: Reorganize PSI link down handling code") Signed-off-by: Joel Stanley <joel@jms.id.au> Acked-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/psi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/psi.c b/hw/psi.c
index f7d8cd9..f5168ba 100644
--- a/hw/psi.c
+++ b/hw/psi.c
@@ -74,7 +74,7 @@ void psi_disable_link(struct psi *psi)
/* Mask errors in SEMR */
reg = in_be64(psi->regs + PSIHB_SEMR);
- reg = ((0xfffull << 36) | (0xfffull << 20));
+ reg &= ((0xfffull << 36) | (0xfffull << 20));
out_be64(psi->regs + PSIHB_SEMR, reg);
printf("PSI: SEMR set to %llx\n", reg);