Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp227014imm; Fri, 5 Oct 2018 02:49:33 -0700 (PDT) X-Google-Smtp-Source: ACcGV60mDW4mM6opNJAdi4ztMjLdZ1p6HRrbLKh2w05wbyZ1fPyOG+KiJ6PcjBtu4iaOe/lpqJ4W X-Received: by 2002:a63:df06:: with SMTP id u6-v6mr9409428pgg.202.1538732973451; Fri, 05 Oct 2018 02:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538732973; cv=none; d=google.com; s=arc-20160816; b=RTUEp+hKTmLrvt4B9BdUi8vmtb75NXCAV/SVaNFpm6JyPfO2wIhDrW0WbDSyZ3MS8g 44DvKuYH8xl6UFwUhtknhahlpOE/566kJJWxvlDU7y4eTeYSuKqimMwjKco0WIFLxgAm CFx2gmEHgeLIJ8O+2RDRj5ZDUUKnzJJIHAJP0kDAXZS0K6cO/cKtnfPUjNXrO64GyJpO +j+p0+pE2jRE7yUhhdi497z/4VOdq9BkN6l8N3flTa8ZcN7I2NcA/dhtkqXmd6qHqDBS kLpsNxle2URmWbT2/lq5AlES4n9Ww/zR2Ss/0ax4cRz0cozr2xkkp4kfX8RmykJ89KrG 2B1A== 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=o8O62YG65Lxa+Dej77F8Og3eOa3NViZ4oxXUWvlk4DE=; b=hojFR0u+U4rTvEubf8AA510pg6j/xVqsazpQZ2+8KQTLIeQfFxm8u/RZSnbW6g3Rbn jnOwNjhzXAazFGHr0VT8xcPse8ux2jKSWwV8c4thkX2c0YaMcPWNcykw7teUDXTphMKC wmnUz3fdlRfO5x+ocirdro1lsgI8AVuga7z4sVIoIijZDZrt6Z87iS3bLz4F8nHiEhXv nPezUI3LD0O05wjl3U7wEfPY5Upp8rEf9ykdBydEBiMMDy2hWJqaDM5jGqLytJUpYe7Q X7fkKBTWXto+tk6o4BPc7ZnyJ+rKz6/7E/xjTrXetfj2M8LELNXBLgfn1ANjbb4Wq/hi hmyw== 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 p7-v6si7896327plo.159.2018.10.05.02.49.17; Fri, 05 Oct 2018 02:49:33 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727863AbeJEQrF (ORCPT + 99 others); Fri, 5 Oct 2018 12:47:05 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:50008 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727809AbeJEQrE (ORCPT ); Fri, 5 Oct 2018 12:47:04 -0400 Received: from 79.184.253.194.ipv4.supernova.orange.pl (79.184.253.194) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.148) id f735022c6936a5c4; Fri, 5 Oct 2018 11:49:04 +0200 From: "Rafael J. Wysocki" To: Rajneesh Bhardwaj Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, lenb@kernel.org, rajneesh.bhardwaj@intel.com, "Rafael J . Wysocki" , Srinivas Pandruvada Subject: Re: [PATCH] ACPI / LPIT: Register attributes based on FADT Date: Fri, 05 Oct 2018 11:46:01 +0200 Message-ID: <2363635.PV2ruU7bBX@aspire.rjw.lan> In-Reply-To: <20180928085402.9108-1-rajneesh.bhardwaj@linux.intel.com> References: <20180928085402.9108-1-rajneesh.bhardwaj@linux.intel.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 Friday, September 28, 2018 10:54:02 AM CEST Rajneesh Bhardwaj wrote: > 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, > Applied, thanks!