Skip to content

Commit

Permalink
psi: Properly mask errors in SEMR
Browse files Browse the repository at this point in the history
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: 39addc6 ("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>
  • Loading branch information
shenki authored and stewartsmith committed Jun 19, 2018
1 parent c3f2018 commit b2054c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/psi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit b2054c4

Please sign in to comment.