Skip to content

Commit 2ec1b17

Browse files
davejiangdjbw
authored andcommitted
cxl: fix cxl_report_and_clear() RAS UE addr mis-assignment
'addr' that contains RAS UE register address is re-assigned to RAS_CAP_CONTROL offset if there are multiple UE errors. Use different addr variable to avoid the reassignment mistake. Fixes: 2905cb5 ("cxl/pci: Add (hopeful) error handling support") Reported-by: Jonathan Cameron <[email protected]> Signed-off-by: Dave Jiang <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Link: https://lore.kernel.org/r/167302318779.580155.15233596744650706167.stgit@djiang5-mobl3.local Signed-off-by: Dan Williams <[email protected]>
1 parent b7bfaa7 commit 2ec1b17

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/cxl/pci.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,11 @@ static bool cxl_report_and_clear(struct cxl_dev_state *cxlds)
554554

555555
/* If multiple errors, log header points to first error from ctrl reg */
556556
if (hweight32(status) > 1) {
557-
addr = cxlds->regs.ras + CXL_RAS_CAP_CONTROL_OFFSET;
558-
fe = BIT(FIELD_GET(CXL_RAS_CAP_CONTROL_FE_MASK, readl(addr)));
557+
void __iomem *rcc_addr =
558+
cxlds->regs.ras + CXL_RAS_CAP_CONTROL_OFFSET;
559+
560+
fe = BIT(FIELD_GET(CXL_RAS_CAP_CONTROL_FE_MASK,
561+
readl(rcc_addr)));
559562
} else {
560563
fe = status;
561564
}

0 commit comments

Comments
 (0)