public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tyler Baicar <tbaicar@codeaurora.org>
To: Alexandru Gagniuc <mr.nuke.me@gmail.com>, bp@alien8.de
Cc: alex_gagniuc@dellteam.com, austin_bolen@dell.com,
	shyam_iyer@dell.com, "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>, Tony Luck <tony.luck@intel.com>,
	Will Deacon <will.deacon@arm.com>,
	James Morse <james.morse@arm.com>,
	Shiju Jose <shiju.jose@huawei.com>,
	"Jonathan (Zhixiong) Zhang" <zjzhang@codeaurora.org>,
	Dongjiu Geng <gengdongjiu@huawei.com>,
	linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/2] acpi: apei: Do not panic() on PCIe errors reported through GHES
Date: Mon, 21 May 2018 10:27:49 -0400	[thread overview]
Message-ID: <737bea6a-2f0e-e573-754e-2e410c34013e@codeaurora.org> (raw)
In-Reply-To: <20180521135003.32459-3-mr.nuke.me@gmail.com>

On 5/21/2018 9:49 AM, Alexandru Gagniuc wrote:
> +/* PCIe errors should not cause a panic. */
> +static int ghes_sec_pcie_severity(struct acpi_hest_generic_data *gdata)
> +{
> +	struct cper_sec_pcie *pcie_err = acpi_hest_get_payload(gdata);
> +
> +	if (pcie_err->validation_bits & CPER_PCIE_VALID_DEVICE_ID &&
> +	    pcie_err->validation_bits & CPER_PCIE_VALID_AER_INFO &&
> +	    IS_ENABLED(CONFIG_ACPI_APEI_PCIEAER))
> +		return GHES_SEV_RECOVERABLE;
> +
> +	return ghes_cper_severity(gdata->error_severity);
> +}
> +
> +/*
> + * The severity field in the status block is an unreliable metric for the
> + * severity. A more reliable way is to look at each subsection and see how safe
> + * it is to call the approproate error handler.
> + * We're not conerned with handling the error. We're concerned with being able
> + * to notify an error handler by crossing the NMI/IRQ boundary, being able to
> + * schedule_work, and so forth.
> + *   - SEC_PCIE: All PCIe errors can be handled by AER.
> + */
> +static int ghes_severity(struct ghes *ghes)
> +{
> +	int worst_sev, sec_sev;
> +	struct acpi_hest_generic_data *gdata;
> +	const guid_t *section_type;
> +	const struct acpi_hest_generic_status *estatus = ghes->estatus;
> +
> +	worst_sev = GHES_SEV_NO;
> +	apei_estatus_for_each_section(estatus, gdata) {
> +		section_type = (guid_t *)gdata->section_type;
> +		sec_sev = ghes_cper_severity(gdata->error_severity);
> +
> +		if (guid_equal(section_type, &CPER_SEC_PCIE))
> +			sec_sev = ghes_sec_pcie_severity(gdata);
> +
> +		worst_sev = max(worst_sev, sec_sev);
> +	}
> +
> +	return worst_sev;
> +}
> +
>   static void ghes_do_proc(struct ghes *ghes,
>   			 const struct acpi_hest_generic_status *estatus)
>   {
> @@ -944,7 +986,7 @@ static int ghes_notify_nmi(unsigned int cmd, struct pt_regs *regs)
>   			ret = NMI_HANDLED;
>   		}
>   
> -		sev = ghes_cper_severity(ghes->estatus->error_severity);
> +		sev = ghes_severity(ghes);
Hello Alex,

There is a compile warning if CONFIG_HAVE_ACPI_APEI_NMI is not selected.

   CC      drivers/acpi/apei/ghes.o
drivers/acpi/apei/ghes.c:483:12: warning: ‘ghes_severity’ defined but not used 
[-Wunused-function]
  static int ghes_severity(struct ghes *ghes)
             ^~~~~~~~~~~~~

Thanks,
Tyler

-- 
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

  reply	other threads:[~2018-05-21 14:27 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-21 13:49 [PATCH v6 0/2] acpi: apei: Improve PCIe error handling with FFS Alexandru Gagniuc
2018-05-21 13:49 ` [PATCH v6 1/2] acpi: apei: Rename ghes_severity() to ghes_cper_severity() Alexandru Gagniuc
2018-05-22  8:55   ` Rafael J. Wysocki
2018-05-22 13:38     ` Alex G.
2018-05-22 13:50       ` Borislav Petkov
2018-05-22 14:39         ` Alex G.
2018-05-22 14:54           ` Borislav Petkov
2018-05-22 15:22             ` Alex G.
2018-05-22 15:33               ` Borislav Petkov
2018-05-22 17:57             ` Luck, Tony
2018-05-22 18:10               ` Rafael J. Wysocki
2018-05-22 18:19                 ` Alex G.
2018-05-22 18:45                   ` Luck, Tony
2018-05-22 18:49                     ` Alex G.
2018-05-22 18:33                 ` Luck, Tony
2018-05-22 18:13               ` Alex G.
2018-05-22 18:13       ` Rafael J. Wysocki
2018-05-22 18:20         ` Alex G.
2018-05-22 21:20           ` Rafael J. Wysocki
2018-05-21 13:49 ` [PATCH v6 2/2] acpi: apei: Do not panic() on PCIe errors reported through GHES Alexandru Gagniuc
2018-05-21 14:27   ` Tyler Baicar [this message]
2018-05-21 17:40     ` Alex G.
2018-05-22  9:02   ` Rafael J. Wysocki
2018-05-22 14:32     ` Alex G.
2018-05-22 15:15       ` Tyler Baicar
2018-05-22 15:18         ` Alex G.

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=737bea6a-2f0e-e573-754e-2e410c34013e@codeaurora.org \
    --to=tbaicar@codeaurora.org \
    --cc=alex_gagniuc@dellteam.com \
    --cc=austin_bolen@dell.com \
    --cc=bp@alien8.de \
    --cc=gengdongjiu@huawei.com \
    --cc=james.morse@arm.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mr.nuke.me@gmail.com \
    --cc=rjw@rjwysocki.net \
    --cc=shiju.jose@huawei.com \
    --cc=shyam_iyer@dell.com \
    --cc=tony.luck@intel.com \
    --cc=will.deacon@arm.com \
    --cc=zjzhang@codeaurora.org \
    /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