ACPI: sysfs: Change ACPI_MASKABLE_GPE_MAX to 0x100
The commit0f27cff859
("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:0f27cff859
("ACPI: sysfs: Make ACPI GPE mask kernel parameter cover all GPEs") Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com> [ rjw: Use u16 as gpe data type in acpi_gpe_apply_masked_gpes() ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Родитель
af42d3466b
Коммит
a7583e72a5
|
@ -113,7 +113,7 @@
|
||||||
the GPE dispatcher.
|
the GPE dispatcher.
|
||||||
This facility can be used to prevent such uncontrolled
|
This facility can be used to prevent such uncontrolled
|
||||||
GPE floodings.
|
GPE floodings.
|
||||||
Format: <int>
|
Format: <byte>
|
||||||
|
|
||||||
acpi_no_auto_serialize [HW,ACPI]
|
acpi_no_auto_serialize [HW,ACPI]
|
||||||
Disable auto-serialization of AML methods
|
Disable auto-serialization of AML methods
|
||||||
|
|
|
@ -819,14 +819,14 @@ end:
|
||||||
* interface:
|
* interface:
|
||||||
* echo unmask > /sys/firmware/acpi/interrupts/gpe00
|
* echo unmask > /sys/firmware/acpi/interrupts/gpe00
|
||||||
*/
|
*/
|
||||||
#define ACPI_MASKABLE_GPE_MAX 0xFF
|
#define ACPI_MASKABLE_GPE_MAX 0x100
|
||||||
static DECLARE_BITMAP(acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX) __initdata;
|
static DECLARE_BITMAP(acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX) __initdata;
|
||||||
|
|
||||||
static int __init acpi_gpe_set_masked_gpes(char *val)
|
static int __init acpi_gpe_set_masked_gpes(char *val)
|
||||||
{
|
{
|
||||||
u8 gpe;
|
u8 gpe;
|
||||||
|
|
||||||
if (kstrtou8(val, 0, &gpe) || gpe > ACPI_MASKABLE_GPE_MAX)
|
if (kstrtou8(val, 0, &gpe))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
set_bit(gpe, acpi_masked_gpes_map);
|
set_bit(gpe, acpi_masked_gpes_map);
|
||||||
|
|
||||||
|
@ -838,7 +838,7 @@ void __init acpi_gpe_apply_masked_gpes(void)
|
||||||
{
|
{
|
||||||
acpi_handle handle;
|
acpi_handle handle;
|
||||||
acpi_status status;
|
acpi_status status;
|
||||||
u8 gpe;
|
u16 gpe;
|
||||||
|
|
||||||
for_each_set_bit(gpe, acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX) {
|
for_each_set_bit(gpe, acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX) {
|
||||||
status = acpi_get_gpe_device(gpe, &handle);
|
status = acpi_get_gpe_device(gpe, &handle);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче