Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1972882ima; Thu, 25 Oct 2018 07:47:00 -0700 (PDT) X-Google-Smtp-Source: AJdET5eGXgwgMayCQf3zDK6HQsGrgBy55RczWXnjWEOmXtioAG5+CbDbUJKv4CGXzNJEvfCLRpdE X-Received: by 2002:a63:fa4e:: with SMTP id g14-v6mr1768019pgk.18.1540478820498; Thu, 25 Oct 2018 07:47:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478820; cv=none; d=google.com; s=arc-20160816; b=H/v2N6x7T1Sow0xMr1nUT8xBhO0ZX3dunjUx1K+X3j/cw/3Mn8T54FRf2X674NXVj9 25MmMqNwKdvHmAahk17D7KJj/wQIAQPNZCYKpb+ZTOwNIxSguRxvuq7ehAr7hBq6Q2KK Lg06lpCINfmRkSlo/YvLOFC3L+tjBU9Qee/vRKHYSw0hbzGjNv/TZRPIGkS4L8WViwWV v69KGbgnby/CjrnkjBplWKXJ5unKDRW1TvWVwSaHxb3VFV+BJ7T6j/hfj1mylBgGTfPl ETfxn5D8LNbyRRX1VVqsxQ5+XlvMW4reZ5VCIxUMm52Dz5T1F44VYe14My3GlJjJh+xA BR4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=/sb4dPyqcMNlf8AihQiYWqItUE0OYJNU/n6ARlv8z5Q=; b=k9tQboBqCszMPMstmd0Bftejw8bZaIEjGeIGPQhjIq0Ej/L9cv/OzdQM0ylhu4Ii3y dYKT8xsjzzIu5lcB55RQc+VeKd1zkUDWQ6J8lBY4iLHquy8fCC8djipq7eHtCBiLB/K5 /41EzqEJQtkDLesazJt7JhXtS3iTupkeMkYba4NexFL1UwEp0etzOP5QBIe9JPDNmEAM zjEDHNhjkpwWkeuq6MYBK7Pygw6o4SLQv+a+B1GdxdPMQsgk4o+zJI7X+9J8NxsdjkiU FYTAmuAduhKkbkZDBKLLWto0QDy0Et//vNlY/n56XNyEtwFZIH/AE0Bde2StODRTi49m lklw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ih8BCj+p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w22-v6si8416304plk.377.2018.10.25.07.46.44; Thu, 25 Oct 2018 07:47:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ih8BCj+p; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728588AbeJYWrh (ORCPT + 99 others); Thu, 25 Oct 2018 18:47:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:55680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728565AbeJYWrg (ORCPT ); Thu, 25 Oct 2018 18:47:36 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B85AA2084A; Thu, 25 Oct 2018 14:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476879; bh=6S13dGVu7fyyO0kHmmj6FPNmb2tcYTvpAPR0LOGelkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ih8BCj+p0DupWu7P0rNLvLpvmMBChX0b0pIkusCd5Anth30t0NSwIctjv8gY7koJ/ SmpLC4aIfC160lgzeGdeLSbLk9HZpCTShTLxwjpZOZvhz1Fd2jH0sD+EaWSfuHFXhn 5dq4JOwvAlp2DqQ4v83gmrWhvamlTT1C50UwM69s= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Prarit Bhargava , "Rafael J . Wysocki" , Sasha Levin Subject: [PATCH AUTOSEL 4.9 08/98] ACPI: sysfs: Make ACPI GPE mask kernel parameter cover all GPEs Date: Thu, 25 Oct 2018 10:12:53 -0400 Message-Id: <20181025141423.213774-8-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141423.213774-1-sashal@kernel.org> References: <20181025141423.213774-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Prarit Bhargava [ Upstream commit 0f27cff8597d86f881ea8274b49b63b678c14a3c ] The acpi_mask_gpe= kernel parameter documentation states that the range of mask is 128 GPEs (0x00 to 0x7F). The acpi_masked_gpes mask is a u64 so only 64 GPEs (0x00 to 0x3F) can really be masked. Use a bitmap of size 0xFF instead of a u64 for the GPE mask so 256 GPEs can be masked. Fixes: 9c4aa1eecb48 (ACPI / sysfs: Provide quirk mechanism to prevent GPE flooding) Signed-off-by: Prarit Bharava Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- Documentation/kernel-parameters.txt | 1 - drivers/acpi/sysfs.c | 26 ++++++++------------------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index f9f67be8d3c3..c708a50b060e 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -313,7 +313,6 @@ bytes respectively. Such letter suffixes can also be entirely omitted. This facility can be used to prevent such uncontrolled GPE floodings. Format: - Support masking of GPEs numbered from 0x00 to 0x7f. acpi_no_auto_serialize [HW,ACPI] Disable auto-serialization of AML methods diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index cf05ae973381..a36d0739dbfe 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -724,14 +724,8 @@ static ssize_t counter_set(struct kobject *kobj, * interface: * echo unmask > /sys/firmware/acpi/interrupts/gpe00 */ - -/* - * Currently, the GPE flooding prevention only supports to mask the GPEs - * numbered from 00 to 7f. - */ -#define ACPI_MASKABLE_GPE_MAX 0x80 - -static u64 __initdata acpi_masked_gpes; +#define ACPI_MASKABLE_GPE_MAX 0xFF +static DECLARE_BITMAP(acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX) __initdata; static int __init acpi_gpe_set_masked_gpes(char *val) { @@ -739,7 +733,7 @@ static int __init acpi_gpe_set_masked_gpes(char *val) if (kstrtou8(val, 0, &gpe) || gpe > ACPI_MASKABLE_GPE_MAX) return -EINVAL; - acpi_masked_gpes |= ((u64)1<