Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2846835ybc; Wed, 13 Nov 2019 23:20:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwgyUGF6egE3pTnpHRHxscWIeHOmy8DS2paJTyoJxwk/XDbAoIBvpAxaMpnwlDLiRT4Fv4t X-Received: by 2002:aa7:c954:: with SMTP id h20mr8350073edt.159.1573716037326; Wed, 13 Nov 2019 23:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573716037; cv=none; d=google.com; s=arc-20160816; b=u46OQHYASHhPjnl0VxSFQSHNCRGRMyiPUPGMT+txSLw/P26DA3nd0Sz7j5i+W2gWjx IC8wtciGSyYPXq1bVl+0UgL6kT3WaLHWAV42mEk2iYomeCbJJ3fjl+ANn5SkKTMljAWo FFrXlViViLfKsmnxmQfjpJ1T4x31SOnXjWjLvdpmmEuhwU0n/MHEhwDqdkJ1U3Cldawe vA7VFkZj2pSCHocOHxVrNbmhy3y6Ot173l4aiGxwqZtI4o6u3CKyzNhDow53H9KDLvmx 7qJa6YjR2jweVE2hwfogpEKvo6KmjPIncFZ33ptuIG28jazFH8I9ooWwjNvgfPuIbUJY 1ruw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:mime-version:user-agent:date:message-id:subject :from:cc:to; bh=oyF13r9b4odw68OhgBfySz9M2gCINgSITUehwGPQOKg=; b=Q6scq7wBFrPKYJ8+lmKv3ZnP+j3vfuZ0VTl/FySowDPVEKlkXjQloYtth4yJIyKHhB WlEBULMXk/rFVDmlU7PgsQOWwfYbpMxs7/Q1fUGD3TBGeIHPeTIH6GNvhmMlH9nR0yF0 XqCenhGW5A8dCCjC6pN2rGE0iK7prr3q0E5EP4Aon8fcM378HHVSl0yu2pemhNO1QlVl 4i7odiY9smZnLKziqmLtud687Ncg/uT2VJ0J/taxTdpBVq2layKsR4Z5OuxUiY+6lcwA RnrpZAn+5Z2j4KcVau+eBUtm+u1S6DrUpZiAIdDLImDcwf/XVFresOPuHE+nURANh0aM Ad9Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c6si2987323edr.294.2019.11.13.23.20.13; Wed, 13 Nov 2019 23:20:37 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726590AbfKNHQn (ORCPT + 99 others); Thu, 14 Nov 2019 02:16:43 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:6227 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725838AbfKNHQm (ORCPT ); Thu, 14 Nov 2019 02:16:42 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 3930F728594AE501539C; Thu, 14 Nov 2019 15:16:40 +0800 (CST) Received: from [127.0.0.1] (10.177.251.225) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.439.0; Thu, 14 Nov 2019 15:16:33 +0800 To: , CC: , , , "hushiyuan@huawei.com" , "linfeilong@huawei.com" From: Yunfeng Ye Subject: [PATCH v2] ACPI: sysfs: Change ACPI_MASKABLE_GPE_MAX to 0x100 Message-ID: Date: Thu, 14 Nov 2019 15:16:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.251.225] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit 0f27cff8597d ("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: 0f27cff8597d ("ACPI: sysfs: Make ACPI GPE mask kernel parameter cover all GPEs") Signed-off-by: Yunfeng Ye --- v1 -> v2: - drop the "gpe > ACPI_MASKABLE_GPE_MAX" check - update the docs "Format" from to for acpi_mask_gpe parameter - update the commit comment Documentation/admin-guide/kernel-parameters.txt | 2 +- drivers/acpi/sysfs.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index a84a83f8881e..87e27186dc69 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -113,7 +113,7 @@ the GPE dispatcher. This facility can be used to prevent such uncontrolled GPE floodings. - Format: + Format: 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 75948a3f1a20..0a83ce186bc4 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -819,14 +819,14 @@ static ssize_t counter_set(struct kobject *kobj, * interface: * 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 int __init acpi_gpe_set_masked_gpes(char *val) { u8 gpe; - if (kstrtou8(val, 0, &gpe) || gpe > ACPI_MASKABLE_GPE_MAX) + if (kstrtou8(val, 0, &gpe)) return -EINVAL; set_bit(gpe, acpi_masked_gpes_map); -- 2.7.4