From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: "Huang, Ying" <ying.huang@intel.com>, Borislav Petkov <bp@suse.de>
Cc: Len Brown <lenb@kernel.org>,
Tomasz Nowicki <tomasz.nowicki@linaro.org>,
Tony Luck <tony.luck@intel.com>, Fu Wei <fu.wei@linaro.org>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ACPI, APEI: Fix BERT resources conflict with ACPI NVS area
Date: Thu, 16 Feb 2017 00:42 +0100 [thread overview]
Message-ID: <4305135.N5b65JQej5@aspire.rjw.lan> (raw)
In-Reply-To: <20170214020143.29713-1-ying.huang@intel.com>
On Tuesday, February 14, 2017 10:01:13 AM Huang, Ying wrote:
> From: Huang Ying <ying.huang@intel.com>
>
> It was reported that some firmware will use ACPI NVS area for BERT
> address range. This will cause resources conflict because the ACPI
> NVS area is marked as busy already. Fix this via excluding ACPI NVS
> area when requesting IO resources for BERT.
>
> Reported-and-tested-by: Hans Kristian Rosbach <hansr@raskesider.no>
> Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
Boris, what do you think?
> ---
> drivers/acpi/apei/bert.c | 20 ++++++++++++--------
> 1 file changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/acpi/apei/bert.c b/drivers/acpi/apei/bert.c
> index a05b5c0cf181..12771fcf0417 100644
> --- a/drivers/acpi/apei/bert.c
> +++ b/drivers/acpi/apei/bert.c
> @@ -97,6 +97,7 @@ static int __init bert_check_table(struct acpi_table_bert *bert_tab)
>
> static int __init bert_init(void)
> {
> + struct apei_resources bert_resources;
> struct acpi_bert_region *boot_error_region;
> struct acpi_table_bert *bert_tab;
> unsigned int region_len;
> @@ -127,13 +128,14 @@ static int __init bert_init(void)
> }
>
> region_len = bert_tab->region_length;
> - if (!request_mem_region(bert_tab->address, region_len, "APEI BERT")) {
> - pr_err("Can't request iomem region <%016llx-%016llx>.\n",
> - (unsigned long long)bert_tab->address,
> - (unsigned long long)bert_tab->address + region_len - 1);
> - return -EIO;
> - }
> -
> + apei_resources_init(&bert_resources);
> + rc = apei_resources_add(&bert_resources, bert_tab->address,
> + region_len, true);
> + if (rc)
> + return rc;
> + rc = apei_resources_request(&bert_resources, "APEI BERT");
> + if (rc)
> + goto out_fini;
> boot_error_region = ioremap_cache(bert_tab->address, region_len);
> if (boot_error_region) {
> bert_print_all(boot_error_region, region_len);
> @@ -142,7 +144,9 @@ static int __init bert_init(void)
> rc = -ENOMEM;
> }
>
> - release_mem_region(bert_tab->address, region_len);
> + apei_resources_release(&bert_resources);
> +out_fini:
> + apei_resources_fini(&bert_resources);
>
> return rc;
> }
>
next prev parent reply other threads:[~2017-02-15 23:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-14 2:01 Huang, Ying
2017-02-14 18:44 ` Baicar, Tyler
2017-02-15 23:42 ` Rafael J. Wysocki [this message]
2017-02-16 9:52 ` Borislav Petkov
2017-02-16 10:24 ` Huang, Ying
2017-02-16 10:32 ` Borislav Petkov
2017-02-17 0:31 ` Huang, Ying
2017-02-17 10:02 ` Borislav Petkov
2017-02-20 0:56 ` Huang, Ying
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=4305135.N5b65JQej5@aspire.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=bp@suse.de \
--cc=fu.wei@linaro.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tomasz.nowicki@linaro.org \
--cc=tony.luck@intel.com \
--cc=ying.huang@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
all inboxes | Powered by JetHome®