1 |
From 50e5b0007767d2384e6b6b0dc78abbd8c1f3c322 Mon Sep 17 00:00:00 2001 |
2 |
From: Rajneesh Bhardwaj <rajneesh.bhardwaj@linux.intel.com> |
3 |
Date: Fri, 28 Sep 2018 14:24:02 +0530 |
4 |
Subject: [PATCH 034/145] ACPI / PM: LPIT: Register sysfs attributes based on |
5 |
FADT |
6 |
|
7 |
[ Upstream commit 1cdda9486f5103fb133f88e662e48c504adbb779 ] |
8 |
|
9 |
ACPI Low Power S0 Idle capabilities are announced via FADT table and can |
10 |
be used to inform the kernel about the presence of one or more Low Power |
11 |
Idle (LPI) entries as descried in LPIT table. LPIT table can exist |
12 |
independently even if the FADT S0 Idle flag is not set and thus it could |
13 |
confuse user since the following cpuidle attributes are created. |
14 |
|
15 |
/sys/devices/system/cpu/cpuidle/low_power_idle_cpu_residency_us |
16 |
/sys/devices/system/cpu/cpuidle/low_power_idle_system_residency_us |
17 |
|
18 |
Presence or absence of above attributes could mean that the given |
19 |
platform supports S0ix state or not. |
20 |
|
21 |
This change allows to create the above cpuidle attributes only if |
22 |
FADT table supports Low Power S0 Idle. |
23 |
|
24 |
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@linux.intel.com> |
25 |
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> |
26 |
Signed-off-by: Sasha Levin <sashal@kernel.org> |
27 |
--- |
28 |
drivers/acpi/acpi_lpit.c | 6 ++++++ |
29 |
1 file changed, 6 insertions(+) |
30 |
|
31 |
diff --git a/drivers/acpi/acpi_lpit.c b/drivers/acpi/acpi_lpit.c |
32 |
index cf4fc0161164..e43cb71b6972 100644 |
33 |
--- a/drivers/acpi/acpi_lpit.c |
34 |
+++ b/drivers/acpi/acpi_lpit.c |
35 |
@@ -117,11 +117,17 @@ static void lpit_update_residency(struct lpit_residency_info *info, |
36 |
if (!info->iomem_addr) |
37 |
return; |
38 |
|
39 |
+ if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) |
40 |
+ return; |
41 |
+ |
42 |
/* Silently fail, if cpuidle attribute group is not present */ |
43 |
sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj, |
44 |
&dev_attr_low_power_idle_system_residency_us.attr, |
45 |
"cpuidle"); |
46 |
} else if (info->gaddr.space_id == ACPI_ADR_SPACE_FIXED_HARDWARE) { |
47 |
+ if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) |
48 |
+ return; |
49 |
+ |
50 |
/* Silently fail, if cpuidle attribute group is not present */ |
51 |
sysfs_add_file_to_group(&cpu_subsys.dev_root->kobj, |
52 |
&dev_attr_low_power_idle_cpu_residency_us.attr, |
53 |
-- |
54 |
2.19.1 |
55 |
|