All of lore.kernel.org
 help / color / mirror / Atom feed
* EDAC, pnd2_edac: Fix Apollo Lake DIMM detection
@ 2017-06-28 23:44 Luck, Tony
  0 siblings, 0 replies; 2+ messages in thread
From: Luck, Tony @ 2017-06-28 23:44 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Tony Luck, Qiuxu Zhuo, Mauro Carvalho Chehab, open list:EDAC-PND2

From: Tony Luck <tony.luck@intel.com>

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.

Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org> (supporter:EDAC-CORE)
Cc: linux-edac@vger.kernel.org (open list:EDAC-PND2)
Signed-off-by: Tony Luck <tony.luck@intel.com>
---
 drivers/edac/pnd2_edac.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/edac/pnd2_edac.c b/drivers/edac/pnd2_edac.c
index 1cad5a9af8d0..8b287bf3e2ec 100644
--- a/drivers/edac/pnd2_edac.c
+++ b/drivers/edac/pnd2_edac.c
@@ -423,16 +423,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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* EDAC, pnd2_edac: Fix Apollo Lake DIMM detection
@ 2017-06-29  8:39 Boris Petkov
  0 siblings, 0 replies; 2+ messages in thread
From: Boris Petkov @ 2017-06-29  8:39 UTC (permalink / raw)
  To: Luck, Tony; +Cc: Qiuxu Zhuo, Mauro Carvalho Chehab, open list:EDAC-PND2

On Wed, Jun 28, 2017 at 04:44:07PM -0700, Luck, Tony wrote:
> From: Tony Luck <tony.luck@intel.com>
> 
> 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.
> 
> Cc: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org> (supporter:EDAC-CORE)
> Cc: linux-edac@vger.kernel.org (open list:EDAC-PND2)
> Signed-off-by: Tony Luck <tony.luck@intel.com>
> ---
>  drivers/edac/pnd2_edac.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-29  8:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-28 23:44 EDAC, pnd2_edac: Fix Apollo Lake DIMM detection Luck, Tony
2017-06-29  8:39 Boris Petkov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.