提交 164c2924 编写于 作者: T Tony Luck 提交者: Borislav Petkov

EDAC, pnd2: Fix Apollo Lake DIMM detection

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: NTony Luck <tony.luck@intel.com>
Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Cc: linux-edac <linux-edac@vger.kernel.org>
Link: http://lkml.kernel.org/r/20170628234407.21521-1-tony.luck@intel.comSigned-off-by: NBorislav Petkov <bp@suse.de>
上级 a8c82614
...@@ -424,16 +424,21 @@ static void dnv_mk_region(char *name, struct region *rp, void *asym) ...@@ -424,16 +424,21 @@ static void dnv_mk_region(char *name, struct region *rp, void *asym)
static int apl_get_registers(void) static int apl_get_registers(void)
{ {
int ret = -ENODEV;
int i; int i;
if (RD_REG(&asym_2way, b_cr_asym_2way_mem_region_mchbar)) if (RD_REG(&asym_2way, b_cr_asym_2way_mem_region_mchbar))
return -ENODEV; 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++) for (i = 0; i < APL_NUM_CHANNELS; i++)
if (RD_REGP(&drp0[i], d_cr_drp0, apl_dports[i])) if (!RD_REGP(&drp0[i], d_cr_drp0, apl_dports[i]))
return -ENODEV; ret = 0;
return 0; return ret;
} }
static int dnv_get_registers(void) static int dnv_get_registers(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册