Skip to content

Commit d3121e6

Browse files
andy-shevrafaeljw
authored andcommitted
ACPI: sysfs: Allow bitmap list to be supplied to acpi_mask_gpe
Currently we need to use as many acpi_mask_gpe options as we want to have GPEs to be masked. Even with two it already becomes inconveniently large the kernel command line. Instead, allow acpi_mask_gpe to represent bitmap list. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent bdd56d7 commit d3121e6

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
the GPE dispatcher.
114114
This facility can be used to prevent such uncontrolled
115115
GPE floodings.
116-
Format: <byte>
116+
Format: <byte> or <bitmap-list>
117117

118118
acpi_no_auto_serialize [HW,ACPI]
119119
Disable auto-serialization of AML methods

drivers/acpi/sysfs.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#define pr_fmt(fmt) "ACPI: " fmt
77

8+
#include <linux/bitmap.h>
89
#include <linux/init.h>
910
#include <linux/kernel.h>
1011
#include <linux/moduleparam.h>
@@ -790,6 +791,7 @@ static ssize_t counter_set(struct kobject *kobj,
790791
* the GPE flooding for GPE 00, they need to specify the following boot
791792
* parameter:
792793
* acpi_mask_gpe=0x00
794+
* Note, the parameter can be a list (see bitmap_parselist() for the details).
793795
* The masking status can be modified by the following runtime controlling
794796
* interface:
795797
* echo unmask > /sys/firmware/acpi/interrupts/gpe00
@@ -799,11 +801,16 @@ static DECLARE_BITMAP(acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX) __initdata;
799801

800802
static int __init acpi_gpe_set_masked_gpes(char *val)
801803
{
804+
int ret;
802805
u8 gpe;
803806

804-
if (kstrtou8(val, 0, &gpe))
805-
return -EINVAL;
806-
set_bit(gpe, acpi_masked_gpes_map);
807+
ret = kstrtou8(val, 0, &gpe);
808+
if (ret) {
809+
ret = bitmap_parselist(val, acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX);
810+
if (ret)
811+
return ret;
812+
} else
813+
set_bit(gpe, acpi_masked_gpes_map);
807814

808815
return 1;
809816
}

0 commit comments

Comments
 (0)