Skip to content

Commit 9483aa4

Browse files
shubhraamdbp3tk0v
authored andcommitted
EDAC/versal: Read num_csrows and num_chans using the correct bitfield macro
Fix the extraction of num_csrows and num_chans. The extraction of the num_rows is wrong. Instead of extracting using the FIELD_GET it is calling FIELD_PREP. The issue was masked as the default design has the rows as 0. Fixes: 6f15b17 ("EDAC/versal: Add a Xilinx Versal memory controller driver") Closes: https://lore.kernel.org/all/60ca157e-6eff-d12c-9dc0-8aeab125edda@linux-m68k.org/ Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20231215053352.8740-1-shubhrajyoti.datta@amd.com
1 parent a39b6ac commit 9483aa4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/edac/versal_edac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -966,10 +966,10 @@ static int mc_probe(struct platform_device *pdev)
966966
edac_mc_id = emif_get_id(pdev->dev.of_node);
967967

968968
regval = readl(ddrmc_baseaddr + XDDR_REG_CONFIG0_OFFSET);
969-
num_chans = FIELD_PREP(XDDR_REG_CONFIG0_NUM_CHANS_MASK, regval);
969+
num_chans = FIELD_GET(XDDR_REG_CONFIG0_NUM_CHANS_MASK, regval);
970970
num_chans++;
971971

972-
num_csrows = FIELD_PREP(XDDR_REG_CONFIG0_NUM_RANKS_MASK, regval);
972+
num_csrows = FIELD_GET(XDDR_REG_CONFIG0_NUM_RANKS_MASK, regval);
973973
num_csrows *= 2;
974974
if (!num_csrows)
975975
num_csrows = 1;

0 commit comments

Comments
 (0)