Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp496440imm; Fri, 28 Sep 2018 01:56:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV60piscg7LdsNqVevvXwaKgUlVQdz0JuV9YmoWBq1FHc7zi67q8LY5YI9lrhxxTUoVOPXm+x X-Received: by 2002:a63:1342:: with SMTP id 2-v6mr14155897pgt.19.1538124983960; Fri, 28 Sep 2018 01:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538124983; cv=none; d=google.com; s=arc-20160816; b=B2K/Gvd3utLYCywbImU4QNF2Dr1Fyu4hGnscNHB33JX3NrEplRcOViGe12nQO1OIDP tMc7HK41fXlftgisN+fHJsE0zcxffqnhqO50XBZ0cUiiAgjEpXnco10AbXth+lgIRfzm a+Bb0zR5dnWaGsoPmw3vFyai1YvHOZrq0DcUdzY7A9GuHv/fJuES9/gbM87XHolbYc16 0+QadypRAtPR271w3zuKOY4Q6/byFbA9nt4+5U1bxrpZ/X7kQCF3L1z41AHmYzT+noKr jZ+TWp7EFP+9aytJOtb5BQw7mtzAGfWf2pMe+6KV8UWlbcaMmv8XAEqAPXF9T54o67Dv kmMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=P6+9Cw8Q+GSnZJXpbW6k1tigeS7tlWO3pIqpUOTo5Wg=; b=wO6AD5KYCaMulqoJOrP2DJRWY/huqa81W6UvITx6ew2bpkkk8pZUhTUNcxVDRlne4J lBM2FpM5CwJrbGwv5EEFCLPXs+6PNAiWmg0PJAJYPJD0ofeQnHnOHp5L/9KB4L27UHQ4 +idgogNcCLpmW1CkYGb0vC1SPJ0WOluknP3RJs1o+hlgqnaLUhi/Rhkx+/x3rPwkyJQB hCiHyVy+tf1xH8ei+2dleCOZurBB4MDZrqCmUOEQ4MTNDva1tzkxEPHgLMP84Q+J64PX PaZ1FQAHaodgMCdmNso1EZzGQPUPU3FpKHvt993UoWIAvuJoYnQEPXhBuBZoH/l6cp5r lGEQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12-v6si3992156plp.464.2018.09.28.01.56.07; Fri, 28 Sep 2018 01:56:23 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729122AbeI1PS2 (ORCPT + 99 others); Fri, 28 Sep 2018 11:18:28 -0400 Received: from mga06.intel.com ([134.134.136.31]:10517 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727777AbeI1PS2 (ORCPT ); Fri, 28 Sep 2018 11:18:28 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Sep 2018 01:55:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,314,1534834800"; d="scan'208";a="94246005" Received: from rajneesh-desk.iind.intel.com ([10.223.86.34]) by fmsmga001.fm.intel.com with ESMTP; 28 Sep 2018 01:55:39 -0700 From: Rajneesh Bhardwaj To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: rjw@rjwysocki.net, lenb@kernel.org, rajneesh.bhardwaj@intel.com, Rajneesh Bhardwaj , "Rafael J . Wysocki" , Srinivas Pandruvada Subject: [PATCH] ACPI / LPIT: Register attributes based on FADT Date: Fri, 28 Sep 2018 14:24:02 +0530 Message-Id: <20180928085402.9108-1-rajneesh.bhardwaj@linux.intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ACPI Low Power S0 Idle capabilities are announced via FADT table and can be used to inform the kernel about the presence of one or more Low Power Idle (LPI) entries as descried in LPIT table. LPIT table can exist independently even if the FADT S0 Idle flag is not set and thus it could confuse user since the following cpuidle attributes are created. /sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us /sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us Presence or absence of above attributes could mean that the given platform supports S0ix state or not. This change allows to create the above cpuidle attributes only if FADT table supports Low Power S0 Idle. Cc: Rafael J . Wysocki Cc: Srinivas Pandruvada Signed-off-by: Rajneesh Bhardwaj --- drivers/acpi/acpi_lpit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/acpi/acpi_lpit.c b/drivers/acpi/acpi_lpit.c index cf4fc0161164..e43cb71b6972 100644 --- a/drivers/acpi/acpi_lpit.c +++ b/drivers/acpi/acpi_lpit.c @@ -117,11 +117,17 @@ static void lpit_update_residency(struct lpit_residency_info *info, if (!info->iomem_addr) return; + if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) + return; + /* Silently fail, if cpuidle attribute group is not present */ sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj, &dev_attr_low_power_idle_system_residency_us.attr, "cpuidle"); } else if (info->gaddr.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) { + if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) + return; + /* Silently fail, if cpuidle attribute group is not present */ sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj, &dev_attr_low_power_idle_cpu_residency_us.attr, -- 2.17.1