]> Git Repo - J-linux.git/commitdiff
EDAC/versal: Read num_csrows and num_chans using the correct bitfield macro
authorShubhrajyoti Datta <[email protected]>
Fri, 15 Dec 2023 05:33:52 +0000 (11:03 +0530)
committerBorislav Petkov (AMD) <[email protected]>
Fri, 15 Dec 2023 12:01:27 +0000 (13:01 +0100)
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: 6f15b178cd63 ("EDAC/versal: Add a Xilinx Versal memory controller driver")
Closes: https://lore.kernel.org/all/[email protected]/
Reported-by: Geert Uytterhoeven <[email protected]>
Signed-off-by: Shubhrajyoti Datta <[email protected]>
Signed-off-by: Borislav Petkov (AMD) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
drivers/edac/versal_edac.c

index 87e730dfefa08d89cae6487726e264d6dd945451..8625de20fc71752018c261445f250d4abc492f1e 100644 (file)
@@ -966,10 +966,10 @@ static int mc_probe(struct platform_device *pdev)
        edac_mc_id = emif_get_id(pdev->dev.of_node);
 
        regval = readl(ddrmc_baseaddr + XDDR_REG_CONFIG0_OFFSET);
-       num_chans = FIELD_PREP(XDDR_REG_CONFIG0_NUM_CHANS_MASK, regval);
+       num_chans = FIELD_GET(XDDR_REG_CONFIG0_NUM_CHANS_MASK, regval);
        num_chans++;
 
-       num_csrows = FIELD_PREP(XDDR_REG_CONFIG0_NUM_RANKS_MASK, regval);
+       num_csrows = FIELD_GET(XDDR_REG_CONFIG0_NUM_RANKS_MASK, regval);
        num_csrows *= 2;
        if (!num_csrows)
                num_csrows = 1;
This page took 0.04811 seconds and 4 git commands to generate.