[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53F33001.5000207@arm.com>
Date: Tue, 19 Aug 2014 12:07:45 +0100
From: Sudeep Holla <sudeep.holla@....com>
To: Hanjun Guo <hanjun.guo@...aro.org>,
Catalin Marinas <Catalin.Marinas@....com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Mark Rutland <Mark.Rutland@....com>
CC: Sudeep Holla <sudeep.holla@....com>,
"graeme.gregory@...aro.org" <graeme.gregory@...aro.org>,
Arnd Bergmann <arnd@...db.de>, Olof Johansson <olof@...om.net>,
"grant.likely@...aro.org" <grant.likely@...aro.org>,
Will Deacon <Will.Deacon@....com>,
Jason Cooper <jason@...edaemon.net>,
Marc Zyngier <Marc.Zyngier@....com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Mark Brown <broonie@...nel.org>, Rob Herring <robh@...nel.org>,
Robert Richter <rric@...nel.org>,
Lv Zheng <lv.zheng@...el.com>,
Robert Moore <robert.moore@...el.com>,
Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
Liviu Dudau <Liviu.Dudau@....com>,
Randy Dunlap <rdunlap@...radead.org>,
Charles Garcia-Tobin <Charles.Garcia-Tobin@....com>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linaro-acpi@...ts.linaro.org" <linaro-acpi@...ts.linaro.org>
Subject: Re: [PATCH v2 05/18] ARM64 / ACPI: Parse FADT table to get PSCI flags
for PSCI init
On 19/08/14 11:39, Hanjun Guo wrote:
> On 2014-8-19 2:32, Sudeep Holla wrote:
>> On 04/08/14 16:28, Hanjun Guo wrote:
>>> There are two flags: PSCI_COMPLIANT and PSCI_USE_HVC. When set,
>>> the former signals to the OS that the hardware is PSCI compliant.
>>> The latter selects the appropriate conduit for PSCI calls by
>>> toggling between Hypervisor Calls (HVC) and Secure Monitor Calls
>>> (SMC).
>>>
>>> FADT table contains such information, parse FADT to get the flags
>>> for PSCI init. Since ACPI 5.1 doesn't support self defined PSCI
>>> function IDs, which means that only PSCI 0.2+ is supported in ACPI.
>>>
>>> At the same time, only ACPI 5.1 or higher verison supports PSCI,
>>> and FADT Major.Minor version was introduced in ACPI 5.1, so we
>>> will check the version and only parse FADT table with version >= 5.1.
>>>
>>> If firmware provides ACPI tables with ACPI version less than 5.1,
>>> OS will be messed up with those information and have no way to
>>> bring up secondery CPUs, so disable ACPI if we get an FADT table
>>> with version less that 5.1.
>>>
> [...]
>>>
>>> +static int __init acpi_parse_fadt(struct acpi_table_header *table)
>>> +{
>>> + struct acpi_table_fadt *fadt = (struct acpi_table_fadt *)table;
>>> +
>>> + /*
>>> + * Revision in table header is the FADT Major version,
>>> + * and there is a minor version of FADT which was introduced
>>> + * by ACPI 5.1, we only deal with ACPI 5.1 or higher version
>>> + * to get arm boot flags, or we will disable ACPI.
>>> + */
>>> + if (table->revision < 5 || fadt->minor_revision < 1) {
>>
>> &&
>
> Catalin also pointed out this bug :), but && is not enough, for example,
> this would not trigger of revision 4.1, although 4.1 is not exist, but
> the code will still confusing people, so I updated the code as:
>
Right I missed it :), the below code looks fine.
> + if (table->revision > 5 ||
> + (table->revision == 5 && fadt->minor_revision >= 1)) {
> + return 0;
> + } else {
> + pr_info("FADT revision is %d.%d, no PSCI support, should be 5.1
> or higher\n",
> + table->revision, fadt->minor_revision);
> + disable_acpi();
As suggested elsewhere try to eliminate this and have it once if
acpi_boot_init failed for any reasons.
Regards,
Sudeep
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists