linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "she90122 ." <she90122@gmail.com>
To: she90122 <she90122@gmail.com>
Cc: Tony Luck <tony.luck@intel.com>, Borislav Petkov <bp@alien8.de>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	James Morse <james.morse@arm.com>,
	Robert Richter <rrichter@marvell.com>,
	linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Amy.Shih" <Amy.Shih@advantech.com.tw>,
	"Oakley.Ding" <Oakley.Ding@advantech.com.tw>
Subject: [RESEND,v3,1/1] EDAC: (pnd2) Change the return value of function apl_check_ecc_active() & dnv_check_ecc_active() when installed the non-ECC memory device.
Date: Wed, 1 Apr 2020 13:13:39 +0800	[thread overview]
Message-ID: <CAMhTFwnDYz=SQsyT6yV+Whp6mQiCw7KTrgt-4oE3Ve3mvOKgxA@mail.gmail.com> (raw)

From: Amy Shih <amy.shih@advantech.com.tw>

Set function apl_check_ecc_active() &
dnv_check_ecc_active() to return -ENXIO when installed the non-ECC
memory device. And print the message in pnd2_init() accordingly.

Signed-off-by: Amy Shih <amy.shih@advantech.com.tw>
---
Changes in v3:
- Change the return value of function check_ecc when installed the
non-ECC memory device.
Changes in v2:
- Remove the word "error" from output message.

 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
933f772..27172d7 100644
--- a/drivers/edac/pnd2_edac.c
+++ b/drivers/edac/pnd2_edac.c
@@ -1089,7 +1089,7 @@ static int apl_check_ecc_active(void)
  for (i = 0; i < APL_NUM_CHANNELS; i++)
  if (chan_mask & BIT(i))
  ret += check_channel(i);
- return ret ? -EINVAL : 0;
+ return ret ? -ENXIO : 0;
 }

 #define DIMMS_PRESENT(d) ((d)->rken0 + (d)->rken1 + (d)->rken2 +
(d)->rken3) @@ -1111,7 +1111,7 @@ static int
dnv_check_ecc_active(void)

  for (i = 0; i < DNV_NUM_CHANNELS; i++)
  ret += check_unit(i);
- return ret ? -EINVAL : 0;
+ return ret ? -ENXIO : 0;
 }

 static int get_memory_error_data(struct mem_ctl_info *mci, u64 addr,
@@ -1572,7 +1572,12 @@ static int __init pnd2_init(void)

  rc = pnd2_probe();
  if (rc < 0) {
- pnd2_printk(KERN_ERR, "Failed to register device with error %d.\n", rc);
+ if (rc == -ENXIO)
+ pnd2_printk(KERN_INFO, "System is not using ECC memory\n");
+ else
+ pnd2_printk(KERN_ERR,
+     "Failed to register device with error %d.\n",
+     rc);
  return rc;
  }

--
1.8.3.1

                 reply	other threads:[~2020-04-01  5:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMhTFwnDYz=SQsyT6yV+Whp6mQiCw7KTrgt-4oE3Ve3mvOKgxA@mail.gmail.com' \
    --to=she90122@gmail.com \
    --cc=Amy.Shih@advantech.com.tw \
    --cc=Oakley.Ding@advantech.com.tw \
    --cc=bp@alien8.de \
    --cc=james.morse@arm.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=rrichter@marvell.com \
    --cc=tony.luck@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).