Skip to content

Commit

Permalink
EDAC, pnd2: Fix Apollo Lake DIMM detection
Browse files Browse the repository at this point in the history
Non-existent or empty DIMM slots result in error return from
RD_REGP(). But we shouldn't give up on failure.

So long as we find at least one DIMM we can continue.

Signed-off-by: Tony Luck <[email protected]>
Cc: Qiuxu Zhuo <[email protected]>
Cc: linux-edac <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Borislav Petkov <[email protected]>
  • Loading branch information
aegl authored and suryasaimadhu committed Jun 29, 2017
1 parent a8c8261 commit 164c292
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/edac/pnd2_edac.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,16 +424,21 @@ static void dnv_mk_region(char *name, struct region *rp, void *asym)

static int apl_get_registers(void)
{
int ret = -ENODEV;
int i;

if (RD_REG(&asym_2way, b_cr_asym_2way_mem_region_mchbar))
return -ENODEV;

/*
* RD_REGP() will fail for unpopulated or non-existent
* DIMM slots. Return success if we find at least one DIMM.
*/
for (i = 0; i < APL_NUM_CHANNELS; i++)
if (RD_REGP(&drp0[i], d_cr_drp0, apl_dports[i]))
return -ENODEV;
if (!RD_REGP(&drp0[i], d_cr_drp0, apl_dports[i]))
ret = 0;

return 0;
return ret;
}

static int dnv_get_registers(void)
Expand Down

0 comments on commit 164c292

Please sign in to comment.