From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
To: "Chen, Gong" <gong.chen@linux.intel.com>,
tony.luck@intel.com, bp@alien8.de
Cc: linux-acpi@vger.kernel.org
Subject: Re: [PATCH v2 2/2] ACPI, APEI, GHES: Cleanup ghes codes for memory error handling
Date: Tue, 26 Nov 2013 14:34:51 +0530 [thread overview]
Message-ID: <52946433.1010403@linux.vnet.ibm.com> (raw)
In-Reply-To: <1385363701-12387-2-git-send-email-gong.chen@linux.intel.com>
On 11/25/2013 12:45 PM, Chen, Gong wrote:
> Cleanup the logic for function ghes_handle_memory_failure. Just
> make it simpler and cleaner.
>
> v2 -> v1: fix a compile error & some minor changes.
>
> Signed-off-by: Chen, Gong <gong.chen@linux.intel.com>
Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
> ---
> drivers/acpi/apei/ghes.c | 36 ++++++++++++++++++++----------------
> 1 file changed, 20 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> index ce3683d..46766ef 100644
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -413,27 +413,31 @@ static void ghes_handle_memory_failure(struct acpi_generic_data *gdata, int sev)
> {
> #ifdef CONFIG_ACPI_APEI_MEMORY_FAILURE
> unsigned long pfn;
> + int flags = -1;
> int sec_sev = ghes_severity(gdata->error_severity);
> struct cper_sec_mem_err *mem_err;
> mem_err = (struct cper_sec_mem_err *)(gdata + 1);
>
> - if (sec_sev == GHES_SEV_CORRECTED &&
> - (gdata->flags & CPER_SEC_ERROR_THRESHOLD_EXCEEDED) &&
> - (mem_err->validation_bits & CPER_MEM_VALID_PA)) {
> - pfn = mem_err->physical_addr >> PAGE_SHIFT;
> - if (pfn_valid(pfn))
> - memory_failure_queue(pfn, 0, MF_SOFT_OFFLINE);
> - else if (printk_ratelimit())
> - pr_warn(FW_WARN GHES_PFX
> - "Invalid address in generic error data: %#llx\n",
> - mem_err->physical_addr);
> - }
> - if (sev == GHES_SEV_RECOVERABLE &&
> - sec_sev == GHES_SEV_RECOVERABLE &&
> - mem_err->validation_bits & CPER_MEM_VALID_PA) {
> - pfn = mem_err->physical_addr >> PAGE_SHIFT;
> - memory_failure_queue(pfn, 0, 0);
> + if (!(mem_err->validation_bits & CPER_MEM_VALID_PA))
> + return;
> +
> + pfn = mem_err->physical_addr >> PAGE_SHIFT;
> + if (!pfn_valid(pfn)) {
> + pr_warn_ratelimited(FW_WARN GHES_PFX
> + "Invalid address in generic error data: %#llx\n",
> + mem_err->physical_addr);
> + return;
> }
> +
> + /* iff following two events can be handled properly by now */
> + if (sec_sev == GHES_SEV_CORRECTED &&
> + (gdata->flags & CPER_SEC_ERROR_THRESHOLD_EXCEEDED))
> + flags = MF_SOFT_OFFLINE;
> + if (sev == GHES_SEV_RECOVERABLE && sec_sev == GHES_SEV_RECOVERABLE)
> + flags = 0;
> +
> + if (flags != -1)
> + memory_failure_queue(pfn, 0, flags);
> #endif
> }
>
next prev parent reply other threads:[~2013-11-26 9:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-25 7:15 [PATCH v2 1/2] ACPI, APEI, GHES: Remove strict check for memory error handling Chen, Gong
2013-11-25 7:15 ` [PATCH v2 2/2] ACPI, APEI, GHES: Cleanup ghes codes " Chen, Gong
2013-11-26 6:54 ` Chen, Gong
2013-11-26 7:23 ` Borislav Petkov
2013-11-27 2:15 ` Chen, Gong
2013-12-14 13:42 ` Chen, Gong
2013-11-26 9:04 ` Naveen N. Rao [this message]
2013-12-21 12:41 ` Borislav Petkov
2013-11-25 17:13 ` [PATCH v2 1/2] ACPI, APEI, GHES: Remove strict check " Borislav Petkov
2013-11-26 9:02 ` Naveen N. Rao
2013-11-26 9:31 ` Chen, Gong
2013-12-14 13:42 ` Chen, Gong
2013-12-16 14:51 ` Borislav Petkov
2013-12-16 14:40 ` Chen, Gong
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=52946433.1010403@linux.vnet.ibm.com \
--to=naveen.n.rao@linux.vnet.ibm.com \
--cc=bp@alien8.de \
--cc=gong.chen@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--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).