From: Dominik Brodowski <linux@dominikbrodowski.net>
To: rjw@rjwysocki.net
Cc: linux-acpi@vger.kernel.org, mario_limonciello@dell.com,
broonie@kernel.org, matthew.garrett@coreos.com,
alsa-devel@alsa-project.org,
Dominik Brodowski <linux@dominikbrodowski.net>
Subject: [PATCH 2/4] acpi: allow for an override to set _REV
Date: Thu, 14 May 2015 15:31:26 +0200 [thread overview]
Message-ID: <1431610288-26737-3-git-send-email-linux@dominikbrodowski.net> (raw)
In-Reply-To: <1431610288-26737-1-git-send-email-linux@dominikbrodowski.net>
By using a module parameter named acpi.supported_rev=<value>, the BIOS
may be told a different supported ACPI revision compared to the default
(which currently is 5, but will be modified to 2 when the revert of
b1ef29725865 is reverted).
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
Documentation/kernel-parameters.txt | 14 ++++++++++++++
drivers/acpi/osl.c | 16 ++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 61ab162..75f1f8e 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -335,6 +335,20 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
to assume that this machine's pmtimer latches its value
and always returns good values.
+ acpi.rev= [HW,ACPI]
+ Tell ACPI BIOS the supported ACPI REV
+ Format: <int> in range 0..5
+ Up to and including Linux v4.1, the BIOS was told which
+ ACPI revision the ACPICA subsystem in Linux actually
+ supports (which was 5 at the time); from v4.2 on, this
+ value will be set statically to 2 to match the behavior
+ of other ACPI implementations. As some BIOS may operate
+ differently depending on which value _REV is set to, this
+ parameter offers the capability to specify what to export
+ to the BIOS. Note that such changes in the behavior of
+ the BIOS may only be visible after cold booting the
+ system with this parameter _twice_.
+
acpi_sci= [HW,ACPI] ACPI System Control Interrupt trigger mode
Format: { level | edge | high | low }
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index db14a66..caa52f7 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -538,6 +538,11 @@ acpi_os_get_physical_address(void *virt, acpi_physical_address * phys)
static char acpi_os_name[ACPI_MAX_OVERRIDE_LEN];
+/* acpi_supported_rev is 0 in case of no override; overrides are limited to
+ * values between 1 to 5. To simplify casting, use an unsigned long */
+static unsigned long acpi_supported_rev;
+module_param_named(rev, acpi_supported_rev, ulong, 0);
+
acpi_status
acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
char **new_val)
@@ -552,6 +557,17 @@ acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
*new_val = acpi_os_name;
}
+ if (!memcmp(init_val->name, "_REV", 4) && (acpi_supported_rev > 0)) {
+ if (acpi_supported_rev <= 5) {
+ printk(KERN_INFO PREFIX
+ "Overriding _REV definition to %lu\n",
+ acpi_supported_rev);
+ *new_val = (char *) acpi_supported_rev;
+ } else
+ printk(KERN_INFO PREFIX
+ "_REV override must be between 1 to 5");
+ }
+
return AE_OK;
}
--
2.1.4
next prev parent reply other threads:[~2015-05-14 13:36 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-14 13:31 [PATCH 0/4] ACPI: provide an override for _REV Dominik Brodowski
2015-05-14 13:31 ` [PATCH 1/4] acpi: use same type for acpi_predefined_names values as in definition Dominik Brodowski
2015-05-14 13:31 ` Dominik Brodowski [this message]
2015-05-14 14:18 ` [PATCH 2/4] acpi: allow for an override to set _REV Dominik Brodowski
2015-05-14 20:36 ` Rafael J. Wysocki
2015-05-14 21:55 ` Rafael J. Wysocki
2015-05-17 17:41 ` Dominik Brodowski
2015-05-18 1:01 ` Rafael J. Wysocki
2015-05-18 4:47 ` Dominik Brodowski
2015-05-21 1:24 ` Rafael J. Wysocki
2015-05-21 10:24 ` Dominik Brodowski
2015-05-22 1:11 ` Rafael J. Wysocki
2015-05-21 18:10 ` Matthew Garrett
2015-05-21 18:18 ` Mario Limonciello
2015-05-22 1:13 ` Rafael J. Wysocki
2015-05-22 21:19 ` Mario_Limonciello
2015-05-22 22:15 ` Rafael J. Wysocki
2015-06-30 20:11 ` Rafael J. Wysocki
2015-05-22 1:02 ` Rafael J. Wysocki
2015-05-14 13:31 ` [PATCH 3/4] acpi: add _REV quirk for Dell XPS 13 (2015) Dominik Brodowski
2015-05-14 13:31 ` [PATCH 4/4] acpi: fix kernel-parameters ordering in Documentation Dominik Brodowski
2015-05-14 20:31 ` [PATCH 0/4] ACPI: provide an override for _REV Rafael J. Wysocki
2015-05-14 23:56 ` Rafael J. Wysocki
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=1431610288-26737-3-git-send-email-linux@dominikbrodowski.net \
--to=linux@dominikbrodowski.net \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=mario_limonciello@dell.com \
--cc=matthew.garrett@coreos.com \
--cc=rjw@rjwysocki.net \
/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