Ignore:
Timestamp:
Apr 14, 2017, 9:41:36 PM (10 days ago)
Author:
brainslayer
Message:

kernel update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-4.9/drivers/acpi/sysfs.c

    r31574 r31859  
    709709}
    710710
     711/*
     712 * A Quirk Mechanism for GPE Flooding Prevention:
     713 *
     714 * Quirks may be needed to prevent GPE flooding on a specific GPE. The
     715 * flooding typically cannot be detected and automatically prevented by
     716 * ACPI_GPE_DISPATCH_NONE check because there is a _Lxx/_Exx prepared in
     717 * the AML tables. This normally indicates a feature gap in Linux, thus
     718 * instead of providing endless quirk tables, we provide a boot parameter
     719 * for those who want this quirk. For example, if the users want to prevent
     720 * the GPE flooding for GPE 00, they need to specify the following boot
     721 * parameter:
     722 *   acpi_mask_gpe=0x00
     723 * The masking status can be modified by the following runtime controlling
     724 * interface:
     725 *   echo unmask > /sys/firmware/acpi/interrupts/gpe00
     726 */
     727
     728/*
     729 * Currently, the GPE flooding prevention only supports to mask the GPEs
     730 * numbered from 00 to 7f.
     731 */
     732#define ACPI_MASKABLE_GPE_MAX   0x80
     733
     734static u64 __initdata acpi_masked_gpes;
     735
     736static int __init acpi_gpe_set_masked_gpes(char *val)
     737{
     738        u8 gpe;
     739
     740        if (kstrtou8(val, 0, &gpe) || gpe > ACPI_MASKABLE_GPE_MAX)
     741                return -EINVAL;
     742        acpi_masked_gpes |= ((u64)1<<gpe);
     743
     744        return 1;
     745}
     746__setup("acpi_mask_gpe=", acpi_gpe_set_masked_gpes);
     747
     748void __init acpi_gpe_apply_masked_gpes(void)
     749{
     750        acpi_handle handle;
     751        acpi_status status;
     752        u8 gpe;
     753
     754        for (gpe = 0;
     755             gpe < min_t(u8, ACPI_MASKABLE_GPE_MAX, acpi_current_gpe_count);
     756             gpe++) {
     757                if (acpi_masked_gpes & ((u64)1<<gpe)) {
     758                        status = acpi_get_gpe_device(gpe, &handle);
     759                        if (ACPI_SUCCESS(status)) {
     760                                pr_info("Masking GPE 0x%x.\n", gpe);
     761                                (void)acpi_mask_gpe(handle, gpe, TRUE);
     762                        }
     763                }
     764        }
     765}
     766
    711767void acpi_irq_stats_init(void)
    712768{
Note: See TracChangeset for help on using the changeset viewer.