Skip to content

Commit a7583e7

Browse files
yeyunfeng-devrafaeljw
authored andcommitted
ACPI: sysfs: Change ACPI_MASKABLE_GPE_MAX to 0x100
The commit 0f27cff ("ACPI: sysfs: Make ACPI GPE mask kernel parameter cover all GPEs") says: "Use a bitmap of size 0xFF instead of a u64 for the GPE mask so 256 GPEs can be masked" But the masking of GPE 0xFF it not supported and the check condition "gpe > ACPI_MASKABLE_GPE_MAX" is not valid because the type of gpe is u8. So modify the macro ACPI_MASKABLE_GPE_MAX to 0x100, and drop the "gpe > ACPI_MASKABLE_GPE_MAX" check. In addition, update the docs "Format" for acpi_mask_gpe parameter. Fixes: 0f27cff ("ACPI: sysfs: Make ACPI GPE mask kernel parameter cover all GPEs") Signed-off-by: Yunfeng Ye <[email protected]> [ rjw: Use u16 as gpe data type in acpi_gpe_apply_masked_gpes() ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent af42d34 commit a7583e7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-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: <int>
116+
Format: <byte>
117117

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

drivers/acpi/sysfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -819,14 +819,14 @@ static ssize_t counter_set(struct kobject *kobj,
819819
* interface:
820820
* echo unmask > /sys/firmware/acpi/interrupts/gpe00
821821
*/
822-
#define ACPI_MASKABLE_GPE_MAX 0xFF
822+
#define ACPI_MASKABLE_GPE_MAX 0x100
823823
static DECLARE_BITMAP(acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX) __initdata;
824824

825825
static int __init acpi_gpe_set_masked_gpes(char *val)
826826
{
827827
u8 gpe;
828828

829-
if (kstrtou8(val, 0, &gpe) || gpe > ACPI_MASKABLE_GPE_MAX)
829+
if (kstrtou8(val, 0, &gpe))
830830
return -EINVAL;
831831
set_bit(gpe, acpi_masked_gpes_map);
832832

@@ -838,7 +838,7 @@ void __init acpi_gpe_apply_masked_gpes(void)
838838
{
839839
acpi_handle handle;
840840
acpi_status status;
841-
u8 gpe;
841+
u16 gpe;
842842

843843
for_each_set_bit(gpe, acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX) {
844844
status = acpi_get_gpe_device(gpe, &handle);

0 commit comments

Comments
 (0)