Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2483416ybc; Wed, 13 Nov 2019 15:22:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzyx25Ny9PHCVXJOC+f+fczntav7U5GdfKEqbTht/7l3maZ+hjv7cxIo6gqmnE4dajd8CFr X-Received: by 2002:a17:906:7c4e:: with SMTP id g14mr5376014ejp.150.1573687364938; Wed, 13 Nov 2019 15:22:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573687364; cv=none; d=google.com; s=arc-20160816; b=Ay9FpFMf43OzotZp6Y812HwN9EldEQWBpPelPQDJ1UtgPefAU3z/8pPBT/6aL0wgpb cD5k1O4s85gNduADc22EZcek+oI+6nwMEghGVWxESh6qAcbukNp78loDr1L7B/XadtPa NmNnldCKCdt7I+uFOEQPLM0ARtC98E1qIRB3XXgAIDcP/m82jh08qOcMdJK0Wjif11Tv Ei+GXj8flj8h3l77S3MKhuOR2mlN/tFA2AQr0DS5tvwqSEoaTNKr5h5xxV4qn5JtdYtQ rgwjal8RHLUjoOWK6KtHjPFmPowRxYFyipMJ3G/lJSNFOQ502u5TLBNp5DjWRwRaFz1f +WYA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=XWPzE0vdoUFXYVrdLOU5+2zT4FA7uKsUE7e7Xoc7K/o=; b=bN/kc6PHSW19K6yPMHn4rLdhP4wo5QoLxAxAO9xQlnHAeTWIBsMtnJCxfIprYOwxmX 5yJEu/hFCfo5SQkekhD0gi3BwYxTSKDkkwfQFd0ujMFtiuTY8DEumj903ImJqhhQk6dn +FWgoLIFjHLR9pCAeYUVRTwZ04A5dwmylan4EwkqmLrWNdpgLne1VTPQMGXGn33lO08i 3sSm4nYPlI/97ETH7FU4ABjf7ruuGkJFP23TrNdcog4xOwt89pVyPu9Q1m4SUGkCLjCF qTIKVEeLcJXjBBB+koEaeUYXOiGuQEzYf3APTl4AvZ+YWTXs0nF6mT56j5jW/07equ6b gduA== 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 y9si1519545eju.209.2019.11.13.15.22.20; Wed, 13 Nov 2019 15:22:44 -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 S1727041AbfKMXVg (ORCPT + 99 others); Wed, 13 Nov 2019 18:21:36 -0500 Received: from cloudserver094114.home.pl ([79.96.170.134]:55249 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726395AbfKMXVg (ORCPT ); Wed, 13 Nov 2019 18:21:36 -0500 Received: from 79.184.253.153.ipv4.supernova.orange.pl (79.184.253.153) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.292) id 55c8f715c53ddc9c; Thu, 14 Nov 2019 00:21:34 +0100 From: "Rafael J. Wysocki" To: Yunfeng Ye Cc: lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, "hushiyuan@huawei.com" , "linfeilong@huawei.com" Subject: Re: [PATCH] ACPI: sysfs: Change ACPI_MASKABLE_GPE_MAX to 0x100 Date: Thu, 14 Nov 2019 00:21:33 +0100 Message-ID: <2931286.GRae9fBGx2@kreacher> In-Reply-To: <8bdc7a86-e464-9c46-3d40-4f3c75111ce6@huawei.com> References: <8bdc7a86-e464-9c46-3d40-4f3c75111ce6@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, November 5, 2019 3:35:25 PM CET Yunfeng Ye wrote: > There are two problems after commit 0f27cff8597d ("ACPI: sysfs: Make > ACPI GPE mask kernel parameter cover all GPEs"): > > 1. ACPI_MASKABLE_GPE_MAX is changed from 0x80 to 0xff, so the check > condition "gpe > ACPI_MASKABLE_GPE_MAX" is not valid because the type of > gpe is u8. > > 2. The size of bitmap is ACPI_MASKABLE_GPE_MAX, so it is not support the > num 255 for gpe. > > Update the macro ACPI_MASKABLE_GPE_MAX to 0x100, and change the type of > gpe to u32, also modify the checking condition for gpe. > > Bye the way, update the docs for kernel parameter acpi_mask_gpe. > > Fixes: 0f27cff8597d ("ACPI: sysfs: Make ACPI GPE mask kernel parameter cover all GPEs") > Signed-off-by: Yunfeng Ye AFAICS this really is about supporting the masking of GPE 0xFF. > --- > Documentation/admin-guide/kernel-parameters.txt | 1 + > drivers/acpi/sysfs.c | 8 ++++---- > 2 files changed, 5 insertions(+), 4 deletions(-) > > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index a84a83f8881e..dd878e2491e1 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -114,6 +114,7 @@ > This facility can be used to prevent such uncontrolled > GPE floodings. > Format: > + Support masking of GPEs numbered from 0x00 to 0xff Why not just say "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..3c3302583d78 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 So this is the only change that's necessary AFAICS. > static DECLARE_BITMAP(acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX) __initdata; > > static int __init acpi_gpe_set_masked_gpes(char *val) > { > - u8 gpe; > + u32 gpe; > > - if (kstrtou8(val, 0, &gpe) || gpe > ACPI_MASKABLE_GPE_MAX) And here you can drop the ACPI_MASKABLE_GPE_MAX check and the rest can remain as is. > + if (kstrtouint(val, 0, &gpe) || gpe >= ACPI_MASKABLE_GPE_MAX) > return -EINVAL; > set_bit(gpe, acpi_masked_gpes_map); > > @@ -838,7 +838,7 @@ void __init acpi_gpe_apply_masked_gpes(void) > { > acpi_handle handle; > acpi_status status; > - u8 gpe; > + u32 gpe; > > for_each_set_bit(gpe, acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX) { > status = acpi_get_gpe_device(gpe, &handle); >