Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3488675imu; Sun, 11 Nov 2018 16:14:27 -0800 (PST) X-Google-Smtp-Source: AJdET5d7jIoxWpcYnSQdkQvqTsYPQecMghjCGk09LIEGCwQsTYKn9K+RPq2ykhzqusrIicRyJPeQ X-Received: by 2002:a17:902:9004:: with SMTP id a4-v6mr17748344plp.334.1541981667867; Sun, 11 Nov 2018 16:14:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981667; cv=none; d=google.com; s=arc-20160816; b=h5PnNvs8Sd7NB0XM20HlOgVZhkVEP3ktQPVOFEDxEHab1AGwDnuC1UZCqAoiaFz2rZ i0VH4rbVQhHmv3O1voeCUzoG/or12ROcBBjJmKVjZ1j3ak3SME+boSGI7ii9TGrXAE0Y tKaWCnho+WBRAfnCanFZ45HtXTm5Z4Cb3k+/O5fUm6r+nFwxneFIBl7MRzFpc4E4bbpo FdcjUvZc0kxHvPzVCMvoZs1KA//BSgL6RNY97mbdr7Dyr7ScXwj5Z5uS2fRzcqMChftY U+II2wJzJbhJfiQqI7M/vOvEyfnoyBl8t9DM8ubXB9OclYaLDMrpmv/nE/+C22KEnU9a TwAA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0TrQByDzOHLa8Ig39sYO7ufthZE16eigafZxJuXqcUc=; b=T6mvSgu5WqZ7B2hgHRNp2+NXtCjCuz+qDpfcmkDNWAXTMrlvRVqtH6oqyg86DIKvLJ 6YZI4qtfML1SWeusVKYSnGn2AA+WVjXh57ReCZy+cFr0JkT5pI7iLlFBm7RfCN6Xdq7j KBzFSwSCFCxVx1KhYFCDLB0xd67QfeqcfGoR5cbvNa3Cqsz7f/tWn8o/t+5KscQOssRT nongU0TLDceII0FLp9GqMAvoGo59jeVGbpqVU/RFsGNQ/NgIITwpor1KRS3wiX4A5291 /9R8fENdV29pk+8qL5ywBxKX8hNk/lcw6A7zH9vxLq01b0nt7uggCsQZZxt538tyCBqd 8iGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rHNypKnE; 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 h5si14616684pgc.237.2018.11.11.16.14.13; Sun, 11 Nov 2018 16:14:27 -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; dkim=pass header.i=@kernel.org header.s=default header.b=rHNypKnE; 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 S1731594AbeKLKER (ORCPT + 99 others); Mon, 12 Nov 2018 05:04:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:59904 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730449AbeKLIRP (ORCPT ); Mon, 12 Nov 2018 03:17:15 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3F612216FD; Sun, 11 Nov 2018 22:27:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975239; bh=MKNlVbY8SbYzelYhnr+S7P9TwXFdWZNdRq/vH1W5Ass=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rHNypKnE3Np1t0KY989cwQcyEi4QIJ7xp8LtmoiENVHwUSSZdsBzhjfOE+uc3nLpM dGmap+RebJ5jEZx5zlIXEaqUBLe1b7rb7BzTE0XkbOiqkQZUVNzxtd+SCwVv/1DZau mV4Qak98J6V6xin8TNWG2b7vYLEuEvgLOcbQas/Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rajneesh Bhardwaj , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.19 080/361] ACPI / PM: LPIT: Register sysfs attributes based on FADT Date: Sun, 11 Nov 2018 14:17:07 -0800 Message-Id: <20181111221631.153788673@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rajneesh Bhardwaj [ Upstream commit 1cdda9486f5103fb133f88e662e48c504adbb779 ] 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. Signed-off-by: Rajneesh Bhardwaj Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/acpi_lpit.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/drivers/acpi/acpi_lpit.c +++ b/drivers/acpi/acpi_lpit.c @@ -117,11 +117,17 @@ static void lpit_update_residency(struct 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,