aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpi_extlog.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-01-24 18:51:02 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-01-24 18:51:02 -0500
commit09da8dfa98682d871987145ed11e3232accac860 (patch)
tree152a9bb1e52f70db6efb66fffbdc4871f749d7df /drivers/acpi/acpi_extlog.c
parent3aacd625f20129f5a41ea3ff3b5353b0e4dabd01 (diff)
parent7744064731a9543105e207504e0262f883bc14c0 (diff)
Merge tag 'pm+acpi-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management updates from Rafael Wysocki: "As far as the number of commits goes, the top spot belongs to ACPI this time with cpufreq in the second position and a handful of PM core, PNP and cpuidle updates. They are fixes and cleanups mostly, as usual, with a couple of new features in the mix. The most visible change is probably that we will create struct acpi_device objects (visible in sysfs) for all devices represented in the ACPI tables regardless of their status and there will be a new sysfs attribute under those objects allowing user space to check that status via _STA. Consequently, ACPI device eject or generally hot-removal will not delete those objects, unless the table containing the corresponding namespace nodes is unloaded, which is extremely rare. Also ACPI container hotplug will be handled quite a bit differently and cpufreq will support CPU boost ("turbo") generically and not only in the acpi-cpufreq driver. Specifics: - ACPI core changes to make it create a struct acpi_device object for every device represented in the ACPI tables during all namespace scans regardless of the current status of that device. In accordance with this, ACPI hotplug operations will not delete those objects, unless the underlying ACPI tables go away. - On top of the above, new sysfs attribute for ACPI device objects allowing user space to check device status by triggering the execution of _STA for its ACPI object. From Srinivas Pandruvada. - ACPI core hotplug changes reducing code duplication, integrating the PCI root hotplug with the core and reworking container hotplug. - ACPI core simplifications making it use ACPI_COMPANION() in the code "glueing" ACPI device objects to "physical" devices. - ACPICA update to upstream version 20131218. This adds support for the DBG2 and PCCT tables to ACPICA, fixes some bugs and improves debug facilities. From Bob Moore, Lv Zheng and Betty Dall. - Init code change to carry out the early ACPI initialization earlier. That should allow us to use ACPI during the timekeeping initialization and possibly to simplify the EFI initialization too. From Chun-Yi Lee. - Clenups of the inclusions of ACPI headers in many places all over from Lv Zheng and Rashika Kheria (work in progress). - New helper for ACPI _DSM execution and rework of the code in drivers that uses _DSM to execute it via the new helper. From Jiang Liu. - New Win8 OSI blacklist entries from Takashi Iwai. - Assorted ACPI fixes and cleanups from Al Stone, Emil Goode, Hanjun Guo, Lan Tianyu, Masanari Iida, Oliver Neukum, Prarit Bhargava, Rashika Kheria, Tang Chen, Zhang Rui. - intel_pstate driver updates, including proper Baytrail support, from Dirk Brandewie and intel_pstate documentation from Ramkumar Ramachandra. - Generic CPU boost ("turbo") support for cpufreq from Lukasz Majewski. - powernow-k6 cpufreq driver fixes from Mikulas Patocka. - cpufreq core fixes and cleanups from Viresh Kumar, Jane Li, Mark Brown. - Assorted cpufreq drivers fixes and cleanups from Anson Huang, John Tobias, Paul Bolle, Paul Walmsley, Sachin Kamat, Shawn Guo, Viresh Kumar. - cpuidle cleanups from Bartlomiej Zolnierkiewicz. - Support for hibernation APM events from Bin Shi. - Hibernation fix to avoid bringing up nonboot CPUs with ACPI EC disabled during thaw transitions from Bjørn Mork. - PM core fixes and cleanups from Ben Dooks, Leonardo Potenza, Ulf Hansson. - PNP subsystem fixes and cleanups from Dmitry Torokhov, Levente Kurusa, Rashika Kheria. - New tool for profiling system suspend from Todd E Brandt and a cpupower tool cleanup from One Thousand Gnomes" * tag 'pm+acpi-3.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (153 commits) thermal: exynos: boost: Automatic enable/disable of BOOST feature (at Exynos4412) cpufreq: exynos4x12: Change L0 driver data to CPUFREQ_BOOST_FREQ Documentation: cpufreq / boost: Update BOOST documentation cpufreq: exynos: Extend Exynos cpufreq driver to support boost cpufreq / boost: Kconfig: Support for software-managed BOOST acpi-cpufreq: Adjust the code to use the common boost attribute cpufreq: Add boost frequency support in core intel_pstate: Add trace point to report internal state. cpufreq: introduce cpufreq_generic_get() routine ARM: SA1100: Create dummy clk_get_rate() to avoid build failures cpufreq: stats: create sysfs entries when cpufreq_stats is a module cpufreq: stats: free table and remove sysfs entry in a single routine cpufreq: stats: remove hotplug notifiers cpufreq: stats: handle cpufreq_unregister_driver() and suspend/resume properly cpufreq: speedstep: remove unused speedstep_get_state platform: introduce OF style 'modalias' support for platform bus PM / tools: new tool for suspend/resume performance optimization ACPI: fix module autoloading for ACPI enumerated devices ACPI: add module autoloading support for ACPI enumerated devices ACPI: fix create_modalias() return value handling ...
Diffstat (limited to 'drivers/acpi/acpi_extlog.c')
-rw-r--r--drivers/acpi/acpi_extlog.c62
1 files changed, 12 insertions, 50 deletions
diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c
index 5d33c5415405..c4a5d87ede7e 100644
--- a/drivers/acpi/acpi_extlog.c
+++ b/drivers/acpi/acpi_extlog.c
@@ -9,7 +9,6 @@
9 9
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/acpi.h> 11#include <linux/acpi.h>
12#include <acpi/acpi_bus.h>
13#include <linux/cper.h> 12#include <linux/cper.h>
14#include <linux/ratelimit.h> 13#include <linux/ratelimit.h>
15#include <linux/edac.h> 14#include <linux/edac.h>
@@ -21,11 +20,9 @@
21#define EXT_ELOG_ENTRY_MASK GENMASK_ULL(51, 0) /* elog entry address mask */ 20#define EXT_ELOG_ENTRY_MASK GENMASK_ULL(51, 0) /* elog entry address mask */
22 21
23#define EXTLOG_DSM_REV 0x0 22#define EXTLOG_DSM_REV 0x0
24#define EXTLOG_FN_QUERY 0x0
25#define EXTLOG_FN_ADDR 0x1 23#define EXTLOG_FN_ADDR 0x1
26 24
27#define FLAG_OS_OPTIN BIT(0) 25#define FLAG_OS_OPTIN BIT(0)
28#define EXTLOG_QUERY_L1_EXIST BIT(1)
29#define ELOG_ENTRY_VALID (1ULL<<63) 26#define ELOG_ENTRY_VALID (1ULL<<63)
30#define ELOG_ENTRY_LEN 0x1000 27#define ELOG_ENTRY_LEN 0x1000
31 28
@@ -46,7 +43,7 @@ struct extlog_l1_head {
46 43
47static int old_edac_report_status; 44static int old_edac_report_status;
48 45
49static u8 extlog_dsm_uuid[] = "663E35AF-CC10-41A4-88EA-5470AF055295"; 46static u8 extlog_dsm_uuid[] __initdata = "663E35AF-CC10-41A4-88EA-5470AF055295";
50 47
51/* L1 table related physical address */ 48/* L1 table related physical address */
52static u64 elog_base; 49static u64 elog_base;
@@ -156,62 +153,27 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,
156 return NOTIFY_STOP; 153 return NOTIFY_STOP;
157} 154}
158 155
159static int extlog_get_dsm(acpi_handle handle, int rev, int func, u64 *ret) 156static bool __init extlog_get_l1addr(void)
160{ 157{
161 struct acpi_buffer buf = {ACPI_ALLOCATE_BUFFER, NULL};
162 struct acpi_object_list input;
163 union acpi_object params[4], *obj;
164 u8 uuid[16]; 158 u8 uuid[16];
165 int i; 159 acpi_handle handle;
160 union acpi_object *obj;
166 161
167 acpi_str_to_uuid(extlog_dsm_uuid, uuid); 162 acpi_str_to_uuid(extlog_dsm_uuid, uuid);
168 input.count = 4;
169 input.pointer = params;
170 params[0].type = ACPI_TYPE_BUFFER;
171 params[0].buffer.length = 16;
172 params[0].buffer.pointer = uuid;
173 params[1].type = ACPI_TYPE_INTEGER;
174 params[1].integer.value = rev;
175 params[2].type = ACPI_TYPE_INTEGER;
176 params[2].integer.value = func;
177 params[3].type = ACPI_TYPE_PACKAGE;
178 params[3].package.count = 0;
179 params[3].package.elements = NULL;
180
181 if (ACPI_FAILURE(acpi_evaluate_object(handle, "_DSM", &input, &buf)))
182 return -1;
183
184 *ret = 0;
185 obj = (union acpi_object *)buf.pointer;
186 if (obj->type == ACPI_TYPE_INTEGER) {
187 *ret = obj->integer.value;
188 } else if (obj->type == ACPI_TYPE_BUFFER) {
189 if (obj->buffer.length <= 8) {
190 for (i = 0; i < obj->buffer.length; i++)
191 *ret |= (obj->buffer.pointer[i] << (i * 8));
192 }
193 }
194 kfree(buf.pointer);
195
196 return 0;
197}
198
199static bool extlog_get_l1addr(void)
200{
201 acpi_handle handle;
202 u64 ret;
203 163
204 if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle))) 164 if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_SB", &handle)))
205 return false; 165 return false;
206 166 if (!acpi_check_dsm(handle, uuid, EXTLOG_DSM_REV, 1 << EXTLOG_FN_ADDR))
207 if (extlog_get_dsm(handle, EXTLOG_DSM_REV, EXTLOG_FN_QUERY, &ret) ||
208 !(ret & EXTLOG_QUERY_L1_EXIST))
209 return false; 167 return false;
210 168 obj = acpi_evaluate_dsm_typed(handle, uuid, EXTLOG_DSM_REV,
211 if (extlog_get_dsm(handle, EXTLOG_DSM_REV, EXTLOG_FN_ADDR, &ret)) 169 EXTLOG_FN_ADDR, NULL, ACPI_TYPE_INTEGER);
170 if (!obj) {
212 return false; 171 return false;
172 } else {
173 l1_dirbase = obj->integer.value;
174 ACPI_FREE(obj);
175 }
213 176
214 l1_dirbase = ret;
215 /* Spec says L1 directory must be 4K aligned, bail out if it isn't */ 177 /* Spec says L1 directory must be 4K aligned, bail out if it isn't */
216 if (l1_dirbase & ((1 << 12) - 1)) { 178 if (l1_dirbase & ((1 << 12) - 1)) {
217 pr_warn(FW_BUG "L1 Directory is invalid at physical %llx\n", 179 pr_warn(FW_BUG "L1 Directory is invalid at physical %llx\n",