Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp870983pxj; Wed, 16 Jun 2021 15:55:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy25oedDWE4zc4wUDgZOTskbuNNfd8qJGOZon8XhzEFXCy7+aQ4MfwcyTTLemrxAOIDkbPs X-Received: by 2002:a92:2a0a:: with SMTP id r10mr1331148ile.274.1623884138064; Wed, 16 Jun 2021 15:55:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623884138; cv=none; d=google.com; s=arc-20160816; b=sKsbZaURbrEiWQ/N6lCUDnYOiEWNHX4JA7qhCmRX+EKblXaisPFNCtMHwRP5mD3hc2 GKuHtLNkFSAc/KRbXha2W2YwEzEG1niryr4IYDew2VWsAYKCad+N0FYJwiCrTQxZWqbu 2Onmynig170PdyxUrNsiM0d4obn3SyLCGR6EXEbqfi0WkieeAgDiDw/vh9TGIVthsWR5 2zudprs+DJm5iTtWew7NVZAJ+EolQBua7xSL7k2l7hEZT4Z0hRqW3cFKNvku6W5hQMTl 6PA6N+T8lFJeOuCQF060sfN5NiRuMkKBDO+3gJ88NZyzZFJw2P44rxbtYRIMksmjDdCs aWpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=FvNuag8qksjdRyzpPuBxXC+FBcDb0ZrYoIGXqQDeF5Y=; b=WHu66lAGTAWYCM9JbBHlkmR4M/cEVfGNPiMugrvTZ7rxVhhjgtTX1wCNpSRQEpd6RE Dx6nvb9gs4e1P7oASKMTxmigHzkE6ywkAYqYF/TRDTrWsawK2thw4WcG9Ru6bUeHWu1A pTRcVPeJXm6PBdcS8+qPZkGAbmoBBRu3R9aPOxlFapsOW/pUd3vS65qgTKg7OKfGpDCs DTnI5BOo4QmUW25AThVwW6b/6x8cPaQFtqT/tx1rE6/qpvD1omSqH+QYvPfl7T/xCF1U 7si9PKArO7+eByRWkvYEvJ3bBfM95olpsCkMI5InZGyBRuQIB04wPlL6O1rijRr+LMHV Iasw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m2si4648488ilu.120.2021.06.16.15.55.26; Wed, 16 Jun 2021 15:55:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230162AbhFPRGL (ORCPT + 99 others); Wed, 16 Jun 2021 13:06:11 -0400 Received: from mga02.intel.com ([134.134.136.20]:16774 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231184AbhFPRFs (ORCPT ); Wed, 16 Jun 2021 13:05:48 -0400 IronPort-SDR: 1duNbgzm0SglgN5aMKdzU26IefBwuGA08ZOE7VAC7MxyihZnFppMPcaycjpUbqSc1KT3PtFXAh fT1gyC0DOSvg== X-IronPort-AV: E=McAfee;i="6200,9189,10016"; a="193340152" X-IronPort-AV: E=Sophos;i="5.83,278,1616482800"; d="scan'208";a="193340152" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2021 10:03:33 -0700 IronPort-SDR: NsXH8bBHoq5LGBySL4CA7URPewhSFECNvRvI9t3nN5MiZJ7oPSHMd6iujIfd1cwvqDMUosKUuO 6bY6bK/9OZvQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,278,1616482800"; d="scan'208";a="479167399" Received: from black.fi.intel.com ([10.237.72.28]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jun 2021 10:03:29 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 29F5F2DA; Wed, 16 Jun 2021 20:03:54 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org Cc: Jonathan Corbet , "Rafael J. Wysocki" , Len Brown Subject: [PATCH v1 2/7] ACPI: sysfs: Allow bitmap list to be supplied to acpi_mask_gpe Date: Wed, 16 Jun 2021 20:03:33 +0300 Message-Id: <20210616170338.23057-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210616170338.23057-1-andriy.shevchenko@linux.intel.com> References: <20210616170338.23057-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently we need to use as many acpi_mask_gpe options as we want to have GPEs to be masked. Even with two it already becomes inconveniently large the kernel command line. Instead, allow acpi_mask_gpe to represent bitmap list. Signed-off-by: Andy Shevchenko --- Documentation/admin-guide/kernel-parameters.txt | 2 +- drivers/acpi/sysfs.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index a06a8bfb02a4..c00792362d28 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: or 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 767aa65e4bdd..44e50c36e70a 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c @@ -5,6 +5,7 @@ #define pr_fmt(fmt) "ACPI: " fmt +#include #include #include #include @@ -794,6 +795,7 @@ static ssize_t counter_set(struct kobject *kobj, * the GPE flooding for GPE 00, they need to specify the following boot * parameter: * acpi_mask_gpe=0x00 + * Note, the parameter can be a list (see bitmap_parselist() for the details). * The masking status can be modified by the following runtime controlling * interface: * echo unmask > /sys/firmware/acpi/interrupts/gpe00 @@ -803,11 +805,16 @@ static DECLARE_BITMAP(acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX) __initdata; static int __init acpi_gpe_set_masked_gpes(char *val) { + int ret; u8 gpe; - if (kstrtou8(val, 0, &gpe)) - return -EINVAL; - set_bit(gpe, acpi_masked_gpes_map); + ret = kstrtou8(val, 0, &gpe); + if (ret) { + ret = bitmap_parselist(val, acpi_masked_gpes_map, ACPI_MASKABLE_GPE_MAX); + if (ret) + return ret; + } else + set_bit(gpe, acpi_masked_gpes_map); return 1; } -- 2.30.2