aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/Makefile2
-rw-r--r--drivers/acpi/acpi_apd.c150
-rw-r--r--drivers/acpi/acpi_lpss.c39
-rw-r--r--drivers/acpi/acpica/acapps.h4
-rw-r--r--drivers/acpi/acpica/accommon.h2
-rw-r--r--drivers/acpi/acpica/acdebug.h2
-rw-r--r--drivers/acpi/acpica/acdispat.h2
-rw-r--r--drivers/acpi/acpica/acevents.h4
-rw-r--r--drivers/acpi/acpica/acglobal.h2
-rw-r--r--drivers/acpi/acpica/achware.h2
-rw-r--r--drivers/acpi/acpica/acinterp.h2
-rw-r--r--drivers/acpi/acpica/aclocal.h2
-rw-r--r--drivers/acpi/acpica/acmacros.h2
-rw-r--r--drivers/acpi/acpica/acnamesp.h2
-rw-r--r--drivers/acpi/acpica/acobject.h2
-rw-r--r--drivers/acpi/acpica/acopcode.h2
-rw-r--r--drivers/acpi/acpica/acparser.h2
-rw-r--r--drivers/acpi/acpica/acpredef.h2
-rw-r--r--drivers/acpi/acpica/acresrc.h2
-rw-r--r--drivers/acpi/acpica/acstruct.h2
-rw-r--r--drivers/acpi/acpica/actables.h2
-rw-r--r--drivers/acpi/acpica/acutils.h2
-rw-r--r--drivers/acpi/acpica/amlcode.h2
-rw-r--r--drivers/acpi/acpica/amlresrc.h2
-rw-r--r--drivers/acpi/acpica/dsargs.c2
-rw-r--r--drivers/acpi/acpica/dscontrol.c2
-rw-r--r--drivers/acpi/acpica/dsfield.c2
-rw-r--r--drivers/acpi/acpica/dsinit.c2
-rw-r--r--drivers/acpi/acpica/dsmethod.c2
-rw-r--r--drivers/acpi/acpica/dsmthdat.c2
-rw-r--r--drivers/acpi/acpica/dsobject.c2
-rw-r--r--drivers/acpi/acpica/dsopcode.c2
-rw-r--r--drivers/acpi/acpica/dsutils.c2
-rw-r--r--drivers/acpi/acpica/dswexec.c2
-rw-r--r--drivers/acpi/acpica/dswload.c2
-rw-r--r--drivers/acpi/acpica/dswload2.c2
-rw-r--r--drivers/acpi/acpica/dswscope.c2
-rw-r--r--drivers/acpi/acpica/dswstate.c2
-rw-r--r--drivers/acpi/acpica/evevent.c2
-rw-r--r--drivers/acpi/acpica/evglock.c2
-rw-r--r--drivers/acpi/acpica/evgpe.c164
-rw-r--r--drivers/acpi/acpica/evgpeblk.c10
-rw-r--r--drivers/acpi/acpica/evgpeinit.c10
-rw-r--r--drivers/acpi/acpica/evgpeutil.c61
-rw-r--r--drivers/acpi/acpica/evhandler.c2
-rw-r--r--drivers/acpi/acpica/evmisc.c2
-rw-r--r--drivers/acpi/acpica/evregion.c2
-rw-r--r--drivers/acpi/acpica/evrgnini.c2
-rw-r--r--drivers/acpi/acpica/evsci.c2
-rw-r--r--drivers/acpi/acpica/evxface.c132
-rw-r--r--drivers/acpi/acpica/evxfevnt.c2
-rw-r--r--drivers/acpi/acpica/evxfgpe.c123
-rw-r--r--drivers/acpi/acpica/evxfregn.c2
-rw-r--r--drivers/acpi/acpica/exconfig.c2
-rw-r--r--drivers/acpi/acpica/exconvrt.c2
-rw-r--r--drivers/acpi/acpica/excreate.c2
-rw-r--r--drivers/acpi/acpica/exdebug.c2
-rw-r--r--drivers/acpi/acpica/exdump.c2
-rw-r--r--drivers/acpi/acpica/exfield.c2
-rw-r--r--drivers/acpi/acpica/exfldio.c2
-rw-r--r--drivers/acpi/acpica/exmisc.c2
-rw-r--r--drivers/acpi/acpica/exmutex.c2
-rw-r--r--drivers/acpi/acpica/exnames.c2
-rw-r--r--drivers/acpi/acpica/exoparg1.c2
-rw-r--r--drivers/acpi/acpica/exoparg2.c2
-rw-r--r--drivers/acpi/acpica/exoparg3.c2
-rw-r--r--drivers/acpi/acpica/exoparg6.c2
-rw-r--r--drivers/acpi/acpica/exprep.c2
-rw-r--r--drivers/acpi/acpica/exregion.c2
-rw-r--r--drivers/acpi/acpica/exresnte.c2
-rw-r--r--drivers/acpi/acpica/exresolv.c2
-rw-r--r--drivers/acpi/acpica/exresop.c2
-rw-r--r--drivers/acpi/acpica/exstore.c2
-rw-r--r--drivers/acpi/acpica/exstoren.c2
-rw-r--r--drivers/acpi/acpica/exstorob.c2
-rw-r--r--drivers/acpi/acpica/exsystem.c2
-rw-r--r--drivers/acpi/acpica/exutils.c2
-rw-r--r--drivers/acpi/acpica/hwacpi.c2
-rw-r--r--drivers/acpi/acpica/hwesleep.c2
-rw-r--r--drivers/acpi/acpica/hwgpe.c10
-rw-r--r--drivers/acpi/acpica/hwpci.c2
-rw-r--r--drivers/acpi/acpica/hwregs.c2
-rw-r--r--drivers/acpi/acpica/hwsleep.c2
-rw-r--r--drivers/acpi/acpica/hwtimer.c2
-rw-r--r--drivers/acpi/acpica/hwvalid.c2
-rw-r--r--drivers/acpi/acpica/hwxface.c2
-rw-r--r--drivers/acpi/acpica/hwxfsleep.c2
-rw-r--r--drivers/acpi/acpica/nsaccess.c2
-rw-r--r--drivers/acpi/acpica/nsalloc.c2
-rw-r--r--drivers/acpi/acpica/nsarguments.c2
-rw-r--r--drivers/acpi/acpica/nsconvert.c2
-rw-r--r--drivers/acpi/acpica/nsdump.c2
-rw-r--r--drivers/acpi/acpica/nsdumpdv.c2
-rw-r--r--drivers/acpi/acpica/nseval.c2
-rw-r--r--drivers/acpi/acpica/nsinit.c2
-rw-r--r--drivers/acpi/acpica/nsload.c2
-rw-r--r--drivers/acpi/acpica/nsnames.c2
-rw-r--r--drivers/acpi/acpica/nsobject.c2
-rw-r--r--drivers/acpi/acpica/nsparse.c2
-rw-r--r--drivers/acpi/acpica/nspredef.c2
-rw-r--r--drivers/acpi/acpica/nsprepkg.c2
-rw-r--r--drivers/acpi/acpica/nsrepair.c2
-rw-r--r--drivers/acpi/acpica/nsrepair2.c2
-rw-r--r--drivers/acpi/acpica/nssearch.c2
-rw-r--r--drivers/acpi/acpica/nsutils.c2
-rw-r--r--drivers/acpi/acpica/nswalk.c2
-rw-r--r--drivers/acpi/acpica/nsxfeval.c2
-rw-r--r--drivers/acpi/acpica/nsxfname.c2
-rw-r--r--drivers/acpi/acpica/nsxfobj.c2
-rw-r--r--drivers/acpi/acpica/psargs.c2
-rw-r--r--drivers/acpi/acpica/psloop.c2
-rw-r--r--drivers/acpi/acpica/psobject.c2
-rw-r--r--drivers/acpi/acpica/psopcode.c2
-rw-r--r--drivers/acpi/acpica/psopinfo.c2
-rw-r--r--drivers/acpi/acpica/psparse.c2
-rw-r--r--drivers/acpi/acpica/psscope.c2
-rw-r--r--drivers/acpi/acpica/pstree.c2
-rw-r--r--drivers/acpi/acpica/psutils.c2
-rw-r--r--drivers/acpi/acpica/pswalk.c2
-rw-r--r--drivers/acpi/acpica/psxface.c2
-rw-r--r--drivers/acpi/acpica/rsaddr.c2
-rw-r--r--drivers/acpi/acpica/rscalc.c2
-rw-r--r--drivers/acpi/acpica/rscreate.c2
-rw-r--r--drivers/acpi/acpica/rsdump.c2
-rw-r--r--drivers/acpi/acpica/rsdumpinfo.c2
-rw-r--r--drivers/acpi/acpica/rsinfo.c2
-rw-r--r--drivers/acpi/acpica/rsio.c2
-rw-r--r--drivers/acpi/acpica/rsirq.c2
-rw-r--r--drivers/acpi/acpica/rslist.c2
-rw-r--r--drivers/acpi/acpica/rsmemory.c2
-rw-r--r--drivers/acpi/acpica/rsmisc.c2
-rw-r--r--drivers/acpi/acpica/rsserial.c2
-rw-r--r--drivers/acpi/acpica/rsutils.c2
-rw-r--r--drivers/acpi/acpica/rsxface.c2
-rw-r--r--drivers/acpi/acpica/tbdata.c2
-rw-r--r--drivers/acpi/acpica/tbfadt.c2
-rw-r--r--drivers/acpi/acpica/tbfind.c2
-rw-r--r--drivers/acpi/acpica/tbinstal.c2
-rw-r--r--drivers/acpi/acpica/tbprint.c2
-rw-r--r--drivers/acpi/acpica/tbutils.c2
-rw-r--r--drivers/acpi/acpica/tbxface.c2
-rw-r--r--drivers/acpi/acpica/tbxfload.c2
-rw-r--r--drivers/acpi/acpica/tbxfroot.c2
-rw-r--r--drivers/acpi/acpica/utaddress.c2
-rw-r--r--drivers/acpi/acpica/utalloc.c2
-rw-r--r--drivers/acpi/acpica/utbuffer.c2
-rw-r--r--drivers/acpi/acpica/utcache.c2
-rw-r--r--drivers/acpi/acpica/utcopy.c2
-rw-r--r--drivers/acpi/acpica/utdebug.c2
-rw-r--r--drivers/acpi/acpica/utdecode.c2
-rw-r--r--drivers/acpi/acpica/utdelete.c2
-rw-r--r--drivers/acpi/acpica/uterror.c2
-rw-r--r--drivers/acpi/acpica/uteval.c2
-rw-r--r--drivers/acpi/acpica/utexcep.c2
-rw-r--r--drivers/acpi/acpica/utfileio.c2
-rw-r--r--drivers/acpi/acpica/utglobal.c2
-rw-r--r--drivers/acpi/acpica/uthex.c2
-rw-r--r--drivers/acpi/acpica/utids.c2
-rw-r--r--drivers/acpi/acpica/utinit.c2
-rw-r--r--drivers/acpi/acpica/utlock.c2
-rw-r--r--drivers/acpi/acpica/utmath.c2
-rw-r--r--drivers/acpi/acpica/utmisc.c2
-rw-r--r--drivers/acpi/acpica/utmutex.c2
-rw-r--r--drivers/acpi/acpica/utobject.c2
-rw-r--r--drivers/acpi/acpica/utosi.c2
-rw-r--r--drivers/acpi/acpica/utownerid.c2
-rw-r--r--drivers/acpi/acpica/utpredef.c2
-rw-r--r--drivers/acpi/acpica/utprint.c2
-rw-r--r--drivers/acpi/acpica/utresrc.c2
-rw-r--r--drivers/acpi/acpica/utstate.c2
-rw-r--r--drivers/acpi/acpica/utstring.c2
-rw-r--r--drivers/acpi/acpica/uttrack.c2
-rw-r--r--drivers/acpi/acpica/utuuid.c2
-rw-r--r--drivers/acpi/acpica/utxface.c2
-rw-r--r--drivers/acpi/acpica/utxferror.c2
-rw-r--r--drivers/acpi/acpica/utxfinit.c2
-rw-r--r--drivers/acpi/acpica/utxfmutex.c2
-rw-r--r--drivers/acpi/ec.c548
-rw-r--r--drivers/acpi/internal.h4
-rw-r--r--drivers/acpi/numa.c12
-rw-r--r--drivers/acpi/processor_idle.c182
-rw-r--r--drivers/acpi/scan.c1
-rw-r--r--drivers/acpi/sleep.c2
-rw-r--r--drivers/acpi/video.c18
184 files changed, 1164 insertions, 642 deletions
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index e59494c90402..b18cd2151ddb 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -40,7 +40,7 @@ acpi-$(CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC) += processor_pdc.o
40acpi-y += ec.o 40acpi-y += ec.o
41acpi-$(CONFIG_ACPI_DOCK) += dock.o 41acpi-$(CONFIG_ACPI_DOCK) += dock.o
42acpi-y += pci_root.o pci_link.o pci_irq.o 42acpi-y += pci_root.o pci_link.o pci_irq.o
43acpi-y += acpi_lpss.o 43acpi-y += acpi_lpss.o acpi_apd.o
44acpi-y += acpi_platform.o 44acpi-y += acpi_platform.o
45acpi-y += acpi_pnp.o 45acpi-y += acpi_pnp.o
46acpi-y += int340x_thermal.o 46acpi-y += int340x_thermal.o
diff --git a/drivers/acpi/acpi_apd.c b/drivers/acpi/acpi_apd.c
new file mode 100644
index 000000000000..3984ea96e5f7
--- /dev/null
+++ b/drivers/acpi/acpi_apd.c
@@ -0,0 +1,150 @@
1/*
2 * AMD ACPI support for ACPI2platform device.
3 *
4 * Copyright (c) 2014,2015 AMD Corporation.
5 * Authors: Ken Xue <Ken.Xue@amd.com>
6 * Wu, Jeff <Jeff.Wu@amd.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/clk-provider.h>
14#include <linux/platform_device.h>
15#include <linux/pm_domain.h>
16#include <linux/clkdev.h>
17#include <linux/acpi.h>
18#include <linux/err.h>
19#include <linux/clk.h>
20#include <linux/pm.h>
21
22#include "internal.h"
23
24ACPI_MODULE_NAME("acpi_apd");
25struct apd_private_data;
26
27/**
28 * ACPI_APD_SYSFS : add device attributes in sysfs
29 * ACPI_APD_PM : attach power domain to device
30 */
31#define ACPI_APD_SYSFS BIT(0)
32#define ACPI_APD_PM BIT(1)
33
34/**
35 * struct apd_device_desc - a descriptor for apd device
36 * @flags: device flags like %ACPI_APD_SYSFS, %ACPI_APD_PM
37 * @fixed_clk_rate: fixed rate input clock source for acpi device;
38 * 0 means no fixed rate input clock source
39 * @setup: a hook routine to set device resource during create platform device
40 *
41 * Device description defined as acpi_device_id.driver_data
42 */
43struct apd_device_desc {
44 unsigned int flags;
45 unsigned int fixed_clk_rate;
46 int (*setup)(struct apd_private_data *pdata);
47};
48
49struct apd_private_data {
50 struct clk *clk;
51 struct acpi_device *adev;
52 const struct apd_device_desc *dev_desc;
53};
54
55#ifdef CONFIG_X86_AMD_PLATFORM_DEVICE
56#define APD_ADDR(desc) ((unsigned long)&desc)
57
58static int acpi_apd_setup(struct apd_private_data *pdata)
59{
60 const struct apd_device_desc *dev_desc = pdata->dev_desc;
61 struct clk *clk = ERR_PTR(-ENODEV);
62
63 if (dev_desc->fixed_clk_rate) {
64 clk = clk_register_fixed_rate(&pdata->adev->dev,
65 dev_name(&pdata->adev->dev),
66 NULL, CLK_IS_ROOT,
67 dev_desc->fixed_clk_rate);
68 clk_register_clkdev(clk, NULL, dev_name(&pdata->adev->dev));
69 pdata->clk = clk;
70 }
71
72 return 0;
73}
74
75static struct apd_device_desc cz_i2c_desc = {
76 .setup = acpi_apd_setup,
77 .fixed_clk_rate = 133000000,
78};
79
80static struct apd_device_desc cz_uart_desc = {
81 .setup = acpi_apd_setup,
82 .fixed_clk_rate = 48000000,
83};
84
85#else
86
87#define APD_ADDR(desc) (0UL)
88
89#endif /* CONFIG_X86_AMD_PLATFORM_DEVICE */
90
91/**
92* Create platform device during acpi scan attach handle.
93* Return value > 0 on success of creating device.
94*/
95static int acpi_apd_create_device(struct acpi_device *adev,
96 const struct acpi_device_id *id)
97{
98 const struct apd_device_desc *dev_desc = (void *)id->driver_data;
99 struct apd_private_data *pdata;
100 struct platform_device *pdev;
101 int ret;
102
103 if (!dev_desc) {
104 pdev = acpi_create_platform_device(adev);
105 return IS_ERR_OR_NULL(pdev) ? PTR_ERR(pdev) : 1;
106 }
107
108 pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
109 if (!pdata)
110 return -ENOMEM;
111
112 pdata->adev = adev;
113 pdata->dev_desc = dev_desc;
114
115 if (dev_desc->setup) {
116 ret = dev_desc->setup(pdata);
117 if (ret)
118 goto err_out;
119 }
120
121 adev->driver_data = pdata;
122 pdev = acpi_create_platform_device(adev);
123 if (!IS_ERR_OR_NULL(pdev))
124 return 1;
125
126 ret = PTR_ERR(pdev);
127 adev->driver_data = NULL;
128
129 err_out:
130 kfree(pdata);
131 return ret;
132}
133
134static const struct acpi_device_id acpi_apd_device_ids[] = {
135 /* Generic apd devices */
136 { "AMD0010", APD_ADDR(cz_i2c_desc) },
137 { "AMD0020", APD_ADDR(cz_uart_desc) },
138 { "AMD0030", },
139 { }
140};
141
142static struct acpi_scan_handler apd_handler = {
143 .ids = acpi_apd_device_ids,
144 .attach = acpi_apd_create_device,
145};
146
147void __init acpi_apd_init(void)
148{
149 acpi_scan_add_handler(&apd_handler);
150}
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index dfd1b8095dad..02e835f3cf8a 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * ACPI support for Intel Lynxpoint LPSS. 2 * ACPI support for Intel Lynxpoint LPSS.
3 * 3 *
4 * Copyright (C) 2013, 2014, Intel Corporation 4 * Copyright (C) 2013, Intel Corporation
5 * Authors: Mika Westerberg <mika.westerberg@linux.intel.com> 5 * Authors: Mika Westerberg <mika.westerberg@linux.intel.com>
6 * Rafael J. Wysocki <rafael.j.wysocki@intel.com> 6 * Rafael J. Wysocki <rafael.j.wysocki@intel.com>
7 * 7 *
@@ -60,8 +60,6 @@ ACPI_MODULE_NAME("acpi_lpss");
60#define LPSS_CLK_DIVIDER BIT(2) 60#define LPSS_CLK_DIVIDER BIT(2)
61#define LPSS_LTR BIT(3) 61#define LPSS_LTR BIT(3)
62#define LPSS_SAVE_CTX BIT(4) 62#define LPSS_SAVE_CTX BIT(4)
63#define LPSS_DEV_PROXY BIT(5)
64#define LPSS_PROXY_REQ BIT(6)
65 63
66struct lpss_private_data; 64struct lpss_private_data;
67 65
@@ -72,10 +70,8 @@ struct lpss_device_desc {
72 void (*setup)(struct lpss_private_data *pdata); 70 void (*setup)(struct lpss_private_data *pdata);
73}; 71};
74 72
75static struct device *proxy_device;
76
77static struct lpss_device_desc lpss_dma_desc = { 73static struct lpss_device_desc lpss_dma_desc = {
78 .flags = LPSS_CLK | LPSS_PROXY_REQ, 74 .flags = LPSS_CLK,
79}; 75};
80 76
81struct lpss_private_data { 77struct lpss_private_data {
@@ -129,7 +125,7 @@ static struct lpss_device_desc lpt_dev_desc = {
129}; 125};
130 126
131static struct lpss_device_desc lpt_i2c_dev_desc = { 127static struct lpss_device_desc lpt_i2c_dev_desc = {
132 .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR, 128 .flags = LPSS_CLK | LPSS_LTR,
133 .prv_offset = 0x800, 129 .prv_offset = 0x800,
134}; 130};
135 131
@@ -150,24 +146,22 @@ static struct lpss_device_desc byt_pwm_dev_desc = {
150}; 146};
151 147
152static struct lpss_device_desc byt_uart_dev_desc = { 148static struct lpss_device_desc byt_uart_dev_desc = {
153 .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_SAVE_CTX | 149 .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_SAVE_CTX,
154 LPSS_DEV_PROXY,
155 .prv_offset = 0x800, 150 .prv_offset = 0x800,
156 .setup = lpss_uart_setup, 151 .setup = lpss_uart_setup,
157}; 152};
158 153
159static struct lpss_device_desc byt_spi_dev_desc = { 154static struct lpss_device_desc byt_spi_dev_desc = {
160 .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_SAVE_CTX | 155 .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_SAVE_CTX,
161 LPSS_DEV_PROXY,
162 .prv_offset = 0x400, 156 .prv_offset = 0x400,
163}; 157};
164 158
165static struct lpss_device_desc byt_sdio_dev_desc = { 159static struct lpss_device_desc byt_sdio_dev_desc = {
166 .flags = LPSS_CLK | LPSS_DEV_PROXY, 160 .flags = LPSS_CLK,
167}; 161};
168 162
169static struct lpss_device_desc byt_i2c_dev_desc = { 163static struct lpss_device_desc byt_i2c_dev_desc = {
170 .flags = LPSS_CLK | LPSS_SAVE_CTX | LPSS_DEV_PROXY, 164 .flags = LPSS_CLK | LPSS_SAVE_CTX,
171 .prv_offset = 0x800, 165 .prv_offset = 0x800,
172 .setup = byt_i2c_setup, 166 .setup = byt_i2c_setup,
173}; 167};
@@ -340,6 +334,8 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
340 pdata->mmio_size = resource_size(rentry->res); 334 pdata->mmio_size = resource_size(rentry->res);
341 pdata->mmio_base = ioremap(rentry->res->start, 335 pdata->mmio_base = ioremap(rentry->res->start,
342 pdata->mmio_size); 336 pdata->mmio_size);
337 if (!pdata->mmio_base)
338 goto err_out;
343 break; 339 break;
344 } 340 }
345 341
@@ -374,8 +370,6 @@ static int acpi_lpss_create_device(struct acpi_device *adev,
374 adev->driver_data = pdata; 370 adev->driver_data = pdata;
375 pdev = acpi_create_platform_device(adev); 371 pdev = acpi_create_platform_device(adev);
376 if (!IS_ERR_OR_NULL(pdev)) { 372 if (!IS_ERR_OR_NULL(pdev)) {
377 if (!proxy_device && dev_desc->flags & LPSS_DEV_PROXY)
378 proxy_device = &pdev->dev;
379 return 1; 373 return 1;
380 } 374 }
381 375
@@ -600,14 +594,7 @@ static int acpi_lpss_runtime_suspend(struct device *dev)
600 if (pdata->dev_desc->flags & LPSS_SAVE_CTX) 594 if (pdata->dev_desc->flags & LPSS_SAVE_CTX)
601 acpi_lpss_save_ctx(dev, pdata); 595 acpi_lpss_save_ctx(dev, pdata);
602 596
603 ret = acpi_dev_runtime_suspend(dev); 597 return acpi_dev_runtime_suspend(dev);
604 if (ret)
605 return ret;
606
607 if (pdata->dev_desc->flags & LPSS_PROXY_REQ && proxy_device)
608 return pm_runtime_put_sync_suspend(proxy_device);
609
610 return 0;
611} 598}
612 599
613static int acpi_lpss_runtime_resume(struct device *dev) 600static int acpi_lpss_runtime_resume(struct device *dev)
@@ -615,12 +602,6 @@ static int acpi_lpss_runtime_resume(struct device *dev)
615 struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev)); 602 struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
616 int ret; 603 int ret;
617 604
618 if (pdata->dev_desc->flags & LPSS_PROXY_REQ && proxy_device) {
619 ret = pm_runtime_get_sync(proxy_device);
620 if (ret)
621 return ret;
622 }
623
624 ret = acpi_dev_runtime_resume(dev); 605 ret = acpi_dev_runtime_resume(dev);
625 if (ret) 606 if (ret)
626 return ret; 607 return ret;
diff --git a/drivers/acpi/acpica/acapps.h b/drivers/acpi/acpica/acapps.h
index 3d2c88289da9..d863016565b5 100644
--- a/drivers/acpi/acpica/acapps.h
+++ b/drivers/acpi/acpica/acapps.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,7 @@
47/* Common info for tool signons */ 47/* Common info for tool signons */
48 48
49#define ACPICA_NAME "Intel ACPI Component Architecture" 49#define ACPICA_NAME "Intel ACPI Component Architecture"
50#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2014 Intel Corporation" 50#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2015 Intel Corporation"
51 51
52#if ACPI_MACHINE_WIDTH == 64 52#if ACPI_MACHINE_WIDTH == 64
53#define ACPI_WIDTH "-64" 53#define ACPI_WIDTH "-64"
diff --git a/drivers/acpi/acpica/accommon.h b/drivers/acpi/acpica/accommon.h
index 6f1c616910ac..853aa2dbdb61 100644
--- a/drivers/acpi/acpica/accommon.h
+++ b/drivers/acpi/acpica/accommon.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acdebug.h b/drivers/acpi/acpica/acdebug.h
index 1d026ff1683f..4169bb87a996 100644
--- a/drivers/acpi/acpica/acdebug.h
+++ b/drivers/acpi/acpica/acdebug.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acdispat.h b/drivers/acpi/acpica/acdispat.h
index d3e2cc395d7f..408f04bcaab4 100644
--- a/drivers/acpi/acpica/acdispat.h
+++ b/drivers/acpi/acpica/acdispat.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acevents.h b/drivers/acpi/acpica/acevents.h
index 7a7811a9fc26..228704b78657 100644
--- a/drivers/acpi/acpica/acevents.h
+++ b/drivers/acpi/acpica/acevents.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -143,8 +143,6 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,
143acpi_status 143acpi_status
144acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback, void *context); 144acpi_ev_walk_gpe_list(acpi_gpe_callback gpe_walk_callback, void *context);
145 145
146u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info);
147
148acpi_status 146acpi_status
149acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info, 147acpi_ev_get_gpe_device(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
150 struct acpi_gpe_block_info *gpe_block, void *context); 148 struct acpi_gpe_block_info *gpe_block, void *context);
diff --git a/drivers/acpi/acpica/acglobal.h b/drivers/acpi/acpica/acglobal.h
index 7f60582d0c8c..a165d25343e8 100644
--- a/drivers/acpi/acpica/acglobal.h
+++ b/drivers/acpi/acpica/acglobal.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/achware.h b/drivers/acpi/acpica/achware.h
index c318d3e27893..196a55244559 100644
--- a/drivers/acpi/acpica/achware.h
+++ b/drivers/acpi/acpica/achware.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acinterp.h b/drivers/acpi/acpica/acinterp.h
index b01f71ce0523..1886bde54b5d 100644
--- a/drivers/acpi/acpica/acinterp.h
+++ b/drivers/acpi/acpica/acinterp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h
index 680d23bbae7c..7add32e5d8c5 100644
--- a/drivers/acpi/acpica/aclocal.h
+++ b/drivers/acpi/acpica/aclocal.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 4bceb11c7380..cf607fe69dbd 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acnamesp.h b/drivers/acpi/acpica/acnamesp.h
index ee1c040f321c..952fbe0b7231 100644
--- a/drivers/acpi/acpica/acnamesp.h
+++ b/drivers/acpi/acpica/acnamesp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acobject.h b/drivers/acpi/acpica/acobject.h
index 8abb393dafab..3e9720e1f34f 100644
--- a/drivers/acpi/acpica/acobject.h
+++ b/drivers/acpi/acpica/acobject.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acopcode.h b/drivers/acpi/acpica/acopcode.h
index dda0e6affcf1..a5f17de45ac6 100644
--- a/drivers/acpi/acpica/acopcode.h
+++ b/drivers/acpi/acpica/acopcode.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acparser.h b/drivers/acpi/acpica/acparser.h
index 6168b85463ed..74a390c6db16 100644
--- a/drivers/acpi/acpica/acparser.h
+++ b/drivers/acpi/acpica/acparser.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h
index bd3908d26c4f..a972d11c97c9 100644
--- a/drivers/acpi/acpica/acpredef.h
+++ b/drivers/acpi/acpica/acpredef.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acresrc.h b/drivers/acpi/acpica/acresrc.h
index 4b008e8884a1..efc4c7124ccc 100644
--- a/drivers/acpi/acpica/acresrc.h
+++ b/drivers/acpi/acpica/acresrc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acstruct.h b/drivers/acpi/acpica/acstruct.h
index cf7346110bd8..d14b547b7cd5 100644
--- a/drivers/acpi/acpica/acstruct.h
+++ b/drivers/acpi/acpica/acstruct.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/actables.h b/drivers/acpi/acpica/actables.h
index 1afe46e44dac..1c127a43017b 100644
--- a/drivers/acpi/acpica/actables.h
+++ b/drivers/acpi/acpica/actables.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index 486d342e74b6..c2f03e8774ad 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h
index 5908ccec6aea..3a95068fc119 100644
--- a/drivers/acpi/acpica/amlcode.h
+++ b/drivers/acpi/acpica/amlcode.h
@@ -7,7 +7,7 @@
7 *****************************************************************************/ 7 *****************************************************************************/
8 8
9/* 9/*
10 * Copyright (C) 2000 - 2014, Intel Corp. 10 * Copyright (C) 2000 - 2015, Intel Corp.
11 * All rights reserved. 11 * All rights reserved.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/amlresrc.h b/drivers/acpi/acpica/amlresrc.h
index 3a0beeb86ba5..ee0cdd60b93d 100644
--- a/drivers/acpi/acpica/amlresrc.h
+++ b/drivers/acpi/acpica/amlresrc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsargs.c b/drivers/acpi/acpica/dsargs.c
index 720b1cdda711..3e6989738e85 100644
--- a/drivers/acpi/acpica/dsargs.c
+++ b/drivers/acpi/acpica/dsargs.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dscontrol.c b/drivers/acpi/acpica/dscontrol.c
index 8daf9de82b73..39da9da62bbf 100644
--- a/drivers/acpi/acpica/dscontrol.c
+++ b/drivers/acpi/acpica/dscontrol.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsfield.c b/drivers/acpi/acpica/dsfield.c
index c57666196672..43b40de90484 100644
--- a/drivers/acpi/acpica/dsfield.c
+++ b/drivers/acpi/acpica/dsfield.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsinit.c b/drivers/acpi/acpica/dsinit.c
index aee5e45f6d35..bbe74bcebbae 100644
--- a/drivers/acpi/acpica/dsinit.c
+++ b/drivers/acpi/acpica/dsinit.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index 3c7f7378b94d..d72565a3c646 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsmthdat.c b/drivers/acpi/acpica/dsmthdat.c
index b67522df01ac..2e4c42b377ec 100644
--- a/drivers/acpi/acpica/dsmthdat.c
+++ b/drivers/acpi/acpica/dsmthdat.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsobject.c b/drivers/acpi/acpica/dsobject.c
index a1e7e6b6fcf7..8a7b07b6adc8 100644
--- a/drivers/acpi/acpica/dsobject.c
+++ b/drivers/acpi/acpica/dsobject.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsopcode.c b/drivers/acpi/acpica/dsopcode.c
index 6c0759c0db47..77244182ff02 100644
--- a/drivers/acpi/acpica/dsopcode.c
+++ b/drivers/acpi/acpica/dsopcode.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dsutils.c b/drivers/acpi/acpica/dsutils.c
index 9f74795e2268..e5ff89bcb3f5 100644
--- a/drivers/acpi/acpica/dsutils.c
+++ b/drivers/acpi/acpica/dsutils.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dswexec.c b/drivers/acpi/acpica/dswexec.c
index f7f5107e754d..df54d46225cd 100644
--- a/drivers/acpi/acpica/dswexec.c
+++ b/drivers/acpi/acpica/dswexec.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dswload.c b/drivers/acpi/acpica/dswload.c
index 15623da26200..843942fb4be5 100644
--- a/drivers/acpi/acpica/dswload.c
+++ b/drivers/acpi/acpica/dswload.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c
index 2ac28d297305..fcaa30c611fb 100644
--- a/drivers/acpi/acpica/dswload2.c
+++ b/drivers/acpi/acpica/dswload2.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dswscope.c b/drivers/acpi/acpica/dswscope.c
index 9d6e2c1de1f8..43b3ea40c0b6 100644
--- a/drivers/acpi/acpica/dswscope.c
+++ b/drivers/acpi/acpica/dswscope.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/dswstate.c b/drivers/acpi/acpica/dswstate.c
index 24f7d5ea678a..89ac2022465e 100644
--- a/drivers/acpi/acpica/dswstate.c
+++ b/drivers/acpi/acpica/dswstate.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evevent.c b/drivers/acpi/acpica/evevent.c
index c7bffff9ed32..bf6873f95e72 100644
--- a/drivers/acpi/acpica/evevent.c
+++ b/drivers/acpi/acpica/evevent.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evglock.c b/drivers/acpi/acpica/evglock.c
index 3393a73ca0d6..b78dc7c6d5d7 100644
--- a/drivers/acpi/acpica/evglock.c
+++ b/drivers/acpi/acpica/evglock.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evgpe.c b/drivers/acpi/acpica/evgpe.c
index aa70154cf4fa..5ed064e8673c 100644
--- a/drivers/acpi/acpica/evgpe.c
+++ b/drivers/acpi/acpica/evgpe.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -114,17 +114,6 @@ acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
114 114
115 ACPI_FUNCTION_TRACE(ev_enable_gpe); 115 ACPI_FUNCTION_TRACE(ev_enable_gpe);
116 116
117 /*
118 * We will only allow a GPE to be enabled if it has either an associated
119 * method (_Lxx/_Exx) or a handler, or is using the implicit notify
120 * feature. Otherwise, the GPE will be immediately disabled by
121 * acpi_ev_gpe_dispatch the first time it fires.
122 */
123 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) ==
124 ACPI_GPE_DISPATCH_NONE) {
125 return_ACPI_STATUS(AE_NO_HANDLER);
126 }
127
128 /* Clear the GPE (of stale events) */ 117 /* Clear the GPE (of stale events) */
129 118
130 status = acpi_hw_clear_gpe(gpe_event_info); 119 status = acpi_hw_clear_gpe(gpe_event_info);
@@ -339,7 +328,11 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
339{ 328{
340 acpi_status status; 329 acpi_status status;
341 struct acpi_gpe_block_info *gpe_block; 330 struct acpi_gpe_block_info *gpe_block;
331 struct acpi_namespace_node *gpe_device;
342 struct acpi_gpe_register_info *gpe_register_info; 332 struct acpi_gpe_register_info *gpe_register_info;
333 struct acpi_gpe_event_info *gpe_event_info;
334 u32 gpe_number;
335 struct acpi_gpe_handler_info *gpe_handler_info;
343 u32 int_status = ACPI_INTERRUPT_NOT_HANDLED; 336 u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
344 u8 enabled_status_byte; 337 u8 enabled_status_byte;
345 u32 status_reg; 338 u32 status_reg;
@@ -367,6 +360,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
367 360
368 gpe_block = gpe_xrupt_list->gpe_block_list_head; 361 gpe_block = gpe_xrupt_list->gpe_block_list_head;
369 while (gpe_block) { 362 while (gpe_block) {
363 gpe_device = gpe_block->node;
364
370 /* 365 /*
371 * Read all of the 8-bit GPE status and enable registers in this GPE 366 * Read all of the 8-bit GPE status and enable registers in this GPE
372 * block, saving all of them. Find all currently active GP events. 367 * block, saving all of them. Find all currently active GP events.
@@ -442,16 +437,68 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
442 437
443 /* Examine one GPE bit */ 438 /* Examine one GPE bit */
444 439
440 gpe_event_info =
441 &gpe_block->
442 event_info[((acpi_size) i *
443 ACPI_GPE_REGISTER_WIDTH) + j];
444 gpe_number =
445 j + gpe_register_info->base_gpe_number;
446
445 if (enabled_status_byte & (1 << j)) { 447 if (enabled_status_byte & (1 << j)) {
446 /* 448
447 * Found an active GPE. Dispatch the event to a handler 449 /* Invoke global event handler if present */
448 * or method. 450
449 */ 451 acpi_gpe_count++;
450 int_status |= 452 if (acpi_gbl_global_event_handler) {
451 acpi_ev_gpe_dispatch(gpe_block-> 453 acpi_gbl_global_event_handler
452 node, 454 (ACPI_EVENT_TYPE_GPE,
453 &gpe_block-> 455 gpe_device, gpe_number,
454 event_info[((acpi_size) i * ACPI_GPE_REGISTER_WIDTH) + j], j + gpe_register_info->base_gpe_number); 456 acpi_gbl_global_event_handler_context);
457 }
458
459 /* Found an active GPE */
460
461 if (ACPI_GPE_DISPATCH_TYPE
462 (gpe_event_info->flags) ==
463 ACPI_GPE_DISPATCH_RAW_HANDLER) {
464
465 /* Dispatch the event to a raw handler */
466
467 gpe_handler_info =
468 gpe_event_info->dispatch.
469 handler;
470
471 /*
472 * There is no protection around the namespace node
473 * and the GPE handler to ensure a safe destruction
474 * because:
475 * 1. The namespace node is expected to always
476 * exist after loading a table.
477 * 2. The GPE handler is expected to be flushed by
478 * acpi_os_wait_events_complete() before the
479 * destruction.
480 */
481 acpi_os_release_lock
482 (acpi_gbl_gpe_lock, flags);
483 int_status |=
484 gpe_handler_info->
485 address(gpe_device,
486 gpe_number,
487 gpe_handler_info->
488 context);
489 flags =
490 acpi_os_acquire_lock
491 (acpi_gbl_gpe_lock);
492 } else {
493 /*
494 * Dispatch the event to a standard handler or
495 * method.
496 */
497 int_status |=
498 acpi_ev_gpe_dispatch
499 (gpe_device, gpe_event_info,
500 gpe_number);
501 }
455 } 502 }
456 } 503 }
457 } 504 }
@@ -484,52 +531,15 @@ unlock_and_exit:
484static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context) 531static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
485{ 532{
486 struct acpi_gpe_event_info *gpe_event_info = context; 533 struct acpi_gpe_event_info *gpe_event_info = context;
487 acpi_status status; 534 acpi_status status = AE_OK;
488 struct acpi_gpe_event_info *local_gpe_event_info;
489 struct acpi_evaluate_info *info; 535 struct acpi_evaluate_info *info;
490 struct acpi_gpe_notify_info *notify; 536 struct acpi_gpe_notify_info *notify;
491 537
492 ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method); 538 ACPI_FUNCTION_TRACE(ev_asynch_execute_gpe_method);
493 539
494 /* Allocate a local GPE block */
495
496 local_gpe_event_info =
497 ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_gpe_event_info));
498 if (!local_gpe_event_info) {
499 ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY, "while handling a GPE"));
500 return_VOID;
501 }
502
503 status = acpi_ut_acquire_mutex(ACPI_MTX_EVENTS);
504 if (ACPI_FAILURE(status)) {
505 ACPI_FREE(local_gpe_event_info);
506 return_VOID;
507 }
508
509 /* Must revalidate the gpe_number/gpe_block */
510
511 if (!acpi_ev_valid_gpe_event(gpe_event_info)) {
512 status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
513 ACPI_FREE(local_gpe_event_info);
514 return_VOID;
515 }
516
517 /*
518 * Take a snapshot of the GPE info for this level - we copy the info to
519 * prevent a race condition with remove_handler/remove_block.
520 */
521 ACPI_MEMCPY(local_gpe_event_info, gpe_event_info,
522 sizeof(struct acpi_gpe_event_info));
523
524 status = acpi_ut_release_mutex(ACPI_MTX_EVENTS);
525 if (ACPI_FAILURE(status)) {
526 ACPI_FREE(local_gpe_event_info);
527 return_VOID;
528 }
529
530 /* Do the correct dispatch - normal method or implicit notify */ 540 /* Do the correct dispatch - normal method or implicit notify */
531 541
532 switch (local_gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) { 542 switch (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags)) {
533 case ACPI_GPE_DISPATCH_NOTIFY: 543 case ACPI_GPE_DISPATCH_NOTIFY:
534 /* 544 /*
535 * Implicit notify. 545 * Implicit notify.
@@ -542,7 +552,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
542 * June 2012: Expand implicit notify mechanism to support 552 * June 2012: Expand implicit notify mechanism to support
543 * notifies on multiple device objects. 553 * notifies on multiple device objects.
544 */ 554 */
545 notify = local_gpe_event_info->dispatch.notify_list; 555 notify = gpe_event_info->dispatch.notify_list;
546 while (ACPI_SUCCESS(status) && notify) { 556 while (ACPI_SUCCESS(status) && notify) {
547 status = 557 status =
548 acpi_ev_queue_notify_request(notify->device_node, 558 acpi_ev_queue_notify_request(notify->device_node,
@@ -566,7 +576,7 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
566 * _Lxx/_Exx control method that corresponds to this GPE 576 * _Lxx/_Exx control method that corresponds to this GPE
567 */ 577 */
568 info->prefix_node = 578 info->prefix_node =
569 local_gpe_event_info->dispatch.method_node; 579 gpe_event_info->dispatch.method_node;
570 info->flags = ACPI_IGNORE_RETURN_VALUE; 580 info->flags = ACPI_IGNORE_RETURN_VALUE;
571 581
572 status = acpi_ns_evaluate(info); 582 status = acpi_ns_evaluate(info);
@@ -576,25 +586,27 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_execute_gpe_method(void *context)
576 if (ACPI_FAILURE(status)) { 586 if (ACPI_FAILURE(status)) {
577 ACPI_EXCEPTION((AE_INFO, status, 587 ACPI_EXCEPTION((AE_INFO, status,
578 "while evaluating GPE method [%4.4s]", 588 "while evaluating GPE method [%4.4s]",
579 acpi_ut_get_node_name 589 acpi_ut_get_node_name(gpe_event_info->
580 (local_gpe_event_info->dispatch. 590 dispatch.
581 method_node))); 591 method_node)));
582 } 592 }
583 break; 593 break;
584 594
585 default: 595 default:
586 596
587 return_VOID; /* Should never happen */ 597 goto error_exit; /* Should never happen */
588 } 598 }
589 599
590 /* Defer enabling of GPE until all notify handlers are done */ 600 /* Defer enabling of GPE until all notify handlers are done */
591 601
592 status = acpi_os_execute(OSL_NOTIFY_HANDLER, 602 status = acpi_os_execute(OSL_NOTIFY_HANDLER,
593 acpi_ev_asynch_enable_gpe, 603 acpi_ev_asynch_enable_gpe, gpe_event_info);
594 local_gpe_event_info); 604 if (ACPI_SUCCESS(status)) {
595 if (ACPI_FAILURE(status)) { 605 return_VOID;
596 ACPI_FREE(local_gpe_event_info);
597 } 606 }
607
608error_exit:
609 acpi_ev_asynch_enable_gpe(gpe_event_info);
598 return_VOID; 610 return_VOID;
599} 611}
600 612
@@ -622,7 +634,6 @@ static void ACPI_SYSTEM_XFACE acpi_ev_asynch_enable_gpe(void *context)
622 (void)acpi_ev_finish_gpe(gpe_event_info); 634 (void)acpi_ev_finish_gpe(gpe_event_info);
623 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 635 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
624 636
625 ACPI_FREE(gpe_event_info);
626 return; 637 return;
627} 638}
628 639
@@ -692,15 +703,6 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
692 703
693 ACPI_FUNCTION_TRACE(ev_gpe_dispatch); 704 ACPI_FUNCTION_TRACE(ev_gpe_dispatch);
694 705
695 /* Invoke global event handler if present */
696
697 acpi_gpe_count++;
698 if (acpi_gbl_global_event_handler) {
699 acpi_gbl_global_event_handler(ACPI_EVENT_TYPE_GPE, gpe_device,
700 gpe_number,
701 acpi_gbl_global_event_handler_context);
702 }
703
704 /* 706 /*
705 * Always disable the GPE so that it does not keep firing before 707 * Always disable the GPE so that it does not keep firing before
706 * any asynchronous activity completes (either from the execution 708 * any asynchronous activity completes (either from the execution
@@ -741,7 +743,7 @@ acpi_ev_gpe_dispatch(struct acpi_namespace_node *gpe_device,
741 * If there is neither a handler nor a method, leave the GPE 743 * If there is neither a handler nor a method, leave the GPE
742 * disabled. 744 * disabled.
743 */ 745 */
744 switch (gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) { 746 switch (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags)) {
745 case ACPI_GPE_DISPATCH_HANDLER: 747 case ACPI_GPE_DISPATCH_HANDLER:
746 748
747 /* Invoke the installed handler (at interrupt level) */ 749 /* Invoke the installed handler (at interrupt level) */
diff --git a/drivers/acpi/acpica/evgpeblk.c b/drivers/acpi/acpica/evgpeblk.c
index d86699eea33c..e0f24c504513 100644
--- a/drivers/acpi/acpica/evgpeblk.c
+++ b/drivers/acpi/acpica/evgpeblk.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -474,10 +474,12 @@ acpi_ev_initialize_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
474 * Ignore GPEs that have no corresponding _Lxx/_Exx method 474 * Ignore GPEs that have no corresponding _Lxx/_Exx method
475 * and GPEs that are used to wake the system 475 * and GPEs that are used to wake the system
476 */ 476 */
477 if (((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 477 if ((ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
478 ACPI_GPE_DISPATCH_NONE) 478 ACPI_GPE_DISPATCH_NONE)
479 || ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) 479 || (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
480 == ACPI_GPE_DISPATCH_HANDLER) 480 ACPI_GPE_DISPATCH_HANDLER)
481 || (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
482 ACPI_GPE_DISPATCH_RAW_HANDLER)
481 || (gpe_event_info->flags & ACPI_GPE_CAN_WAKE)) { 483 || (gpe_event_info->flags & ACPI_GPE_CAN_WAKE)) {
482 continue; 484 continue;
483 } 485 }
diff --git a/drivers/acpi/acpica/evgpeinit.c b/drivers/acpi/acpica/evgpeinit.c
index 7be928379879..8840296d5b20 100644
--- a/drivers/acpi/acpica/evgpeinit.c
+++ b/drivers/acpi/acpica/evgpeinit.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -401,15 +401,17 @@ acpi_ev_match_gpe_method(acpi_handle obj_handle,
401 return_ACPI_STATUS(AE_OK); 401 return_ACPI_STATUS(AE_OK);
402 } 402 }
403 403
404 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 404 if ((ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
405 ACPI_GPE_DISPATCH_HANDLER) { 405 ACPI_GPE_DISPATCH_HANDLER) ||
406 (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
407 ACPI_GPE_DISPATCH_RAW_HANDLER)) {
406 408
407 /* If there is already a handler, ignore this GPE method */ 409 /* If there is already a handler, ignore this GPE method */
408 410
409 return_ACPI_STATUS(AE_OK); 411 return_ACPI_STATUS(AE_OK);
410 } 412 }
411 413
412 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 414 if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
413 ACPI_GPE_DISPATCH_METHOD) { 415 ACPI_GPE_DISPATCH_METHOD) {
414 /* 416 /*
415 * If there is already a method, ignore this method. But check 417 * If there is already a method, ignore this method. But check
diff --git a/drivers/acpi/acpica/evgpeutil.c b/drivers/acpi/acpica/evgpeutil.c
index 17e4bbfdb096..3a958f3612fe 100644
--- a/drivers/acpi/acpica/evgpeutil.c
+++ b/drivers/acpi/acpica/evgpeutil.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -108,53 +108,6 @@ unlock_and_exit:
108 108
109/******************************************************************************* 109/*******************************************************************************
110 * 110 *
111 * FUNCTION: acpi_ev_valid_gpe_event
112 *
113 * PARAMETERS: gpe_event_info - Info for this GPE
114 *
115 * RETURN: TRUE if the gpe_event is valid
116 *
117 * DESCRIPTION: Validate a GPE event. DO NOT CALL FROM INTERRUPT LEVEL.
118 * Should be called only when the GPE lists are semaphore locked
119 * and not subject to change.
120 *
121 ******************************************************************************/
122
123u8 acpi_ev_valid_gpe_event(struct acpi_gpe_event_info *gpe_event_info)
124{
125 struct acpi_gpe_xrupt_info *gpe_xrupt_block;
126 struct acpi_gpe_block_info *gpe_block;
127
128 ACPI_FUNCTION_ENTRY();
129
130 /* No need for spin lock since we are not changing any list elements */
131
132 /* Walk the GPE interrupt levels */
133
134 gpe_xrupt_block = acpi_gbl_gpe_xrupt_list_head;
135 while (gpe_xrupt_block) {
136 gpe_block = gpe_xrupt_block->gpe_block_list_head;
137
138 /* Walk the GPE blocks on this interrupt level */
139
140 while (gpe_block) {
141 if ((&gpe_block->event_info[0] <= gpe_event_info) &&
142 (&gpe_block->event_info[gpe_block->gpe_count] >
143 gpe_event_info)) {
144 return (TRUE);
145 }
146
147 gpe_block = gpe_block->next;
148 }
149
150 gpe_xrupt_block = gpe_xrupt_block->next;
151 }
152
153 return (FALSE);
154}
155
156/*******************************************************************************
157 *
158 * FUNCTION: acpi_ev_get_gpe_device 111 * FUNCTION: acpi_ev_get_gpe_device
159 * 112 *
160 * PARAMETERS: GPE_WALK_CALLBACK 113 * PARAMETERS: GPE_WALK_CALLBACK
@@ -371,8 +324,10 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
371 ACPI_GPE_REGISTER_WIDTH) 324 ACPI_GPE_REGISTER_WIDTH)
372 + j]; 325 + j];
373 326
374 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 327 if ((ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
375 ACPI_GPE_DISPATCH_HANDLER) { 328 ACPI_GPE_DISPATCH_HANDLER) ||
329 (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
330 ACPI_GPE_DISPATCH_RAW_HANDLER)) {
376 331
377 /* Delete an installed handler block */ 332 /* Delete an installed handler block */
378 333
@@ -380,10 +335,8 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
380 gpe_event_info->dispatch.handler = NULL; 335 gpe_event_info->dispatch.handler = NULL;
381 gpe_event_info->flags &= 336 gpe_event_info->flags &=
382 ~ACPI_GPE_DISPATCH_MASK; 337 ~ACPI_GPE_DISPATCH_MASK;
383 } else 338 } else if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags)
384 if ((gpe_event_info-> 339 == ACPI_GPE_DISPATCH_NOTIFY) {
385 flags & ACPI_GPE_DISPATCH_MASK) ==
386 ACPI_GPE_DISPATCH_NOTIFY) {
387 340
388 /* Delete the implicit notification device list */ 341 /* Delete the implicit notification device list */
389 342
diff --git a/drivers/acpi/acpica/evhandler.c b/drivers/acpi/acpica/evhandler.c
index 78ac29351c9e..74e8595f5a2b 100644
--- a/drivers/acpi/acpica/evhandler.c
+++ b/drivers/acpi/acpica/evhandler.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evmisc.c b/drivers/acpi/acpica/evmisc.c
index 24ea3424981b..f7c9dfe7b990 100644
--- a/drivers/acpi/acpica/evmisc.c
+++ b/drivers/acpi/acpica/evmisc.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
index 8eb8575e8c16..9abace3401f9 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c
index 1b148a440d67..da323390bb70 100644
--- a/drivers/acpi/acpica/evrgnini.c
+++ b/drivers/acpi/acpica/evrgnini.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evsci.c b/drivers/acpi/acpica/evsci.c
index 29630e303829..0366703d2970 100644
--- a/drivers/acpi/acpica/evsci.c
+++ b/drivers/acpi/acpica/evsci.c
@@ -6,7 +6,7 @@
6 ******************************************************************************/ 6 ******************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evxface.c b/drivers/acpi/acpica/evxface.c
index 55a58f3ec8df..81f2d9e87fad 100644
--- a/drivers/acpi/acpica/evxface.c
+++ b/drivers/acpi/acpica/evxface.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,16 @@
51 51
52#define _COMPONENT ACPI_EVENTS 52#define _COMPONENT ACPI_EVENTS
53ACPI_MODULE_NAME("evxface") 53ACPI_MODULE_NAME("evxface")
54#if (!ACPI_REDUCED_HARDWARE)
55/* Local prototypes */
56static acpi_status
57acpi_ev_install_gpe_handler(acpi_handle gpe_device,
58 u32 gpe_number,
59 u32 type,
60 u8 is_raw_handler,
61 acpi_gpe_handler address, void *context);
62
63#endif
54 64
55 65
56/******************************************************************************* 66/*******************************************************************************
@@ -76,6 +86,7 @@ ACPI_MODULE_NAME("evxface")
76 * handlers. 86 * handlers.
77 * 87 *
78 ******************************************************************************/ 88 ******************************************************************************/
89
79acpi_status 90acpi_status
80acpi_install_notify_handler(acpi_handle device, 91acpi_install_notify_handler(acpi_handle device,
81 u32 handler_type, 92 u32 handler_type,
@@ -717,32 +728,37 @@ ACPI_EXPORT_SYMBOL(acpi_remove_fixed_event_handler)
717 728
718/******************************************************************************* 729/*******************************************************************************
719 * 730 *
720 * FUNCTION: acpi_install_gpe_handler 731 * FUNCTION: acpi_ev_install_gpe_handler
721 * 732 *
722 * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT 733 * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT
723 * defined GPEs) 734 * defined GPEs)
724 * gpe_number - The GPE number within the GPE block 735 * gpe_number - The GPE number within the GPE block
725 * type - Whether this GPE should be treated as an 736 * type - Whether this GPE should be treated as an
726 * edge- or level-triggered interrupt. 737 * edge- or level-triggered interrupt.
738 * is_raw_handler - Whether this GPE should be handled using
739 * the special GPE handler mode.
727 * address - Address of the handler 740 * address - Address of the handler
728 * context - Value passed to the handler on each GPE 741 * context - Value passed to the handler on each GPE
729 * 742 *
730 * RETURN: Status 743 * RETURN: Status
731 * 744 *
732 * DESCRIPTION: Install a handler for a General Purpose Event. 745 * DESCRIPTION: Internal function to install a handler for a General Purpose
746 * Event.
733 * 747 *
734 ******************************************************************************/ 748 ******************************************************************************/
735acpi_status 749static acpi_status
736acpi_install_gpe_handler(acpi_handle gpe_device, 750acpi_ev_install_gpe_handler(acpi_handle gpe_device,
737 u32 gpe_number, 751 u32 gpe_number,
738 u32 type, acpi_gpe_handler address, void *context) 752 u32 type,
753 u8 is_raw_handler,
754 acpi_gpe_handler address, void *context)
739{ 755{
740 struct acpi_gpe_event_info *gpe_event_info; 756 struct acpi_gpe_event_info *gpe_event_info;
741 struct acpi_gpe_handler_info *handler; 757 struct acpi_gpe_handler_info *handler;
742 acpi_status status; 758 acpi_status status;
743 acpi_cpu_flags flags; 759 acpi_cpu_flags flags;
744 760
745 ACPI_FUNCTION_TRACE(acpi_install_gpe_handler); 761 ACPI_FUNCTION_TRACE(ev_install_gpe_handler);
746 762
747 /* Parameter validation */ 763 /* Parameter validation */
748 764
@@ -775,8 +791,10 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
775 791
776 /* Make sure that there isn't a handler there already */ 792 /* Make sure that there isn't a handler there already */
777 793
778 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 794 if ((ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
779 ACPI_GPE_DISPATCH_HANDLER) { 795 ACPI_GPE_DISPATCH_HANDLER) ||
796 (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
797 ACPI_GPE_DISPATCH_RAW_HANDLER)) {
780 status = AE_ALREADY_EXISTS; 798 status = AE_ALREADY_EXISTS;
781 goto free_and_exit; 799 goto free_and_exit;
782 } 800 }
@@ -793,9 +811,10 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
793 * automatically during initialization, in which case it has to be 811 * automatically during initialization, in which case it has to be
794 * disabled now to avoid spurious execution of the handler. 812 * disabled now to avoid spurious execution of the handler.
795 */ 813 */
796 if (((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) || 814 if (((ACPI_GPE_DISPATCH_TYPE(handler->original_flags) ==
797 (handler->original_flags & ACPI_GPE_DISPATCH_NOTIFY)) && 815 ACPI_GPE_DISPATCH_METHOD) ||
798 gpe_event_info->runtime_count) { 816 (ACPI_GPE_DISPATCH_TYPE(handler->original_flags) ==
817 ACPI_GPE_DISPATCH_NOTIFY)) && gpe_event_info->runtime_count) {
799 handler->originally_enabled = TRUE; 818 handler->originally_enabled = TRUE;
800 (void)acpi_ev_remove_gpe_reference(gpe_event_info); 819 (void)acpi_ev_remove_gpe_reference(gpe_event_info);
801 820
@@ -816,7 +835,10 @@ acpi_install_gpe_handler(acpi_handle gpe_device,
816 835
817 gpe_event_info->flags &= 836 gpe_event_info->flags &=
818 ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK); 837 ~(ACPI_GPE_XRUPT_TYPE_MASK | ACPI_GPE_DISPATCH_MASK);
819 gpe_event_info->flags |= (u8)(type | ACPI_GPE_DISPATCH_HANDLER); 838 gpe_event_info->flags |=
839 (u8)(type |
840 (is_raw_handler ? ACPI_GPE_DISPATCH_RAW_HANDLER :
841 ACPI_GPE_DISPATCH_HANDLER));
820 842
821 acpi_os_release_lock(acpi_gbl_gpe_lock, flags); 843 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
822 844
@@ -830,10 +852,78 @@ free_and_exit:
830 goto unlock_and_exit; 852 goto unlock_and_exit;
831} 853}
832 854
855/*******************************************************************************
856 *
857 * FUNCTION: acpi_install_gpe_handler
858 *
859 * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT
860 * defined GPEs)
861 * gpe_number - The GPE number within the GPE block
862 * type - Whether this GPE should be treated as an
863 * edge- or level-triggered interrupt.
864 * address - Address of the handler
865 * context - Value passed to the handler on each GPE
866 *
867 * RETURN: Status
868 *
869 * DESCRIPTION: Install a handler for a General Purpose Event.
870 *
871 ******************************************************************************/
872
873acpi_status
874acpi_install_gpe_handler(acpi_handle gpe_device,
875 u32 gpe_number,
876 u32 type, acpi_gpe_handler address, void *context)
877{
878 acpi_status status;
879
880 ACPI_FUNCTION_TRACE(acpi_install_gpe_handler);
881
882 status =
883 acpi_ev_install_gpe_handler(gpe_device, gpe_number, type, FALSE,
884 address, context);
885
886 return_ACPI_STATUS(status);
887}
888
833ACPI_EXPORT_SYMBOL(acpi_install_gpe_handler) 889ACPI_EXPORT_SYMBOL(acpi_install_gpe_handler)
834 890
835/******************************************************************************* 891/*******************************************************************************
836 * 892 *
893 * FUNCTION: acpi_install_gpe_raw_handler
894 *
895 * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT
896 * defined GPEs)
897 * gpe_number - The GPE number within the GPE block
898 * type - Whether this GPE should be treated as an
899 * edge- or level-triggered interrupt.
900 * address - Address of the handler
901 * context - Value passed to the handler on each GPE
902 *
903 * RETURN: Status
904 *
905 * DESCRIPTION: Install a handler for a General Purpose Event.
906 *
907 ******************************************************************************/
908acpi_status
909acpi_install_gpe_raw_handler(acpi_handle gpe_device,
910 u32 gpe_number,
911 u32 type, acpi_gpe_handler address, void *context)
912{
913 acpi_status status;
914
915 ACPI_FUNCTION_TRACE(acpi_install_gpe_raw_handler);
916
917 status = acpi_ev_install_gpe_handler(gpe_device, gpe_number, type, TRUE,
918 address, context);
919
920 return_ACPI_STATUS(status);
921}
922
923ACPI_EXPORT_SYMBOL(acpi_install_gpe_raw_handler)
924
925/*******************************************************************************
926 *
837 * FUNCTION: acpi_remove_gpe_handler 927 * FUNCTION: acpi_remove_gpe_handler
838 * 928 *
839 * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT 929 * PARAMETERS: gpe_device - Namespace node for the GPE (NULL for FADT
@@ -880,8 +970,10 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
880 970
881 /* Make sure that a handler is indeed installed */ 971 /* Make sure that a handler is indeed installed */
882 972
883 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) != 973 if ((ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) !=
884 ACPI_GPE_DISPATCH_HANDLER) { 974 ACPI_GPE_DISPATCH_HANDLER) &&
975 (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) !=
976 ACPI_GPE_DISPATCH_RAW_HANDLER)) {
885 status = AE_NOT_EXIST; 977 status = AE_NOT_EXIST;
886 goto unlock_and_exit; 978 goto unlock_and_exit;
887 } 979 }
@@ -896,6 +988,7 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
896 /* Remove the handler */ 988 /* Remove the handler */
897 989
898 handler = gpe_event_info->dispatch.handler; 990 handler = gpe_event_info->dispatch.handler;
991 gpe_event_info->dispatch.handler = NULL;
899 992
900 /* Restore Method node (if any), set dispatch flags */ 993 /* Restore Method node (if any), set dispatch flags */
901 994
@@ -909,9 +1002,10 @@ acpi_remove_gpe_handler(acpi_handle gpe_device,
909 * enabled, it should be enabled at this point to restore the 1002 * enabled, it should be enabled at this point to restore the
910 * post-initialization configuration. 1003 * post-initialization configuration.
911 */ 1004 */
912 if (((handler->original_flags & ACPI_GPE_DISPATCH_METHOD) || 1005 if (((ACPI_GPE_DISPATCH_TYPE(handler->original_flags) ==
913 (handler->original_flags & ACPI_GPE_DISPATCH_NOTIFY)) && 1006 ACPI_GPE_DISPATCH_METHOD) ||
914 handler->originally_enabled) { 1007 (ACPI_GPE_DISPATCH_TYPE(handler->original_flags) ==
1008 ACPI_GPE_DISPATCH_NOTIFY)) && handler->originally_enabled) {
915 (void)acpi_ev_add_gpe_reference(gpe_event_info); 1009 (void)acpi_ev_add_gpe_reference(gpe_event_info);
916 } 1010 }
917 1011
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index bb8cbf5961bf..df06a23c4197 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index e889a5304abd..70eb47e3d724 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -132,7 +132,7 @@ acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number)
132 */ 132 */
133 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number); 133 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
134 if (gpe_event_info) { 134 if (gpe_event_info) {
135 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) != 135 if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) !=
136 ACPI_GPE_DISPATCH_NONE) { 136 ACPI_GPE_DISPATCH_NONE) {
137 status = acpi_ev_add_gpe_reference(gpe_event_info); 137 status = acpi_ev_add_gpe_reference(gpe_event_info);
138 } else { 138 } else {
@@ -183,6 +183,77 @@ acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number)
183 183
184ACPI_EXPORT_SYMBOL(acpi_disable_gpe) 184ACPI_EXPORT_SYMBOL(acpi_disable_gpe)
185 185
186/*******************************************************************************
187 *
188 * FUNCTION: acpi_set_gpe
189 *
190 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
191 * gpe_number - GPE level within the GPE block
192 * action - ACPI_GPE_ENABLE or ACPI_GPE_DISABLE
193 *
194 * RETURN: Status
195 *
196 * DESCRIPTION: Enable or disable an individual GPE. This function bypasses
197 * the reference count mechanism used in the acpi_enable_gpe(),
198 * acpi_disable_gpe() interfaces.
199 * This API is typically used by the GPE raw handler mode driver
200 * to switch between the polling mode and the interrupt mode after
201 * the driver has enabled the GPE.
202 * The APIs should be invoked in this order:
203 * acpi_enable_gpe() <- Ensure the reference count > 0
204 * acpi_set_gpe(ACPI_GPE_DISABLE) <- Enter polling mode
205 * acpi_set_gpe(ACPI_GPE_ENABLE) <- Leave polling mode
206 * acpi_disable_gpe() <- Decrease the reference count
207 *
208 * Note: If a GPE is shared by 2 silicon components, then both the drivers
209 * should support GPE polling mode or disabling the GPE for long period
210 * for one driver may break the other. So use it with care since all
211 * firmware _Lxx/_Exx handlers currently rely on the GPE interrupt mode.
212 *
213 ******************************************************************************/
214acpi_status acpi_set_gpe(acpi_handle gpe_device, u32 gpe_number, u8 action)
215{
216 struct acpi_gpe_event_info *gpe_event_info;
217 acpi_status status;
218 acpi_cpu_flags flags;
219
220 ACPI_FUNCTION_TRACE(acpi_set_gpe);
221
222 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
223
224 /* Ensure that we have a valid GPE number */
225
226 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
227 if (!gpe_event_info) {
228 status = AE_BAD_PARAMETER;
229 goto unlock_and_exit;
230 }
231
232 /* Perform the action */
233
234 switch (action) {
235 case ACPI_GPE_ENABLE:
236
237 status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_ENABLE);
238 break;
239
240 case ACPI_GPE_DISABLE:
241
242 status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_DISABLE);
243 break;
244
245 default:
246
247 status = AE_BAD_PARAMETER;
248 break;
249 }
250
251unlock_and_exit:
252 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
253 return_ACPI_STATUS(status);
254}
255
256ACPI_EXPORT_SYMBOL(acpi_set_gpe)
186 257
187/******************************************************************************* 258/*******************************************************************************
188 * 259 *
@@ -313,7 +384,7 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device,
313 * known as an "implicit notify". Note: The GPE is assumed to be 384 * known as an "implicit notify". Note: The GPE is assumed to be
314 * level-triggered (for windows compatibility). 385 * level-triggered (for windows compatibility).
315 */ 386 */
316 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 387 if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
317 ACPI_GPE_DISPATCH_NONE) { 388 ACPI_GPE_DISPATCH_NONE) {
318 /* 389 /*
319 * This is the first device for implicit notify on this GPE. 390 * This is the first device for implicit notify on this GPE.
@@ -327,7 +398,7 @@ acpi_setup_gpe_for_wake(acpi_handle wake_device,
327 * If we already have an implicit notify on this GPE, add 398 * If we already have an implicit notify on this GPE, add
328 * this device to the notify list. 399 * this device to the notify list.
329 */ 400 */
330 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) == 401 if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) ==
331 ACPI_GPE_DISPATCH_NOTIFY) { 402 ACPI_GPE_DISPATCH_NOTIFY) {
332 403
333 /* Ensure that the device is not already in the list */ 404 /* Ensure that the device is not already in the list */
@@ -530,6 +601,49 @@ unlock_and_exit:
530 601
531ACPI_EXPORT_SYMBOL(acpi_get_gpe_status) 602ACPI_EXPORT_SYMBOL(acpi_get_gpe_status)
532 603
604/*******************************************************************************
605 *
606 * FUNCTION: acpi_finish_gpe
607 *
608 * PARAMETERS: gpe_device - Namespace node for the GPE Block
609 * (NULL for FADT defined GPEs)
610 * gpe_number - GPE level within the GPE block
611 *
612 * RETURN: Status
613 *
614 * DESCRIPTION: Clear and conditionally reenable a GPE. This completes the GPE
615 * processing. Intended for use by asynchronous host-installed
616 * GPE handlers. The GPE is only reenabled if the enable_for_run bit
617 * is set in the GPE info.
618 *
619 ******************************************************************************/
620acpi_status acpi_finish_gpe(acpi_handle gpe_device, u32 gpe_number)
621{
622 struct acpi_gpe_event_info *gpe_event_info;
623 acpi_status status;
624 acpi_cpu_flags flags;
625
626 ACPI_FUNCTION_TRACE(acpi_finish_gpe);
627
628 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
629
630 /* Ensure that we have a valid GPE number */
631
632 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
633 if (!gpe_event_info) {
634 status = AE_BAD_PARAMETER;
635 goto unlock_and_exit;
636 }
637
638 status = acpi_ev_finish_gpe(gpe_event_info);
639
640unlock_and_exit:
641 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
642 return_ACPI_STATUS(status);
643}
644
645ACPI_EXPORT_SYMBOL(acpi_finish_gpe)
646
533/****************************************************************************** 647/******************************************************************************
534 * 648 *
535 * FUNCTION: acpi_disable_all_gpes 649 * FUNCTION: acpi_disable_all_gpes
@@ -604,7 +718,6 @@ ACPI_EXPORT_SYMBOL(acpi_enable_all_runtime_gpes)
604 * all GPE blocks. 718 * all GPE blocks.
605 * 719 *
606 ******************************************************************************/ 720 ******************************************************************************/
607
608acpi_status acpi_enable_all_wakeup_gpes(void) 721acpi_status acpi_enable_all_wakeup_gpes(void)
609{ 722{
610 acpi_status status; 723 acpi_status status;
diff --git a/drivers/acpi/acpica/evxfregn.c b/drivers/acpi/acpica/evxfregn.c
index 2d6f187939c7..f21afbab03f7 100644
--- a/drivers/acpi/acpica/evxfregn.c
+++ b/drivers/acpi/acpica/evxfregn.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exconfig.c b/drivers/acpi/acpica/exconfig.c
index 7d2949420db7..6e0df2b9d5a4 100644
--- a/drivers/acpi/acpica/exconfig.c
+++ b/drivers/acpi/acpica/exconfig.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exconvrt.c b/drivers/acpi/acpica/exconvrt.c
index c545386fee96..89a976b4ccf2 100644
--- a/drivers/acpi/acpica/exconvrt.c
+++ b/drivers/acpi/acpica/exconvrt.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/excreate.c b/drivers/acpi/acpica/excreate.c
index 95d23dabcfbb..aaeea4840aaa 100644
--- a/drivers/acpi/acpica/excreate.c
+++ b/drivers/acpi/acpica/excreate.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exdebug.c b/drivers/acpi/acpica/exdebug.c
index 6fbfad47518c..e67d0aca3fe6 100644
--- a/drivers/acpi/acpica/exdebug.c
+++ b/drivers/acpi/acpica/exdebug.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c
index 0f23c3f2678e..7c213b6b6472 100644
--- a/drivers/acpi/acpica/exdump.c
+++ b/drivers/acpi/acpica/exdump.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c
index b994845ed359..c161dd974f74 100644
--- a/drivers/acpi/acpica/exfield.c
+++ b/drivers/acpi/acpica/exfield.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exfldio.c b/drivers/acpi/acpica/exfldio.c
index 1d1b27a96c5b..49479927e7f7 100644
--- a/drivers/acpi/acpica/exfldio.c
+++ b/drivers/acpi/acpica/exfldio.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exmisc.c b/drivers/acpi/acpica/exmisc.c
index 2207e624f538..b56fc9d6f48e 100644
--- a/drivers/acpi/acpica/exmisc.c
+++ b/drivers/acpi/acpica/exmisc.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exmutex.c b/drivers/acpi/acpica/exmutex.c
index b49ea2a95f4f..472030f2b5bb 100644
--- a/drivers/acpi/acpica/exmutex.c
+++ b/drivers/acpi/acpica/exmutex.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exnames.c b/drivers/acpi/acpica/exnames.c
index dbb03b544e8c..453b00c30177 100644
--- a/drivers/acpi/acpica/exnames.c
+++ b/drivers/acpi/acpica/exnames.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c
index 1b8e94104407..77930683ab7d 100644
--- a/drivers/acpi/acpica/exoparg1.c
+++ b/drivers/acpi/acpica/exoparg1.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exoparg2.c b/drivers/acpi/acpica/exoparg2.c
index 2ede656ee26a..fcc618aa2061 100644
--- a/drivers/acpi/acpica/exoparg2.c
+++ b/drivers/acpi/acpica/exoparg2.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exoparg3.c b/drivers/acpi/acpica/exoparg3.c
index 363767cf01e5..b813fed95e56 100644
--- a/drivers/acpi/acpica/exoparg3.c
+++ b/drivers/acpi/acpica/exoparg3.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exoparg6.c b/drivers/acpi/acpica/exoparg6.c
index 29e9e99f7fe3..c930edda3f65 100644
--- a/drivers/acpi/acpica/exoparg6.c
+++ b/drivers/acpi/acpica/exoparg6.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exprep.c b/drivers/acpi/acpica/exprep.c
index 118e942005e5..4c2836dc825b 100644
--- a/drivers/acpi/acpica/exprep.c
+++ b/drivers/acpi/acpica/exprep.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
index cd5288a257a9..0fe188e238ef 100644
--- a/drivers/acpi/acpica/exregion.c
+++ b/drivers/acpi/acpica/exregion.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exresnte.c b/drivers/acpi/acpica/exresnte.c
index ab060261b43e..c7e3b929aa85 100644
--- a/drivers/acpi/acpica/exresnte.c
+++ b/drivers/acpi/acpica/exresnte.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exresolv.c b/drivers/acpi/acpica/exresolv.c
index 3cde553bcbe1..b6b7f3af29e4 100644
--- a/drivers/acpi/acpica/exresolv.c
+++ b/drivers/acpi/acpica/exresolv.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exresop.c b/drivers/acpi/acpica/exresop.c
index 3af8de3fcea4..d2964af9ad4d 100644
--- a/drivers/acpi/acpica/exresop.c
+++ b/drivers/acpi/acpica/exresop.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exstore.c b/drivers/acpi/acpica/exstore.c
index daf49f7ea311..a7eee2400ce0 100644
--- a/drivers/acpi/acpica/exstore.c
+++ b/drivers/acpi/acpica/exstore.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exstoren.c b/drivers/acpi/acpica/exstoren.c
index 04bd16c08f9e..3101607b4efe 100644
--- a/drivers/acpi/acpica/exstoren.c
+++ b/drivers/acpi/acpica/exstoren.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exstorob.c b/drivers/acpi/acpica/exstorob.c
index fd11018b0168..6fa3c8d8fc5f 100644
--- a/drivers/acpi/acpica/exstorob.c
+++ b/drivers/acpi/acpica/exstorob.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exsystem.c b/drivers/acpi/acpica/exsystem.c
index f7da64123ed5..05450656fe3d 100644
--- a/drivers/acpi/acpica/exsystem.c
+++ b/drivers/acpi/acpica/exsystem.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/exutils.c b/drivers/acpi/acpica/exutils.c
index d9d72dff2a76..3f4225e95d93 100644
--- a/drivers/acpi/acpica/exutils.c
+++ b/drivers/acpi/acpica/exutils.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwacpi.c b/drivers/acpi/acpica/hwacpi.c
index 1e66d960fc11..e5c5949f9081 100644
--- a/drivers/acpi/acpica/hwacpi.c
+++ b/drivers/acpi/acpica/hwacpi.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwesleep.c b/drivers/acpi/acpica/hwesleep.c
index 858fdd6be598..e5599f610808 100644
--- a/drivers/acpi/acpica/hwesleep.c
+++ b/drivers/acpi/acpica/hwesleep.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwgpe.c b/drivers/acpi/acpica/hwgpe.c
index 494027f5c067..84bc550f4f1d 100644
--- a/drivers/acpi/acpica/hwgpe.c
+++ b/drivers/acpi/acpica/hwgpe.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -54,6 +54,10 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
54 struct acpi_gpe_block_info *gpe_block, 54 struct acpi_gpe_block_info *gpe_block,
55 void *context); 55 void *context);
56 56
57static acpi_status
58acpi_hw_gpe_enable_write(u8 enable_mask,
59 struct acpi_gpe_register_info *gpe_register_info);
60
57/****************************************************************************** 61/******************************************************************************
58 * 62 *
59 * FUNCTION: acpi_hw_get_gpe_register_bit 63 * FUNCTION: acpi_hw_get_gpe_register_bit
@@ -146,7 +150,7 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action)
146 150
147 status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address); 151 status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
148 if (ACPI_SUCCESS(status) && (action & ACPI_GPE_SAVE_MASK)) { 152 if (ACPI_SUCCESS(status) && (action & ACPI_GPE_SAVE_MASK)) {
149 gpe_register_info->enable_mask = enable_mask; 153 gpe_register_info->enable_mask = (u8)enable_mask;
150 } 154 }
151 return (status); 155 return (status);
152} 156}
@@ -221,7 +225,7 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
221 225
222 /* GPE currently handled? */ 226 /* GPE currently handled? */
223 227
224 if ((gpe_event_info->flags & ACPI_GPE_DISPATCH_MASK) != 228 if (ACPI_GPE_DISPATCH_TYPE(gpe_event_info->flags) !=
225 ACPI_GPE_DISPATCH_NONE) { 229 ACPI_GPE_DISPATCH_NONE) {
226 local_event_status |= ACPI_EVENT_FLAG_HAS_HANDLER; 230 local_event_status |= ACPI_EVENT_FLAG_HAS_HANDLER;
227 } 231 }
diff --git a/drivers/acpi/acpica/hwpci.c b/drivers/acpi/acpica/hwpci.c
index 6aade8e1d2a1..c5214dec4988 100644
--- a/drivers/acpi/acpica/hwpci.c
+++ b/drivers/acpi/acpica/hwpci.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index a4c34d2c556b..3cf77afd142c 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -6,7 +6,7 @@
6 ******************************************************************************/ 6 ******************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index d590693eb54e..7d21cae6d602 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwtimer.c b/drivers/acpi/acpica/hwtimer.c
index 76ab5c1a814e..675c709a300b 100644
--- a/drivers/acpi/acpica/hwtimer.c
+++ b/drivers/acpi/acpica/hwtimer.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwvalid.c b/drivers/acpi/acpica/hwvalid.c
index 6b919127cd9d..2bd33fe56cb3 100644
--- a/drivers/acpi/acpica/hwvalid.c
+++ b/drivers/acpi/acpica/hwvalid.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwxface.c b/drivers/acpi/acpica/hwxface.c
index 96d007df65ec..5f97468df8ff 100644
--- a/drivers/acpi/acpica/hwxface.c
+++ b/drivers/acpi/acpica/hwxface.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/hwxfsleep.c b/drivers/acpi/acpica/hwxfsleep.c
index 6921c7f3d208..3b3767698827 100644
--- a/drivers/acpi/acpica/hwxfsleep.c
+++ b/drivers/acpi/acpica/hwxfsleep.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
index f1249e3463be..24fa19a76d70 100644
--- a/drivers/acpi/acpica/nsaccess.c
+++ b/drivers/acpi/acpica/nsaccess.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsalloc.c b/drivers/acpi/acpica/nsalloc.c
index 607eb9e5150d..e107f929d9cf 100644
--- a/drivers/acpi/acpica/nsalloc.c
+++ b/drivers/acpi/acpica/nsalloc.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsarguments.c b/drivers/acpi/acpica/nsarguments.c
index 80fcfc8c9c1b..5d347a71bd0b 100644
--- a/drivers/acpi/acpica/nsarguments.c
+++ b/drivers/acpi/acpica/nsarguments.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsconvert.c b/drivers/acpi/acpica/nsconvert.c
index b55642c4ee58..1a8b39c8d969 100644
--- a/drivers/acpi/acpica/nsconvert.c
+++ b/drivers/acpi/acpica/nsconvert.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsdump.c b/drivers/acpi/acpica/nsdump.c
index 3d88ef4a3e0d..80f097eb7381 100644
--- a/drivers/acpi/acpica/nsdump.c
+++ b/drivers/acpi/acpica/nsdump.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsdumpdv.c b/drivers/acpi/acpica/nsdumpdv.c
index 42d37109aa5d..7dc367e6fe09 100644
--- a/drivers/acpi/acpica/nsdumpdv.c
+++ b/drivers/acpi/acpica/nsdumpdv.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nseval.c b/drivers/acpi/acpica/nseval.c
index e634a05974db..7bcc68f57afa 100644
--- a/drivers/acpi/acpica/nseval.c
+++ b/drivers/acpi/acpica/nseval.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsinit.c b/drivers/acpi/acpica/nsinit.c
index a3fb7e4c0809..4a85c4517988 100644
--- a/drivers/acpi/acpica/nsinit.c
+++ b/drivers/acpi/acpica/nsinit.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsload.c b/drivers/acpi/acpica/nsload.c
index 7c9d0181f341..bd6cd4a81316 100644
--- a/drivers/acpi/acpica/nsload.c
+++ b/drivers/acpi/acpica/nsload.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsnames.c b/drivers/acpi/acpica/nsnames.c
index 7eee0a6f02f6..d293d9748036 100644
--- a/drivers/acpi/acpica/nsnames.c
+++ b/drivers/acpi/acpica/nsnames.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsobject.c b/drivers/acpi/acpica/nsobject.c
index a42ee9d6970d..677bc9330e64 100644
--- a/drivers/acpi/acpica/nsobject.c
+++ b/drivers/acpi/acpica/nsobject.c
@@ -6,7 +6,7 @@
6 ******************************************************************************/ 6 ******************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsparse.c b/drivers/acpi/acpica/nsparse.c
index e83cff31754b..c95a119767b5 100644
--- a/drivers/acpi/acpica/nsparse.c
+++ b/drivers/acpi/acpica/nsparse.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c
index 392910ffbed9..0eb54315b4be 100644
--- a/drivers/acpi/acpica/nspredef.c
+++ b/drivers/acpi/acpica/nspredef.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsprepkg.c b/drivers/acpi/acpica/nsprepkg.c
index 1b13b921dda9..8b79958b7aca 100644
--- a/drivers/acpi/acpica/nsprepkg.c
+++ b/drivers/acpi/acpica/nsprepkg.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsrepair.c b/drivers/acpi/acpica/nsrepair.c
index 7e417aa5c91e..151fcd95ba84 100644
--- a/drivers/acpi/acpica/nsrepair.c
+++ b/drivers/acpi/acpica/nsrepair.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index b09e6bef72b8..c30672d23878 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nssearch.c b/drivers/acpi/acpica/nssearch.c
index af1cc42a8aa1..4a9d4a66016e 100644
--- a/drivers/acpi/acpica/nssearch.c
+++ b/drivers/acpi/acpica/nssearch.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsutils.c b/drivers/acpi/acpica/nsutils.c
index 4a5e3f5c0ff7..6ad02008c0c2 100644
--- a/drivers/acpi/acpica/nsutils.c
+++ b/drivers/acpi/acpica/nsutils.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nswalk.c b/drivers/acpi/acpica/nswalk.c
index 4758a1f2ce22..c68609a2bc1b 100644
--- a/drivers/acpi/acpica/nswalk.c
+++ b/drivers/acpi/acpica/nswalk.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsxfeval.c b/drivers/acpi/acpica/nsxfeval.c
index 4bd558bf10d2..b6030a2deee1 100644
--- a/drivers/acpi/acpica/nsxfeval.c
+++ b/drivers/acpi/acpica/nsxfeval.c
@@ -6,7 +6,7 @@
6 ******************************************************************************/ 6 ******************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index 8c6c11ce9760..d66c326485d8 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/nsxfobj.c b/drivers/acpi/acpica/nsxfobj.c
index 51a83298c18d..793383501f81 100644
--- a/drivers/acpi/acpica/nsxfobj.c
+++ b/drivers/acpi/acpica/nsxfobj.c
@@ -6,7 +6,7 @@
6 ******************************************************************************/ 6 ******************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2014, Intel Corp. 9 * Copyright (C) 2000 - 2015, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psargs.c b/drivers/acpi/acpica/psargs.c
index 314d314340ae..6d038770577b 100644
--- a/drivers/acpi/acpica/psargs.c
+++ b/drivers/acpi/acpica/psargs.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
index b058e2390fdd..90437227d790 100644
--- a/drivers/acpi/acpica/psloop.c
+++ b/drivers/acpi/acpica/psloop.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psobject.c b/drivers/acpi/acpica/psobject.c
index a6885077d59e..2f5ddd806c58 100644
--- a/drivers/acpi/acpica/psobject.c
+++ b/drivers/acpi/acpica/psobject.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psopcode.c b/drivers/acpi/acpica/psopcode.c
index 1755d2ac5656..1af4a405e351 100644
--- a/drivers/acpi/acpica/psopcode.c
+++ b/drivers/acpi/acpica/psopcode.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psopinfo.c b/drivers/acpi/acpica/psopinfo.c
index 0d8d37ffd04d..e18e7c47f482 100644
--- a/drivers/acpi/acpica/psopinfo.c
+++ b/drivers/acpi/acpica/psopinfo.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psparse.c b/drivers/acpi/acpica/psparse.c
index 6d27b597394e..a555f7f7b9a2 100644
--- a/drivers/acpi/acpica/psparse.c
+++ b/drivers/acpi/acpica/psparse.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psscope.c b/drivers/acpi/acpica/psscope.c
index 32d250feea21..9d669cc6cb62 100644
--- a/drivers/acpi/acpica/psscope.c
+++ b/drivers/acpi/acpica/psscope.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/pstree.c b/drivers/acpi/acpica/pstree.c
index 0b64181e7720..89984f30addc 100644
--- a/drivers/acpi/acpica/pstree.c
+++ b/drivers/acpi/acpica/pstree.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c
index 3cd48802eede..960505ab409a 100644
--- a/drivers/acpi/acpica/psutils.c
+++ b/drivers/acpi/acpica/psutils.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/pswalk.c b/drivers/acpi/acpica/pswalk.c
index 9cb07e1e76d9..ba5f69171288 100644
--- a/drivers/acpi/acpica/pswalk.c
+++ b/drivers/acpi/acpica/pswalk.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/psxface.c b/drivers/acpi/acpica/psxface.c
index e135acaa5e1c..841a5ea06094 100644
--- a/drivers/acpi/acpica/psxface.c
+++ b/drivers/acpi/acpica/psxface.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsaddr.c b/drivers/acpi/acpica/rsaddr.c
index 94a3a057042c..66d406e8fe36 100644
--- a/drivers/acpi/acpica/rsaddr.c
+++ b/drivers/acpi/acpica/rsaddr.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c
index 689556744b03..cb739a694931 100644
--- a/drivers/acpi/acpica/rscalc.c
+++ b/drivers/acpi/acpica/rscalc.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rscreate.c b/drivers/acpi/acpica/rscreate.c
index 049d9c22a0f9..15434e4c9b34 100644
--- a/drivers/acpi/acpica/rscreate.c
+++ b/drivers/acpi/acpica/rscreate.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsdump.c b/drivers/acpi/acpica/rsdump.c
index c3c56b5a9788..1539394c8c52 100644
--- a/drivers/acpi/acpica/rsdump.c
+++ b/drivers/acpi/acpica/rsdump.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsdumpinfo.c b/drivers/acpi/acpica/rsdumpinfo.c
index 6ba7ad5faa9c..b29d9ec63d1b 100644
--- a/drivers/acpi/acpica/rsdumpinfo.c
+++ b/drivers/acpi/acpica/rsdumpinfo.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsinfo.c b/drivers/acpi/acpica/rsinfo.c
index 9d3f8a9a24bd..edecfc675979 100644
--- a/drivers/acpi/acpica/rsinfo.c
+++ b/drivers/acpi/acpica/rsinfo.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsio.c b/drivers/acpi/acpica/rsio.c
index 19d64873290a..5adba018bab0 100644
--- a/drivers/acpi/acpica/rsio.c
+++ b/drivers/acpi/acpica/rsio.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsirq.c b/drivers/acpi/acpica/rsirq.c
index 3461f7db26df..07cfa70a475b 100644
--- a/drivers/acpi/acpica/rsirq.c
+++ b/drivers/acpi/acpica/rsirq.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rslist.c b/drivers/acpi/acpica/rslist.c
index 77291293af64..50d5be2ee062 100644
--- a/drivers/acpi/acpica/rslist.c
+++ b/drivers/acpi/acpica/rslist.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsmemory.c b/drivers/acpi/acpica/rsmemory.c
index eab4483ff5f8..c6b80862030e 100644
--- a/drivers/acpi/acpica/rsmemory.c
+++ b/drivers/acpi/acpica/rsmemory.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsmisc.c b/drivers/acpi/acpica/rsmisc.c
index 41eea4bc089c..1fe49d223663 100644
--- a/drivers/acpi/acpica/rsmisc.c
+++ b/drivers/acpi/acpica/rsmisc.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsserial.c b/drivers/acpi/acpica/rsserial.c
index 9e8407223d95..4c8c6fe6ea74 100644
--- a/drivers/acpi/acpica/rsserial.c
+++ b/drivers/acpi/acpica/rsserial.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c
index 897a5ceb0420..ece3cd60cc6a 100644
--- a/drivers/acpi/acpica/rsutils.c
+++ b/drivers/acpi/acpica/rsutils.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c
index 295287891174..8e6276df0226 100644
--- a/drivers/acpi/acpica/rsxface.c
+++ b/drivers/acpi/acpica/rsxface.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/tbdata.c b/drivers/acpi/acpica/tbdata.c
index f499c10ceb4a..6a144957aadd 100644
--- a/drivers/acpi/acpica/tbdata.c
+++ b/drivers/acpi/acpica/tbdata.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/tbfadt.c b/drivers/acpi/acpica/tbfadt.c
index 41519a958083..7d2486005e3f 100644
--- a/drivers/acpi/acpica/tbfadt.c
+++ b/drivers/acpi/acpica/tbfadt.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/tbfind.c b/drivers/acpi/acpica/tbfind.c
index cb947700206c..0b879fcfef67 100644
--- a/drivers/acpi/acpica/tbfind.c
+++ b/drivers/acpi/acpica/tbfind.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/tbinstal.c b/drivers/acpi/acpica/tbinstal.c
index 755b90c40ddf..9bad45e63a45 100644
--- a/drivers/acpi/acpica/tbinstal.c
+++ b/drivers/acpi/acpica/tbinstal.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/tbprint.c b/drivers/acpi/acpica/tbprint.c
index df3bb20ea325..ef16c06e5091 100644
--- a/drivers/acpi/acpica/tbprint.c
+++ b/drivers/acpi/acpica/tbprint.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
index 6b1ca9991b90..6559a58439c5 100644
--- a/drivers/acpi/acpica/tbutils.c
+++ b/drivers/acpi/acpica/tbutils.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/tbxface.c b/drivers/acpi/acpica/tbxface.c
index 0f9dd80b1cdd..60e94f87f27a 100644
--- a/drivers/acpi/acpica/tbxface.c
+++ b/drivers/acpi/acpica/tbxface.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/tbxfload.c b/drivers/acpi/acpica/tbxfload.c
index ab5308b81aa8..aadb3002a2dd 100644
--- a/drivers/acpi/acpica/tbxfload.c
+++ b/drivers/acpi/acpica/tbxfload.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/tbxfroot.c b/drivers/acpi/acpica/tbxfroot.c
index 43a54af2b548..eac52cf14f1a 100644
--- a/drivers/acpi/acpica/tbxfroot.c
+++ b/drivers/acpi/acpica/tbxfroot.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utaddress.c b/drivers/acpi/acpica/utaddress.c
index a1acec9d2ef3..1279f50da757 100644
--- a/drivers/acpi/acpica/utaddress.c
+++ b/drivers/acpi/acpica/utaddress.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utalloc.c b/drivers/acpi/acpica/utalloc.c
index efac83c606dc..61d8f6d186d1 100644
--- a/drivers/acpi/acpica/utalloc.c
+++ b/drivers/acpi/acpica/utalloc.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utbuffer.c b/drivers/acpi/acpica/utbuffer.c
index 038ea887f562..242bd071f007 100644
--- a/drivers/acpi/acpica/utbuffer.c
+++ b/drivers/acpi/acpica/utbuffer.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utcache.c b/drivers/acpi/acpica/utcache.c
index 78fde0aac487..eacc5eee362e 100644
--- a/drivers/acpi/acpica/utcache.c
+++ b/drivers/acpi/acpica/utcache.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utcopy.c b/drivers/acpi/acpica/utcopy.c
index ff601c0f7c7a..c37ec5035f4c 100644
--- a/drivers/acpi/acpica/utcopy.c
+++ b/drivers/acpi/acpica/utcopy.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index e516254c63b2..57078e3ea9b7 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c
index 40e923e675fc..988e23b7795c 100644
--- a/drivers/acpi/acpica/utdecode.c
+++ b/drivers/acpi/acpica/utdecode.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utdelete.c b/drivers/acpi/acpica/utdelete.c
index a3516de213fa..71fce389fd48 100644
--- a/drivers/acpi/acpica/utdelete.c
+++ b/drivers/acpi/acpica/utdelete.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/uterror.c b/drivers/acpi/acpica/uterror.c
index 8e544d4688cd..9ef80f2828e3 100644
--- a/drivers/acpi/acpica/uterror.c
+++ b/drivers/acpi/acpica/uterror.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/uteval.c b/drivers/acpi/acpica/uteval.c
index 8fed1482d228..6c738fa0cd42 100644
--- a/drivers/acpi/acpica/uteval.c
+++ b/drivers/acpi/acpica/uteval.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utexcep.c b/drivers/acpi/acpica/utexcep.c
index 0403dcaabaf2..743a0ae9fb17 100644
--- a/drivers/acpi/acpica/utexcep.c
+++ b/drivers/acpi/acpica/utexcep.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utfileio.c b/drivers/acpi/acpica/utfileio.c
index 4e263a8cc6f0..7e1168be39fa 100644
--- a/drivers/acpi/acpica/utfileio.c
+++ b/drivers/acpi/acpica/utfileio.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utglobal.c b/drivers/acpi/acpica/utglobal.c
index 77ceac715f28..5e8df9177da4 100644
--- a/drivers/acpi/acpica/utglobal.c
+++ b/drivers/acpi/acpica/utglobal.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/uthex.c b/drivers/acpi/acpica/uthex.c
index 9afa9441b183..aa448278ba28 100644
--- a/drivers/acpi/acpica/uthex.c
+++ b/drivers/acpi/acpica/uthex.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utids.c b/drivers/acpi/acpica/utids.c
index 4b12880e5b11..27431cfc1c44 100644
--- a/drivers/acpi/acpica/utids.c
+++ b/drivers/acpi/acpica/utids.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utinit.c b/drivers/acpi/acpica/utinit.c
index 77120ec9ea86..e402e07b4846 100644
--- a/drivers/acpi/acpica/utinit.c
+++ b/drivers/acpi/acpica/utinit.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utlock.c b/drivers/acpi/acpica/utlock.c
index dc6e96547f18..089f78bbd59b 100644
--- a/drivers/acpi/acpica/utlock.c
+++ b/drivers/acpi/acpica/utlock.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utmath.c b/drivers/acpi/acpica/utmath.c
index d44dee6ee10a..f9ff100f0159 100644
--- a/drivers/acpi/acpica/utmath.c
+++ b/drivers/acpi/acpica/utmath.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c
index 2e2bb14e1099..56bbacd576f2 100644
--- a/drivers/acpi/acpica/utmisc.c
+++ b/drivers/acpi/acpica/utmisc.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utmutex.c b/drivers/acpi/acpica/utmutex.c
index 82717fff9ffc..37b8b58fcd56 100644
--- a/drivers/acpi/acpica/utmutex.c
+++ b/drivers/acpi/acpica/utmutex.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c
index dfa9009bfc87..7d83efe1ea29 100644
--- a/drivers/acpi/acpica/utobject.c
+++ b/drivers/acpi/acpica/utobject.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utosi.c b/drivers/acpi/acpica/utosi.c
index 685766fc6ca8..574cd3118313 100644
--- a/drivers/acpi/acpica/utosi.c
+++ b/drivers/acpi/acpica/utosi.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utownerid.c b/drivers/acpi/acpica/utownerid.c
index 36bec57ebd23..2959217067cb 100644
--- a/drivers/acpi/acpica/utownerid.c
+++ b/drivers/acpi/acpica/utownerid.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utpredef.c b/drivers/acpi/acpica/utpredef.c
index db30caff130a..29e449935a82 100644
--- a/drivers/acpi/acpica/utpredef.c
+++ b/drivers/acpi/acpica/utpredef.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utprint.c b/drivers/acpi/acpica/utprint.c
index 0ce3f5a0dd67..82ca9142e10d 100644
--- a/drivers/acpi/acpica/utprint.c
+++ b/drivers/acpi/acpica/utprint.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c
index bc1ff820c7dd..b3505dbc715e 100644
--- a/drivers/acpi/acpica/utresrc.c
+++ b/drivers/acpi/acpica/utresrc.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utstate.c b/drivers/acpi/acpica/utstate.c
index 1cc97a752c15..8274cc16edc3 100644
--- a/drivers/acpi/acpica/utstate.c
+++ b/drivers/acpi/acpica/utstate.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utstring.c b/drivers/acpi/acpica/utstring.c
index 6dc54b3c28b0..83b6c52490dc 100644
--- a/drivers/acpi/acpica/utstring.c
+++ b/drivers/acpi/acpica/utstring.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/uttrack.c b/drivers/acpi/acpica/uttrack.c
index 7d0ee969d781..130dd9f96f0f 100644
--- a/drivers/acpi/acpica/uttrack.c
+++ b/drivers/acpi/acpica/uttrack.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utuuid.c b/drivers/acpi/acpica/utuuid.c
index 4dc33130f134..c6149a212149 100644
--- a/drivers/acpi/acpica/utuuid.c
+++ b/drivers/acpi/acpica/utuuid.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utxface.c b/drivers/acpi/acpica/utxface.c
index 49c873c68756..0929187bdce0 100644
--- a/drivers/acpi/acpica/utxface.c
+++ b/drivers/acpi/acpica/utxface.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utxferror.c b/drivers/acpi/acpica/utxferror.c
index 88ef77f3cf88..306e785f9418 100644
--- a/drivers/acpi/acpica/utxferror.c
+++ b/drivers/acpi/acpica/utxferror.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utxfinit.c b/drivers/acpi/acpica/utxfinit.c
index b1fd6886e439..083a76891889 100644
--- a/drivers/acpi/acpica/utxfinit.c
+++ b/drivers/acpi/acpica/utxfinit.c
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/acpica/utxfmutex.c b/drivers/acpi/acpica/utxfmutex.c
index 2a0f9e04d3a4..f2606af3364c 100644
--- a/drivers/acpi/acpica/utxfmutex.c
+++ b/drivers/acpi/acpica/utxfmutex.c
@@ -5,7 +5,7 @@
5 ******************************************************************************/ 5 ******************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2014, Intel Corp. 8 * Copyright (C) 2000 - 2015, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 1b5853f384e2..14d0c89ada2a 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * ec.c - ACPI Embedded Controller Driver (v2.2) 2 * ec.c - ACPI Embedded Controller Driver (v3)
3 * 3 *
4 * Copyright (C) 2001-2014 Intel Corporation 4 * Copyright (C) 2001-2015 Intel Corporation
5 * Author: 2014 Lv Zheng <lv.zheng@intel.com> 5 * Author: 2014, 2015 Lv Zheng <lv.zheng@intel.com>
6 * 2006, 2007 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com> 6 * 2006, 2007 Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
7 * 2006 Denis Sadykov <denis.m.sadykov@intel.com> 7 * 2006 Denis Sadykov <denis.m.sadykov@intel.com>
8 * 2004 Luming Yu <luming.yu@intel.com> 8 * 2004 Luming Yu <luming.yu@intel.com>
@@ -31,6 +31,7 @@
31 31
32/* Uncomment next line to get verbose printout */ 32/* Uncomment next line to get verbose printout */
33/* #define DEBUG */ 33/* #define DEBUG */
34#define DEBUG_REF 0
34#define pr_fmt(fmt) "ACPI : EC: " fmt 35#define pr_fmt(fmt) "ACPI : EC: " fmt
35 36
36#include <linux/kernel.h> 37#include <linux/kernel.h>
@@ -71,20 +72,32 @@ enum ec_command {
71#define ACPI_EC_DELAY 500 /* Wait 500ms max. during EC ops */ 72#define ACPI_EC_DELAY 500 /* Wait 500ms max. during EC ops */
72#define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */ 73#define ACPI_EC_UDELAY_GLK 1000 /* Wait 1ms max. to get global lock */
73#define ACPI_EC_MSI_UDELAY 550 /* Wait 550us for MSI EC */ 74#define ACPI_EC_MSI_UDELAY 550 /* Wait 550us for MSI EC */
75#define ACPI_EC_UDELAY_POLL 1000 /* Wait 1ms for EC transaction polling */
74#define ACPI_EC_CLEAR_MAX 100 /* Maximum number of events to query 76#define ACPI_EC_CLEAR_MAX 100 /* Maximum number of events to query
75 * when trying to clear the EC */ 77 * when trying to clear the EC */
76 78
77enum { 79enum {
78 EC_FLAGS_QUERY_PENDING, /* Query is pending */ 80 EC_FLAGS_EVENT_ENABLED, /* Event is enabled */
79 EC_FLAGS_GPE_STORM, /* GPE storm detected */ 81 EC_FLAGS_EVENT_PENDING, /* Event is pending */
82 EC_FLAGS_EVENT_DETECTED, /* Event is detected */
80 EC_FLAGS_HANDLERS_INSTALLED, /* Handlers for GPE and 83 EC_FLAGS_HANDLERS_INSTALLED, /* Handlers for GPE and
81 * OpReg are installed */ 84 * OpReg are installed */
82 EC_FLAGS_BLOCKED, /* Transactions are blocked */ 85 EC_FLAGS_STARTED, /* Driver is started */
86 EC_FLAGS_STOPPED, /* Driver is stopped */
87 EC_FLAGS_COMMAND_STORM, /* GPE storms occurred to the
88 * current command processing */
83}; 89};
84 90
85#define ACPI_EC_COMMAND_POLL 0x01 /* Available for command byte */ 91#define ACPI_EC_COMMAND_POLL 0x01 /* Available for command byte */
86#define ACPI_EC_COMMAND_COMPLETE 0x02 /* Completed last byte */ 92#define ACPI_EC_COMMAND_COMPLETE 0x02 /* Completed last byte */
87 93
94#define ec_debug_ref(ec, fmt, ...) \
95 do { \
96 if (DEBUG_REF) \
97 pr_debug("%lu: " fmt, ec->reference_count, \
98 ## __VA_ARGS__); \
99 } while (0)
100
88/* ec.c is compiled in acpi namespace so this shows up as acpi.ec_delay param */ 101/* ec.c is compiled in acpi namespace so this shows up as acpi.ec_delay param */
89static unsigned int ec_delay __read_mostly = ACPI_EC_DELAY; 102static unsigned int ec_delay __read_mostly = ACPI_EC_DELAY;
90module_param(ec_delay, uint, 0644); 103module_param(ec_delay, uint, 0644);
@@ -105,6 +118,7 @@ struct acpi_ec_query_handler {
105 acpi_handle handle; 118 acpi_handle handle;
106 void *data; 119 void *data;
107 u8 query_bit; 120 u8 query_bit;
121 struct kref kref;
108}; 122};
109 123
110struct transaction { 124struct transaction {
@@ -117,8 +131,12 @@ struct transaction {
117 u8 wlen; 131 u8 wlen;
118 u8 rlen; 132 u8 rlen;
119 u8 flags; 133 u8 flags;
134 unsigned long timestamp;
120}; 135};
121 136
137static int acpi_ec_query(struct acpi_ec *ec, u8 *data);
138static void advance_transaction(struct acpi_ec *ec);
139
122struct acpi_ec *boot_ec, *first_ec; 140struct acpi_ec *boot_ec, *first_ec;
123EXPORT_SYMBOL(first_ec); 141EXPORT_SYMBOL(first_ec);
124 142
@@ -129,7 +147,28 @@ static int EC_FLAGS_CLEAR_ON_RESUME; /* Needs acpi_ec_clear() on boot/resume */
129static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */ 147static int EC_FLAGS_QUERY_HANDSHAKE; /* Needs QR_EC issued when SCI_EVT set */
130 148
131/* -------------------------------------------------------------------------- 149/* --------------------------------------------------------------------------
132 * Transaction Management 150 * Device Flags
151 * -------------------------------------------------------------------------- */
152
153static bool acpi_ec_started(struct acpi_ec *ec)
154{
155 return test_bit(EC_FLAGS_STARTED, &ec->flags) &&
156 !test_bit(EC_FLAGS_STOPPED, &ec->flags);
157}
158
159static bool acpi_ec_flushed(struct acpi_ec *ec)
160{
161 return ec->reference_count == 1;
162}
163
164static bool acpi_ec_has_pending_event(struct acpi_ec *ec)
165{
166 return test_bit(EC_FLAGS_EVENT_DETECTED, &ec->flags) ||
167 test_bit(EC_FLAGS_EVENT_PENDING, &ec->flags);
168}
169
170/* --------------------------------------------------------------------------
171 * EC Registers
133 * -------------------------------------------------------------------------- */ 172 * -------------------------------------------------------------------------- */
134 173
135static inline u8 acpi_ec_read_status(struct acpi_ec *ec) 174static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
@@ -151,6 +190,7 @@ static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
151{ 190{
152 u8 x = inb(ec->data_addr); 191 u8 x = inb(ec->data_addr);
153 192
193 ec->curr->timestamp = jiffies;
154 pr_debug("EC_DATA(R) = 0x%2.2x\n", x); 194 pr_debug("EC_DATA(R) = 0x%2.2x\n", x);
155 return x; 195 return x;
156} 196}
@@ -159,12 +199,14 @@ static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
159{ 199{
160 pr_debug("EC_SC(W) = 0x%2.2x\n", command); 200 pr_debug("EC_SC(W) = 0x%2.2x\n", command);
161 outb(command, ec->command_addr); 201 outb(command, ec->command_addr);
202 ec->curr->timestamp = jiffies;
162} 203}
163 204
164static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data) 205static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
165{ 206{
166 pr_debug("EC_DATA(W) = 0x%2.2x\n", data); 207 pr_debug("EC_DATA(W) = 0x%2.2x\n", data);
167 outb(data, ec->data_addr); 208 outb(data, ec->data_addr);
209 ec->curr->timestamp = jiffies;
168} 210}
169 211
170#ifdef DEBUG 212#ifdef DEBUG
@@ -188,6 +230,203 @@ static const char *acpi_ec_cmd_string(u8 cmd)
188#define acpi_ec_cmd_string(cmd) "UNDEF" 230#define acpi_ec_cmd_string(cmd) "UNDEF"
189#endif 231#endif
190 232
233/* --------------------------------------------------------------------------
234 * GPE Registers
235 * -------------------------------------------------------------------------- */
236
237static inline bool acpi_ec_is_gpe_raised(struct acpi_ec *ec)
238{
239 acpi_event_status gpe_status = 0;
240
241 (void)acpi_get_gpe_status(NULL, ec->gpe, &gpe_status);
242 return (gpe_status & ACPI_EVENT_FLAG_SET) ? true : false;
243}
244
245static inline void acpi_ec_enable_gpe(struct acpi_ec *ec, bool open)
246{
247 if (open)
248 acpi_enable_gpe(NULL, ec->gpe);
249 else {
250 BUG_ON(ec->reference_count < 1);
251 acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_ENABLE);
252 }
253 if (acpi_ec_is_gpe_raised(ec)) {
254 /*
255 * On some platforms, EN=1 writes cannot trigger GPE. So
256 * software need to manually trigger a pseudo GPE event on
257 * EN=1 writes.
258 */
259 pr_debug("***** Polling quirk *****\n");
260 advance_transaction(ec);
261 }
262}
263
264static inline void acpi_ec_disable_gpe(struct acpi_ec *ec, bool close)
265{
266 if (close)
267 acpi_disable_gpe(NULL, ec->gpe);
268 else {
269 BUG_ON(ec->reference_count < 1);
270 acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_DISABLE);
271 }
272}
273
274static inline void acpi_ec_clear_gpe(struct acpi_ec *ec)
275{
276 /*
277 * GPE STS is a W1C register, which means:
278 * 1. Software can clear it without worrying about clearing other
279 * GPEs' STS bits when the hardware sets them in parallel.
280 * 2. As long as software can ensure only clearing it when it is
281 * set, hardware won't set it in parallel.
282 * So software can clear GPE in any contexts.
283 * Warning: do not move the check into advance_transaction() as the
284 * EC commands will be sent without GPE raised.
285 */
286 if (!acpi_ec_is_gpe_raised(ec))
287 return;
288 acpi_clear_gpe(NULL, ec->gpe);
289}
290
291/* --------------------------------------------------------------------------
292 * Transaction Management
293 * -------------------------------------------------------------------------- */
294
295static void acpi_ec_submit_request(struct acpi_ec *ec)
296{
297 ec->reference_count++;
298 if (ec->reference_count == 1)
299 acpi_ec_enable_gpe(ec, true);
300}
301
302static void acpi_ec_complete_request(struct acpi_ec *ec)
303{
304 bool flushed = false;
305
306 ec->reference_count--;
307 if (ec->reference_count == 0)
308 acpi_ec_disable_gpe(ec, true);
309 flushed = acpi_ec_flushed(ec);
310 if (flushed)
311 wake_up(&ec->wait);
312}
313
314static void acpi_ec_set_storm(struct acpi_ec *ec, u8 flag)
315{
316 if (!test_bit(flag, &ec->flags)) {
317 acpi_ec_disable_gpe(ec, false);
318 pr_debug("+++++ Polling enabled +++++\n");
319 set_bit(flag, &ec->flags);
320 }
321}
322
323static void acpi_ec_clear_storm(struct acpi_ec *ec, u8 flag)
324{
325 if (test_bit(flag, &ec->flags)) {
326 clear_bit(flag, &ec->flags);
327 acpi_ec_enable_gpe(ec, false);
328 pr_debug("+++++ Polling disabled +++++\n");
329 }
330}
331
332/*
333 * acpi_ec_submit_flushable_request() - Increase the reference count unless
334 * the flush operation is not in
335 * progress
336 * @ec: the EC device
337 * @allow_event: whether event should be handled
338 *
339 * This function must be used before taking a new action that should hold
340 * the reference count. If this function returns false, then the action
341 * must be discarded or it will prevent the flush operation from being
342 * completed.
343 *
344 * During flushing, QR_EC command need to pass this check when there is a
345 * pending event, so that the reference count held for the pending event
346 * can be decreased by the completion of the QR_EC command.
347 */
348static bool acpi_ec_submit_flushable_request(struct acpi_ec *ec,
349 bool allow_event)
350{
351 if (!acpi_ec_started(ec)) {
352 if (!allow_event || !acpi_ec_has_pending_event(ec))
353 return false;
354 }
355 acpi_ec_submit_request(ec);
356 return true;
357}
358
359static void acpi_ec_submit_event(struct acpi_ec *ec)
360{
361 if (!test_bit(EC_FLAGS_EVENT_DETECTED, &ec->flags) ||
362 !test_bit(EC_FLAGS_EVENT_ENABLED, &ec->flags))
363 return;
364 /* Hold reference for pending event */
365 if (!acpi_ec_submit_flushable_request(ec, true))
366 return;
367 ec_debug_ref(ec, "Increase event\n");
368 if (!test_and_set_bit(EC_FLAGS_EVENT_PENDING, &ec->flags)) {
369 pr_debug("***** Event query started *****\n");
370 schedule_work(&ec->work);
371 return;
372 }
373 acpi_ec_complete_request(ec);
374 ec_debug_ref(ec, "Decrease event\n");
375}
376
377static void acpi_ec_complete_event(struct acpi_ec *ec)
378{
379 if (ec->curr->command == ACPI_EC_COMMAND_QUERY) {
380 clear_bit(EC_FLAGS_EVENT_PENDING, &ec->flags);
381 pr_debug("***** Event query stopped *****\n");
382 /* Unhold reference for pending event */
383 acpi_ec_complete_request(ec);
384 ec_debug_ref(ec, "Decrease event\n");
385 /* Check if there is another SCI_EVT detected */
386 acpi_ec_submit_event(ec);
387 }
388}
389
390static void acpi_ec_submit_detection(struct acpi_ec *ec)
391{
392 /* Hold reference for query submission */
393 if (!acpi_ec_submit_flushable_request(ec, false))
394 return;
395 ec_debug_ref(ec, "Increase query\n");
396 if (!test_and_set_bit(EC_FLAGS_EVENT_DETECTED, &ec->flags)) {
397 pr_debug("***** Event detection blocked *****\n");
398 acpi_ec_submit_event(ec);
399 return;
400 }
401 acpi_ec_complete_request(ec);
402 ec_debug_ref(ec, "Decrease query\n");
403}
404
405static void acpi_ec_complete_detection(struct acpi_ec *ec)
406{
407 if (ec->curr->command == ACPI_EC_COMMAND_QUERY) {
408 clear_bit(EC_FLAGS_EVENT_DETECTED, &ec->flags);
409 pr_debug("***** Event detetion unblocked *****\n");
410 /* Unhold reference for query submission */
411 acpi_ec_complete_request(ec);
412 ec_debug_ref(ec, "Decrease query\n");
413 }
414}
415
416static void acpi_ec_enable_event(struct acpi_ec *ec)
417{
418 unsigned long flags;
419
420 spin_lock_irqsave(&ec->lock, flags);
421 set_bit(EC_FLAGS_EVENT_ENABLED, &ec->flags);
422 /*
423 * An event may be pending even with SCI_EVT=0, so QR_EC should
424 * always be issued right after started.
425 */
426 acpi_ec_submit_detection(ec);
427 spin_unlock_irqrestore(&ec->lock, flags);
428}
429
191static int ec_transaction_completed(struct acpi_ec *ec) 430static int ec_transaction_completed(struct acpi_ec *ec)
192{ 431{
193 unsigned long flags; 432 unsigned long flags;
@@ -200,7 +439,7 @@ static int ec_transaction_completed(struct acpi_ec *ec)
200 return ret; 439 return ret;
201} 440}
202 441
203static bool advance_transaction(struct acpi_ec *ec) 442static void advance_transaction(struct acpi_ec *ec)
204{ 443{
205 struct transaction *t; 444 struct transaction *t;
206 u8 status; 445 u8 status;
@@ -208,6 +447,12 @@ static bool advance_transaction(struct acpi_ec *ec)
208 447
209 pr_debug("===== %s (%d) =====\n", 448 pr_debug("===== %s (%d) =====\n",
210 in_interrupt() ? "IRQ" : "TASK", smp_processor_id()); 449 in_interrupt() ? "IRQ" : "TASK", smp_processor_id());
450 /*
451 * By always clearing STS before handling all indications, we can
452 * ensure a hardware STS 0->1 change after this clearing can always
453 * trigger a GPE interrupt.
454 */
455 acpi_ec_clear_gpe(ec);
211 status = acpi_ec_read_status(ec); 456 status = acpi_ec_read_status(ec);
212 t = ec->curr; 457 t = ec->curr;
213 if (!t) 458 if (!t)
@@ -223,6 +468,7 @@ static bool advance_transaction(struct acpi_ec *ec)
223 t->rdata[t->ri++] = acpi_ec_read_data(ec); 468 t->rdata[t->ri++] = acpi_ec_read_data(ec);
224 if (t->rlen == t->ri) { 469 if (t->rlen == t->ri) {
225 t->flags |= ACPI_EC_COMMAND_COMPLETE; 470 t->flags |= ACPI_EC_COMMAND_COMPLETE;
471 acpi_ec_complete_event(ec);
226 if (t->command == ACPI_EC_COMMAND_QUERY) 472 if (t->command == ACPI_EC_COMMAND_QUERY)
227 pr_debug("***** Command(%s) hardware completion *****\n", 473 pr_debug("***** Command(%s) hardware completion *****\n",
228 acpi_ec_cmd_string(t->command)); 474 acpi_ec_cmd_string(t->command));
@@ -233,25 +479,29 @@ static bool advance_transaction(struct acpi_ec *ec)
233 } else if (t->wlen == t->wi && 479 } else if (t->wlen == t->wi &&
234 (status & ACPI_EC_FLAG_IBF) == 0) { 480 (status & ACPI_EC_FLAG_IBF) == 0) {
235 t->flags |= ACPI_EC_COMMAND_COMPLETE; 481 t->flags |= ACPI_EC_COMMAND_COMPLETE;
482 acpi_ec_complete_event(ec);
236 wakeup = true; 483 wakeup = true;
237 } 484 }
238 return wakeup; 485 goto out;
239 } else { 486 } else {
240 if (EC_FLAGS_QUERY_HANDSHAKE && 487 if (EC_FLAGS_QUERY_HANDSHAKE &&
241 !(status & ACPI_EC_FLAG_SCI) && 488 !(status & ACPI_EC_FLAG_SCI) &&
242 (t->command == ACPI_EC_COMMAND_QUERY)) { 489 (t->command == ACPI_EC_COMMAND_QUERY)) {
243 t->flags |= ACPI_EC_COMMAND_POLL; 490 t->flags |= ACPI_EC_COMMAND_POLL;
491 acpi_ec_complete_detection(ec);
244 t->rdata[t->ri++] = 0x00; 492 t->rdata[t->ri++] = 0x00;
245 t->flags |= ACPI_EC_COMMAND_COMPLETE; 493 t->flags |= ACPI_EC_COMMAND_COMPLETE;
494 acpi_ec_complete_event(ec);
246 pr_debug("***** Command(%s) software completion *****\n", 495 pr_debug("***** Command(%s) software completion *****\n",
247 acpi_ec_cmd_string(t->command)); 496 acpi_ec_cmd_string(t->command));
248 wakeup = true; 497 wakeup = true;
249 } else if ((status & ACPI_EC_FLAG_IBF) == 0) { 498 } else if ((status & ACPI_EC_FLAG_IBF) == 0) {
250 acpi_ec_write_cmd(ec, t->command); 499 acpi_ec_write_cmd(ec, t->command);
251 t->flags |= ACPI_EC_COMMAND_POLL; 500 t->flags |= ACPI_EC_COMMAND_POLL;
501 acpi_ec_complete_detection(ec);
252 } else 502 } else
253 goto err; 503 goto err;
254 return wakeup; 504 goto out;
255 } 505 }
256err: 506err:
257 /* 507 /*
@@ -259,28 +509,27 @@ err:
259 * otherwise will take a not handled IRQ as a false one. 509 * otherwise will take a not handled IRQ as a false one.
260 */ 510 */
261 if (!(status & ACPI_EC_FLAG_SCI)) { 511 if (!(status & ACPI_EC_FLAG_SCI)) {
262 if (in_interrupt() && t) 512 if (in_interrupt() && t) {
263 ++t->irq_count; 513 if (t->irq_count < ec_storm_threshold)
514 ++t->irq_count;
515 /* Allow triggering on 0 threshold */
516 if (t->irq_count == ec_storm_threshold)
517 acpi_ec_set_storm(ec, EC_FLAGS_COMMAND_STORM);
518 }
264 } 519 }
265 return wakeup; 520out:
521 if (status & ACPI_EC_FLAG_SCI)
522 acpi_ec_submit_detection(ec);
523 if (wakeup && in_interrupt())
524 wake_up(&ec->wait);
266} 525}
267 526
268static void start_transaction(struct acpi_ec *ec) 527static void start_transaction(struct acpi_ec *ec)
269{ 528{
270 ec->curr->irq_count = ec->curr->wi = ec->curr->ri = 0; 529 ec->curr->irq_count = ec->curr->wi = ec->curr->ri = 0;
271 ec->curr->flags = 0; 530 ec->curr->flags = 0;
272 (void)advance_transaction(ec); 531 ec->curr->timestamp = jiffies;
273} 532 advance_transaction(ec);
274
275static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data);
276
277static int ec_check_sci_sync(struct acpi_ec *ec, u8 state)
278{
279 if (state & ACPI_EC_FLAG_SCI) {
280 if (!test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags))
281 return acpi_ec_sync_query(ec, NULL);
282 }
283 return 0;
284} 533}
285 534
286static int ec_poll(struct acpi_ec *ec) 535static int ec_poll(struct acpi_ec *ec)
@@ -291,20 +540,25 @@ static int ec_poll(struct acpi_ec *ec)
291 while (repeat--) { 540 while (repeat--) {
292 unsigned long delay = jiffies + 541 unsigned long delay = jiffies +
293 msecs_to_jiffies(ec_delay); 542 msecs_to_jiffies(ec_delay);
543 unsigned long usecs = ACPI_EC_UDELAY_POLL;
294 do { 544 do {
295 /* don't sleep with disabled interrupts */ 545 /* don't sleep with disabled interrupts */
296 if (EC_FLAGS_MSI || irqs_disabled()) { 546 if (EC_FLAGS_MSI || irqs_disabled()) {
297 udelay(ACPI_EC_MSI_UDELAY); 547 usecs = ACPI_EC_MSI_UDELAY;
548 udelay(usecs);
298 if (ec_transaction_completed(ec)) 549 if (ec_transaction_completed(ec))
299 return 0; 550 return 0;
300 } else { 551 } else {
301 if (wait_event_timeout(ec->wait, 552 if (wait_event_timeout(ec->wait,
302 ec_transaction_completed(ec), 553 ec_transaction_completed(ec),
303 msecs_to_jiffies(1))) 554 usecs_to_jiffies(usecs)))
304 return 0; 555 return 0;
305 } 556 }
306 spin_lock_irqsave(&ec->lock, flags); 557 spin_lock_irqsave(&ec->lock, flags);
307 (void)advance_transaction(ec); 558 if (time_after(jiffies,
559 ec->curr->timestamp +
560 usecs_to_jiffies(usecs)))
561 advance_transaction(ec);
308 spin_unlock_irqrestore(&ec->lock, flags); 562 spin_unlock_irqrestore(&ec->lock, flags);
309 } while (time_before(jiffies, delay)); 563 } while (time_before(jiffies, delay));
310 pr_debug("controller reset, restart transaction\n"); 564 pr_debug("controller reset, restart transaction\n");
@@ -325,21 +579,29 @@ static int acpi_ec_transaction_unlocked(struct acpi_ec *ec,
325 udelay(ACPI_EC_MSI_UDELAY); 579 udelay(ACPI_EC_MSI_UDELAY);
326 /* start transaction */ 580 /* start transaction */
327 spin_lock_irqsave(&ec->lock, tmp); 581 spin_lock_irqsave(&ec->lock, tmp);
582 /* Enable GPE for command processing (IBF=0/OBF=1) */
583 if (!acpi_ec_submit_flushable_request(ec, true)) {
584 ret = -EINVAL;
585 goto unlock;
586 }
587 ec_debug_ref(ec, "Increase command\n");
328 /* following two actions should be kept atomic */ 588 /* following two actions should be kept atomic */
329 ec->curr = t; 589 ec->curr = t;
330 pr_debug("***** Command(%s) started *****\n", 590 pr_debug("***** Command(%s) started *****\n",
331 acpi_ec_cmd_string(t->command)); 591 acpi_ec_cmd_string(t->command));
332 start_transaction(ec); 592 start_transaction(ec);
333 if (ec->curr->command == ACPI_EC_COMMAND_QUERY) {
334 clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags);
335 pr_debug("***** Event stopped *****\n");
336 }
337 spin_unlock_irqrestore(&ec->lock, tmp); 593 spin_unlock_irqrestore(&ec->lock, tmp);
338 ret = ec_poll(ec); 594 ret = ec_poll(ec);
339 spin_lock_irqsave(&ec->lock, tmp); 595 spin_lock_irqsave(&ec->lock, tmp);
596 if (t->irq_count == ec_storm_threshold)
597 acpi_ec_clear_storm(ec, EC_FLAGS_COMMAND_STORM);
340 pr_debug("***** Command(%s) stopped *****\n", 598 pr_debug("***** Command(%s) stopped *****\n",
341 acpi_ec_cmd_string(t->command)); 599 acpi_ec_cmd_string(t->command));
342 ec->curr = NULL; 600 ec->curr = NULL;
601 /* Disable GPE for command processing (IBF=0/OBF=1) */
602 acpi_ec_complete_request(ec);
603 ec_debug_ref(ec, "Decrease command\n");
604unlock:
343 spin_unlock_irqrestore(&ec->lock, tmp); 605 spin_unlock_irqrestore(&ec->lock, tmp);
344 return ret; 606 return ret;
345} 607}
@@ -354,10 +616,6 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
354 if (t->rdata) 616 if (t->rdata)
355 memset(t->rdata, 0, t->rlen); 617 memset(t->rdata, 0, t->rlen);
356 mutex_lock(&ec->mutex); 618 mutex_lock(&ec->mutex);
357 if (test_bit(EC_FLAGS_BLOCKED, &ec->flags)) {
358 status = -EINVAL;
359 goto unlock;
360 }
361 if (ec->global_lock) { 619 if (ec->global_lock) {
362 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk); 620 status = acpi_acquire_global_lock(ACPI_EC_UDELAY_GLK, &glk);
363 if (ACPI_FAILURE(status)) { 621 if (ACPI_FAILURE(status)) {
@@ -365,26 +623,11 @@ static int acpi_ec_transaction(struct acpi_ec *ec, struct transaction *t)
365 goto unlock; 623 goto unlock;
366 } 624 }
367 } 625 }
368 /* disable GPE during transaction if storm is detected */
369 if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) {
370 /* It has to be disabled, so that it doesn't trigger. */
371 acpi_disable_gpe(NULL, ec->gpe);
372 }
373 626
374 status = acpi_ec_transaction_unlocked(ec, t); 627 status = acpi_ec_transaction_unlocked(ec, t);
375 628
376 /* check if we received SCI during transaction */ 629 if (test_bit(EC_FLAGS_COMMAND_STORM, &ec->flags))
377 ec_check_sci_sync(ec, acpi_ec_read_status(ec));
378 if (test_bit(EC_FLAGS_GPE_STORM, &ec->flags)) {
379 msleep(1); 630 msleep(1);
380 /* It is safe to enable the GPE outside of the transaction. */
381 acpi_enable_gpe(NULL, ec->gpe);
382 } else if (t->irq_count > ec_storm_threshold) {
383 pr_info("GPE storm detected(%d GPEs), "
384 "transactions will use polling mode\n",
385 t->irq_count);
386 set_bit(EC_FLAGS_GPE_STORM, &ec->flags);
387 }
388 if (ec->global_lock) 631 if (ec->global_lock)
389 acpi_release_global_lock(glk); 632 acpi_release_global_lock(glk);
390unlock: 633unlock:
@@ -500,7 +743,7 @@ static void acpi_ec_clear(struct acpi_ec *ec)
500 u8 value = 0; 743 u8 value = 0;
501 744
502 for (i = 0; i < ACPI_EC_CLEAR_MAX; i++) { 745 for (i = 0; i < ACPI_EC_CLEAR_MAX; i++) {
503 status = acpi_ec_sync_query(ec, &value); 746 status = acpi_ec_query(ec, &value);
504 if (status || !value) 747 if (status || !value)
505 break; 748 break;
506 } 749 }
@@ -511,6 +754,57 @@ static void acpi_ec_clear(struct acpi_ec *ec)
511 pr_info("%d stale EC events cleared\n", i); 754 pr_info("%d stale EC events cleared\n", i);
512} 755}
513 756
757static void acpi_ec_start(struct acpi_ec *ec, bool resuming)
758{
759 unsigned long flags;
760
761 spin_lock_irqsave(&ec->lock, flags);
762 if (!test_and_set_bit(EC_FLAGS_STARTED, &ec->flags)) {
763 pr_debug("+++++ Starting EC +++++\n");
764 /* Enable GPE for event processing (SCI_EVT=1) */
765 if (!resuming) {
766 acpi_ec_submit_request(ec);
767 ec_debug_ref(ec, "Increase driver\n");
768 }
769 pr_info("+++++ EC started +++++\n");
770 }
771 spin_unlock_irqrestore(&ec->lock, flags);
772}
773
774static bool acpi_ec_stopped(struct acpi_ec *ec)
775{
776 unsigned long flags;
777 bool flushed;
778
779 spin_lock_irqsave(&ec->lock, flags);
780 flushed = acpi_ec_flushed(ec);
781 spin_unlock_irqrestore(&ec->lock, flags);
782 return flushed;
783}
784
785static void acpi_ec_stop(struct acpi_ec *ec, bool suspending)
786{
787 unsigned long flags;
788
789 spin_lock_irqsave(&ec->lock, flags);
790 if (acpi_ec_started(ec)) {
791 pr_debug("+++++ Stopping EC +++++\n");
792 set_bit(EC_FLAGS_STOPPED, &ec->flags);
793 spin_unlock_irqrestore(&ec->lock, flags);
794 wait_event(ec->wait, acpi_ec_stopped(ec));
795 spin_lock_irqsave(&ec->lock, flags);
796 /* Disable GPE for event processing (SCI_EVT=1) */
797 if (!suspending) {
798 acpi_ec_complete_request(ec);
799 ec_debug_ref(ec, "Decrease driver\n");
800 }
801 clear_bit(EC_FLAGS_STARTED, &ec->flags);
802 clear_bit(EC_FLAGS_STOPPED, &ec->flags);
803 pr_info("+++++ EC stopped +++++\n");
804 }
805 spin_unlock_irqrestore(&ec->lock, flags);
806}
807
514void acpi_ec_block_transactions(void) 808void acpi_ec_block_transactions(void)
515{ 809{
516 struct acpi_ec *ec = first_ec; 810 struct acpi_ec *ec = first_ec;
@@ -520,7 +814,7 @@ void acpi_ec_block_transactions(void)
520 814
521 mutex_lock(&ec->mutex); 815 mutex_lock(&ec->mutex);
522 /* Prevent transactions from being carried out */ 816 /* Prevent transactions from being carried out */
523 set_bit(EC_FLAGS_BLOCKED, &ec->flags); 817 acpi_ec_stop(ec, true);
524 mutex_unlock(&ec->mutex); 818 mutex_unlock(&ec->mutex);
525} 819}
526 820
@@ -531,14 +825,11 @@ void acpi_ec_unblock_transactions(void)
531 if (!ec) 825 if (!ec)
532 return; 826 return;
533 827
534 mutex_lock(&ec->mutex);
535 /* Allow transactions to be carried out again */ 828 /* Allow transactions to be carried out again */
536 clear_bit(EC_FLAGS_BLOCKED, &ec->flags); 829 acpi_ec_start(ec, true);
537 830
538 if (EC_FLAGS_CLEAR_ON_RESUME) 831 if (EC_FLAGS_CLEAR_ON_RESUME)
539 acpi_ec_clear(ec); 832 acpi_ec_clear(ec);
540
541 mutex_unlock(&ec->mutex);
542} 833}
543 834
544void acpi_ec_unblock_transactions_early(void) 835void acpi_ec_unblock_transactions_early(void)
@@ -548,36 +839,33 @@ void acpi_ec_unblock_transactions_early(void)
548 * atomic context during wakeup, so we don't need to acquire the mutex). 839 * atomic context during wakeup, so we don't need to acquire the mutex).
549 */ 840 */
550 if (first_ec) 841 if (first_ec)
551 clear_bit(EC_FLAGS_BLOCKED, &first_ec->flags); 842 acpi_ec_start(first_ec, true);
552} 843}
553 844
554static int acpi_ec_query_unlocked(struct acpi_ec *ec, u8 *data) 845/* --------------------------------------------------------------------------
846 Event Management
847 -------------------------------------------------------------------------- */
848static struct acpi_ec_query_handler *
849acpi_ec_get_query_handler(struct acpi_ec_query_handler *handler)
555{ 850{
556 int result; 851 if (handler)
557 u8 d; 852 kref_get(&handler->kref);
558 struct transaction t = {.command = ACPI_EC_COMMAND_QUERY, 853 return handler;
559 .wdata = NULL, .rdata = &d, 854}
560 .wlen = 0, .rlen = 1};
561 855
562 if (!ec || !data) 856static void acpi_ec_query_handler_release(struct kref *kref)
563 return -EINVAL; 857{
564 /* 858 struct acpi_ec_query_handler *handler =
565 * Query the EC to find out which _Qxx method we need to evaluate. 859 container_of(kref, struct acpi_ec_query_handler, kref);
566 * Note that successful completion of the query causes the ACPI_EC_SCI 860
567 * bit to be cleared (and thus clearing the interrupt source). 861 kfree(handler);
568 */ 862}
569 result = acpi_ec_transaction_unlocked(ec, &t); 863
570 if (result) 864static void acpi_ec_put_query_handler(struct acpi_ec_query_handler *handler)
571 return result; 865{
572 if (!d) 866 kref_put(&handler->kref, acpi_ec_query_handler_release);
573 return -ENODATA;
574 *data = d;
575 return 0;
576} 867}
577 868
578/* --------------------------------------------------------------------------
579 Event Management
580 -------------------------------------------------------------------------- */
581int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit, 869int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
582 acpi_handle handle, acpi_ec_query_func func, 870 acpi_handle handle, acpi_ec_query_func func,
583 void *data) 871 void *data)
@@ -593,6 +881,7 @@ int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
593 handler->func = func; 881 handler->func = func;
594 handler->data = data; 882 handler->data = data;
595 mutex_lock(&ec->mutex); 883 mutex_lock(&ec->mutex);
884 kref_init(&handler->kref);
596 list_add(&handler->node, &ec->list); 885 list_add(&handler->node, &ec->list);
597 mutex_unlock(&ec->mutex); 886 mutex_unlock(&ec->mutex);
598 return 0; 887 return 0;
@@ -602,15 +891,18 @@ EXPORT_SYMBOL_GPL(acpi_ec_add_query_handler);
602void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit) 891void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit)
603{ 892{
604 struct acpi_ec_query_handler *handler, *tmp; 893 struct acpi_ec_query_handler *handler, *tmp;
894 LIST_HEAD(free_list);
605 895
606 mutex_lock(&ec->mutex); 896 mutex_lock(&ec->mutex);
607 list_for_each_entry_safe(handler, tmp, &ec->list, node) { 897 list_for_each_entry_safe(handler, tmp, &ec->list, node) {
608 if (query_bit == handler->query_bit) { 898 if (query_bit == handler->query_bit) {
609 list_del(&handler->node); 899 list_del_init(&handler->node);
610 kfree(handler); 900 list_add(&handler->node, &free_list);
611 } 901 }
612 } 902 }
613 mutex_unlock(&ec->mutex); 903 mutex_unlock(&ec->mutex);
904 list_for_each_entry(handler, &free_list, node)
905 acpi_ec_put_query_handler(handler);
614} 906}
615EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler); 907EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler);
616 908
@@ -626,59 +918,58 @@ static void acpi_ec_run(void *cxt)
626 else if (handler->handle) 918 else if (handler->handle)
627 acpi_evaluate_object(handler->handle, NULL, NULL, NULL); 919 acpi_evaluate_object(handler->handle, NULL, NULL, NULL);
628 pr_debug("##### Query(0x%02x) stopped #####\n", handler->query_bit); 920 pr_debug("##### Query(0x%02x) stopped #####\n", handler->query_bit);
629 kfree(handler); 921 acpi_ec_put_query_handler(handler);
630} 922}
631 923
632static int acpi_ec_sync_query(struct acpi_ec *ec, u8 *data) 924static int acpi_ec_query(struct acpi_ec *ec, u8 *data)
633{ 925{
634 u8 value = 0; 926 u8 value = 0;
635 int status; 927 int result;
636 struct acpi_ec_query_handler *handler, *copy; 928 acpi_status status;
929 struct acpi_ec_query_handler *handler;
930 struct transaction t = {.command = ACPI_EC_COMMAND_QUERY,
931 .wdata = NULL, .rdata = &value,
932 .wlen = 0, .rlen = 1};
637 933
638 status = acpi_ec_query_unlocked(ec, &value); 934 /*
935 * Query the EC to find out which _Qxx method we need to evaluate.
936 * Note that successful completion of the query causes the ACPI_EC_SCI
937 * bit to be cleared (and thus clearing the interrupt source).
938 */
939 result = acpi_ec_transaction(ec, &t);
940 if (result)
941 return result;
639 if (data) 942 if (data)
640 *data = value; 943 *data = value;
641 if (status) 944 if (!value)
642 return status; 945 return -ENODATA;
643 946
947 mutex_lock(&ec->mutex);
644 list_for_each_entry(handler, &ec->list, node) { 948 list_for_each_entry(handler, &ec->list, node) {
645 if (value == handler->query_bit) { 949 if (value == handler->query_bit) {
646 /* have custom handler for this bit */ 950 /* have custom handler for this bit */
647 copy = kmalloc(sizeof(*handler), GFP_KERNEL); 951 handler = acpi_ec_get_query_handler(handler);
648 if (!copy)
649 return -ENOMEM;
650 memcpy(copy, handler, sizeof(*copy));
651 pr_debug("##### Query(0x%02x) scheduled #####\n", 952 pr_debug("##### Query(0x%02x) scheduled #####\n",
652 handler->query_bit); 953 handler->query_bit);
653 return acpi_os_execute((copy->func) ? 954 status = acpi_os_execute((handler->func) ?
654 OSL_NOTIFY_HANDLER : OSL_GPE_HANDLER, 955 OSL_NOTIFY_HANDLER : OSL_GPE_HANDLER,
655 acpi_ec_run, copy); 956 acpi_ec_run, handler);
957 if (ACPI_FAILURE(status))
958 result = -EBUSY;
959 break;
656 } 960 }
657 } 961 }
658 return 0;
659}
660
661static void acpi_ec_gpe_query(void *ec_cxt)
662{
663 struct acpi_ec *ec = ec_cxt;
664
665 if (!ec)
666 return;
667 mutex_lock(&ec->mutex);
668 acpi_ec_sync_query(ec, NULL);
669 mutex_unlock(&ec->mutex); 962 mutex_unlock(&ec->mutex);
963 return result;
670} 964}
671 965
672static int ec_check_sci(struct acpi_ec *ec, u8 state) 966static void acpi_ec_gpe_poller(struct work_struct *work)
673{ 967{
674 if (state & ACPI_EC_FLAG_SCI) { 968 struct acpi_ec *ec = container_of(work, struct acpi_ec, work);
675 if (!test_and_set_bit(EC_FLAGS_QUERY_PENDING, &ec->flags)) { 969
676 pr_debug("***** Event started *****\n"); 970 pr_debug("***** Event poller started *****\n");
677 return acpi_os_execute(OSL_NOTIFY_HANDLER, 971 acpi_ec_query(ec, NULL);
678 acpi_ec_gpe_query, ec); 972 pr_debug("***** Event poller stopped *****\n");
679 }
680 }
681 return 0;
682} 973}
683 974
684static u32 acpi_ec_gpe_handler(acpi_handle gpe_device, 975static u32 acpi_ec_gpe_handler(acpi_handle gpe_device,
@@ -688,11 +979,9 @@ static u32 acpi_ec_gpe_handler(acpi_handle gpe_device,
688 struct acpi_ec *ec = data; 979 struct acpi_ec *ec = data;
689 980
690 spin_lock_irqsave(&ec->lock, flags); 981 spin_lock_irqsave(&ec->lock, flags);
691 if (advance_transaction(ec)) 982 advance_transaction(ec);
692 wake_up(&ec->wait);
693 spin_unlock_irqrestore(&ec->lock, flags); 983 spin_unlock_irqrestore(&ec->lock, flags);
694 ec_check_sci(ec, acpi_ec_read_status(ec)); 984 return ACPI_INTERRUPT_HANDLED;
695 return ACPI_INTERRUPT_HANDLED | ACPI_REENABLE_GPE;
696} 985}
697 986
698/* -------------------------------------------------------------------------- 987/* --------------------------------------------------------------------------
@@ -750,11 +1039,11 @@ static struct acpi_ec *make_acpi_ec(void)
750 1039
751 if (!ec) 1040 if (!ec)
752 return NULL; 1041 return NULL;
753 ec->flags = 1 << EC_FLAGS_QUERY_PENDING;
754 mutex_init(&ec->mutex); 1042 mutex_init(&ec->mutex);
755 init_waitqueue_head(&ec->wait); 1043 init_waitqueue_head(&ec->wait);
756 INIT_LIST_HEAD(&ec->list); 1044 INIT_LIST_HEAD(&ec->list);
757 spin_lock_init(&ec->lock); 1045 spin_lock_init(&ec->lock);
1046 INIT_WORK(&ec->work, acpi_ec_gpe_poller);
758 return ec; 1047 return ec;
759} 1048}
760 1049
@@ -810,13 +1099,13 @@ static int ec_install_handlers(struct acpi_ec *ec)
810 1099
811 if (test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags)) 1100 if (test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags))
812 return 0; 1101 return 0;
813 status = acpi_install_gpe_handler(NULL, ec->gpe, 1102 status = acpi_install_gpe_raw_handler(NULL, ec->gpe,
814 ACPI_GPE_EDGE_TRIGGERED, 1103 ACPI_GPE_EDGE_TRIGGERED,
815 &acpi_ec_gpe_handler, ec); 1104 &acpi_ec_gpe_handler, ec);
816 if (ACPI_FAILURE(status)) 1105 if (ACPI_FAILURE(status))
817 return -ENODEV; 1106 return -ENODEV;
818 1107
819 acpi_enable_gpe(NULL, ec->gpe); 1108 acpi_ec_start(ec, false);
820 status = acpi_install_address_space_handler(ec->handle, 1109 status = acpi_install_address_space_handler(ec->handle,
821 ACPI_ADR_SPACE_EC, 1110 ACPI_ADR_SPACE_EC,
822 &acpi_ec_space_handler, 1111 &acpi_ec_space_handler,
@@ -831,7 +1120,7 @@ static int ec_install_handlers(struct acpi_ec *ec)
831 pr_err("Fail in evaluating the _REG object" 1120 pr_err("Fail in evaluating the _REG object"
832 " of EC device. Broken bios is suspected.\n"); 1121 " of EC device. Broken bios is suspected.\n");
833 } else { 1122 } else {
834 acpi_disable_gpe(NULL, ec->gpe); 1123 acpi_ec_stop(ec, false);
835 acpi_remove_gpe_handler(NULL, ec->gpe, 1124 acpi_remove_gpe_handler(NULL, ec->gpe,
836 &acpi_ec_gpe_handler); 1125 &acpi_ec_gpe_handler);
837 return -ENODEV; 1126 return -ENODEV;
@@ -846,7 +1135,7 @@ static void ec_remove_handlers(struct acpi_ec *ec)
846{ 1135{
847 if (!test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags)) 1136 if (!test_bit(EC_FLAGS_HANDLERS_INSTALLED, &ec->flags))
848 return; 1137 return;
849 acpi_disable_gpe(NULL, ec->gpe); 1138 acpi_ec_stop(ec, false);
850 if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle, 1139 if (ACPI_FAILURE(acpi_remove_address_space_handler(ec->handle,
851 ACPI_ADR_SPACE_EC, &acpi_ec_space_handler))) 1140 ACPI_ADR_SPACE_EC, &acpi_ec_space_handler)))
852 pr_err("failed to remove space handler\n"); 1141 pr_err("failed to remove space handler\n");
@@ -900,14 +1189,11 @@ static int acpi_ec_add(struct acpi_device *device)
900 ret = ec_install_handlers(ec); 1189 ret = ec_install_handlers(ec);
901 1190
902 /* EC is fully operational, allow queries */ 1191 /* EC is fully operational, allow queries */
903 clear_bit(EC_FLAGS_QUERY_PENDING, &ec->flags); 1192 acpi_ec_enable_event(ec);
904 1193
905 /* Clear stale _Q events if hardware might require that */ 1194 /* Clear stale _Q events if hardware might require that */
906 if (EC_FLAGS_CLEAR_ON_RESUME) { 1195 if (EC_FLAGS_CLEAR_ON_RESUME)
907 mutex_lock(&ec->mutex);
908 acpi_ec_clear(ec); 1196 acpi_ec_clear(ec);
909 mutex_unlock(&ec->mutex);
910 }
911 return ret; 1197 return ret;
912} 1198}
913 1199
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
index caca2805536d..56b321aa2b1c 100644
--- a/drivers/acpi/internal.h
+++ b/drivers/acpi/internal.h
@@ -75,6 +75,8 @@ static inline void acpi_debugfs_init(void) { return; }
75#endif 75#endif
76void acpi_lpss_init(void); 76void acpi_lpss_init(void);
77 77
78void acpi_apd_init(void);
79
78acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src); 80acpi_status acpi_hotplug_schedule(struct acpi_device *adev, u32 src);
79bool acpi_queue_hotplug_work(struct work_struct *work); 81bool acpi_queue_hotplug_work(struct work_struct *work);
80void acpi_device_hotplug(struct acpi_device *adev, u32 src); 82void acpi_device_hotplug(struct acpi_device *adev, u32 src);
@@ -129,11 +131,13 @@ struct acpi_ec {
129 unsigned long data_addr; 131 unsigned long data_addr;
130 unsigned long global_lock; 132 unsigned long global_lock;
131 unsigned long flags; 133 unsigned long flags;
134 unsigned long reference_count;
132 struct mutex mutex; 135 struct mutex mutex;
133 wait_queue_head_t wait; 136 wait_queue_head_t wait;
134 struct list_head list; 137 struct list_head list;
135 struct transaction *curr; 138 struct transaction *curr;
136 spinlock_t lock; 139 spinlock_t lock;
140 struct work_struct work;
137}; 141};
138 142
139extern struct acpi_ec *first_ec; 143extern struct acpi_ec *first_ec;
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c
index 24b5476449a1..1333cbdc3ea2 100644
--- a/drivers/acpi/numa.c
+++ b/drivers/acpi/numa.c
@@ -177,12 +177,7 @@ static int __init slit_valid(struct acpi_table_slit *slit)
177 177
178static int __init acpi_parse_slit(struct acpi_table_header *table) 178static int __init acpi_parse_slit(struct acpi_table_header *table)
179{ 179{
180 struct acpi_table_slit *slit; 180 struct acpi_table_slit *slit = (struct acpi_table_slit *)table;
181
182 if (!table)
183 return -EINVAL;
184
185 slit = (struct acpi_table_slit *)table;
186 181
187 if (!slit_valid(slit)) { 182 if (!slit_valid(slit)) {
188 printk(KERN_INFO "ACPI: SLIT table looks invalid. Not used.\n"); 183 printk(KERN_INFO "ACPI: SLIT table looks invalid. Not used.\n");
@@ -260,11 +255,8 @@ acpi_parse_memory_affinity(struct acpi_subtable_header * header,
260 255
261static int __init acpi_parse_srat(struct acpi_table_header *table) 256static int __init acpi_parse_srat(struct acpi_table_header *table)
262{ 257{
263 struct acpi_table_srat *srat; 258 struct acpi_table_srat *srat = (struct acpi_table_srat *)table;
264 if (!table)
265 return -EINVAL;
266 259
267 srat = (struct acpi_table_srat *)table;
268 acpi_srat_revision = srat->header.revision; 260 acpi_srat_revision = srat->header.revision;
269 261
270 /* Real work done in acpi_table_parse_srat below. */ 262 /* Real work done in acpi_table_parse_srat below. */
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 87b704e41877..c256bd7fbd78 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -681,15 +681,13 @@ static int acpi_idle_bm_check(void)
681} 681}
682 682
683/** 683/**
684 * acpi_idle_do_entry - a helper function that does C2 and C3 type entry 684 * acpi_idle_do_entry - enter idle state using the appropriate method
685 * @cx: cstate data 685 * @cx: cstate data
686 * 686 *
687 * Caller disables interrupt before call and enables interrupt after return. 687 * Caller disables interrupt before call and enables interrupt after return.
688 */ 688 */
689static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx) 689static void acpi_idle_do_entry(struct acpi_processor_cx *cx)
690{ 690{
691 /* Don't trace irqs off for idle */
692 stop_critical_timings();
693 if (cx->entry_method == ACPI_CSTATE_FFH) { 691 if (cx->entry_method == ACPI_CSTATE_FFH) {
694 /* Call into architectural FFH based C-state */ 692 /* Call into architectural FFH based C-state */
695 acpi_processor_ffh_cstate_enter(cx); 693 acpi_processor_ffh_cstate_enter(cx);
@@ -703,38 +701,9 @@ static inline void acpi_idle_do_entry(struct acpi_processor_cx *cx)
703 gets asserted in time to freeze execution properly. */ 701 gets asserted in time to freeze execution properly. */
704 inl(acpi_gbl_FADT.xpm_timer_block.address); 702 inl(acpi_gbl_FADT.xpm_timer_block.address);
705 } 703 }
706 start_critical_timings();
707} 704}
708 705
709/** 706/**
710 * acpi_idle_enter_c1 - enters an ACPI C1 state-type
711 * @dev: the target CPU
712 * @drv: cpuidle driver containing cpuidle state info
713 * @index: index of target state
714 *
715 * This is equivalent to the HALT instruction.
716 */
717static int acpi_idle_enter_c1(struct cpuidle_device *dev,
718 struct cpuidle_driver *drv, int index)
719{
720 struct acpi_processor *pr;
721 struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
722
723 pr = __this_cpu_read(processors);
724
725 if (unlikely(!pr))
726 return -EINVAL;
727
728 lapic_timer_state_broadcast(pr, cx, 1);
729 acpi_idle_do_entry(cx);
730
731 lapic_timer_state_broadcast(pr, cx, 0);
732
733 return index;
734}
735
736
737/**
738 * acpi_idle_play_dead - enters an ACPI state for long-term idle (i.e. off-lining) 707 * acpi_idle_play_dead - enters an ACPI state for long-term idle (i.e. off-lining)
739 * @dev: the target CPU 708 * @dev: the target CPU
740 * @index: the index of suggested state 709 * @index: the index of suggested state
@@ -761,47 +730,11 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index)
761 return 0; 730 return 0;
762} 731}
763 732
764/** 733static bool acpi_idle_fallback_to_c1(struct acpi_processor *pr)
765 * acpi_idle_enter_simple - enters an ACPI state without BM handling
766 * @dev: the target CPU
767 * @drv: cpuidle driver with cpuidle state information
768 * @index: the index of suggested state
769 */
770static int acpi_idle_enter_simple(struct cpuidle_device *dev,
771 struct cpuidle_driver *drv, int index)
772{ 734{
773 struct acpi_processor *pr; 735 return IS_ENABLED(CONFIG_HOTPLUG_CPU) && num_online_cpus() > 1 &&
774 struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu); 736 !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED) &&
775 737 !pr->flags.has_cst;
776 pr = __this_cpu_read(processors);
777
778 if (unlikely(!pr))
779 return -EINVAL;
780
781#ifdef CONFIG_HOTPLUG_CPU
782 if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
783 !pr->flags.has_cst &&
784 !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
785 return acpi_idle_enter_c1(dev, drv, CPUIDLE_DRIVER_STATE_START);
786#endif
787
788 /*
789 * Must be done before busmaster disable as we might need to
790 * access HPET !
791 */
792 lapic_timer_state_broadcast(pr, cx, 1);
793
794 if (cx->type == ACPI_STATE_C3)
795 ACPI_FLUSH_CPU_CACHE();
796
797 /* Tell the scheduler that we are going deep-idle: */
798 sched_clock_idle_sleep_event();
799 acpi_idle_do_entry(cx);
800
801 sched_clock_idle_wakeup_event(0);
802
803 lapic_timer_state_broadcast(pr, cx, 0);
804 return index;
805} 738}
806 739
807static int c3_cpu_count; 740static int c3_cpu_count;
@@ -809,44 +742,14 @@ static DEFINE_RAW_SPINLOCK(c3_lock);
809 742
810/** 743/**
811 * acpi_idle_enter_bm - enters C3 with proper BM handling 744 * acpi_idle_enter_bm - enters C3 with proper BM handling
812 * @dev: the target CPU 745 * @pr: Target processor
813 * @drv: cpuidle driver containing state data 746 * @cx: Target state context
814 * @index: the index of suggested state
815 *
816 * If BM is detected, the deepest non-C3 idle state is entered instead.
817 */ 747 */
818static int acpi_idle_enter_bm(struct cpuidle_device *dev, 748static void acpi_idle_enter_bm(struct acpi_processor *pr,
819 struct cpuidle_driver *drv, int index) 749 struct acpi_processor_cx *cx)
820{ 750{
821 struct acpi_processor *pr;
822 struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
823
824 pr = __this_cpu_read(processors);
825
826 if (unlikely(!pr))
827 return -EINVAL;
828
829#ifdef CONFIG_HOTPLUG_CPU
830 if ((cx->type != ACPI_STATE_C1) && (num_online_cpus() > 1) &&
831 !pr->flags.has_cst &&
832 !(acpi_gbl_FADT.flags & ACPI_FADT_C2_MP_SUPPORTED))
833 return acpi_idle_enter_c1(dev, drv, CPUIDLE_DRIVER_STATE_START);
834#endif
835
836 if (!cx->bm_sts_skip && acpi_idle_bm_check()) {
837 if (drv->safe_state_index >= 0) {
838 return drv->states[drv->safe_state_index].enter(dev,
839 drv, drv->safe_state_index);
840 } else {
841 acpi_safe_halt();
842 return -EBUSY;
843 }
844 }
845
846 acpi_unlazy_tlb(smp_processor_id()); 751 acpi_unlazy_tlb(smp_processor_id());
847 752
848 /* Tell the scheduler that we are going deep-idle: */
849 sched_clock_idle_sleep_event();
850 /* 753 /*
851 * Must be done before busmaster disable as we might need to 754 * Must be done before busmaster disable as we might need to
852 * access HPET ! 755 * access HPET !
@@ -856,37 +759,71 @@ static int acpi_idle_enter_bm(struct cpuidle_device *dev,
856 /* 759 /*
857 * disable bus master 760 * disable bus master
858 * bm_check implies we need ARB_DIS 761 * bm_check implies we need ARB_DIS
859 * !bm_check implies we need cache flush
860 * bm_control implies whether we can do ARB_DIS 762 * bm_control implies whether we can do ARB_DIS
861 * 763 *
862 * That leaves a case where bm_check is set and bm_control is 764 * That leaves a case where bm_check is set and bm_control is
863 * not set. In that case we cannot do much, we enter C3 765 * not set. In that case we cannot do much, we enter C3
864 * without doing anything. 766 * without doing anything.
865 */ 767 */
866 if (pr->flags.bm_check && pr->flags.bm_control) { 768 if (pr->flags.bm_control) {
867 raw_spin_lock(&c3_lock); 769 raw_spin_lock(&c3_lock);
868 c3_cpu_count++; 770 c3_cpu_count++;
869 /* Disable bus master arbitration when all CPUs are in C3 */ 771 /* Disable bus master arbitration when all CPUs are in C3 */
870 if (c3_cpu_count == num_online_cpus()) 772 if (c3_cpu_count == num_online_cpus())
871 acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 1); 773 acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 1);
872 raw_spin_unlock(&c3_lock); 774 raw_spin_unlock(&c3_lock);
873 } else if (!pr->flags.bm_check) {
874 ACPI_FLUSH_CPU_CACHE();
875 } 775 }
876 776
877 acpi_idle_do_entry(cx); 777 acpi_idle_do_entry(cx);
878 778
879 /* Re-enable bus master arbitration */ 779 /* Re-enable bus master arbitration */
880 if (pr->flags.bm_check && pr->flags.bm_control) { 780 if (pr->flags.bm_control) {
881 raw_spin_lock(&c3_lock); 781 raw_spin_lock(&c3_lock);
882 acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 0); 782 acpi_write_bit_register(ACPI_BITREG_ARB_DISABLE, 0);
883 c3_cpu_count--; 783 c3_cpu_count--;
884 raw_spin_unlock(&c3_lock); 784 raw_spin_unlock(&c3_lock);
885 } 785 }
886 786
887 sched_clock_idle_wakeup_event(0); 787 lapic_timer_state_broadcast(pr, cx, 0);
788}
789
790static int acpi_idle_enter(struct cpuidle_device *dev,
791 struct cpuidle_driver *drv, int index)
792{
793 struct acpi_processor_cx *cx = per_cpu(acpi_cstate[index], dev->cpu);
794 struct acpi_processor *pr;
795
796 pr = __this_cpu_read(processors);
797 if (unlikely(!pr))
798 return -EINVAL;
799
800 if (cx->type != ACPI_STATE_C1) {
801 if (acpi_idle_fallback_to_c1(pr)) {
802 index = CPUIDLE_DRIVER_STATE_START;
803 cx = per_cpu(acpi_cstate[index], dev->cpu);
804 } else if (cx->type == ACPI_STATE_C3 && pr->flags.bm_check) {
805 if (cx->bm_sts_skip || !acpi_idle_bm_check()) {
806 acpi_idle_enter_bm(pr, cx);
807 return index;
808 } else if (drv->safe_state_index >= 0) {
809 index = drv->safe_state_index;
810 cx = per_cpu(acpi_cstate[index], dev->cpu);
811 } else {
812 acpi_safe_halt();
813 return -EBUSY;
814 }
815 }
816 }
817
818 lapic_timer_state_broadcast(pr, cx, 1);
819
820 if (cx->type == ACPI_STATE_C3)
821 ACPI_FLUSH_CPU_CACHE();
822
823 acpi_idle_do_entry(cx);
888 824
889 lapic_timer_state_broadcast(pr, cx, 0); 825 lapic_timer_state_broadcast(pr, cx, 0);
826
890 return index; 827 return index;
891} 828}
892 829
@@ -981,27 +918,12 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
981 strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN); 918 strncpy(state->desc, cx->desc, CPUIDLE_DESC_LEN);
982 state->exit_latency = cx->latency; 919 state->exit_latency = cx->latency;
983 state->target_residency = cx->latency * latency_factor; 920 state->target_residency = cx->latency * latency_factor;
921 state->enter = acpi_idle_enter;
984 922
985 state->flags = 0; 923 state->flags = 0;
986 switch (cx->type) { 924 if (cx->type == ACPI_STATE_C1 || cx->type == ACPI_STATE_C2) {
987 case ACPI_STATE_C1:
988
989 state->enter = acpi_idle_enter_c1;
990 state->enter_dead = acpi_idle_play_dead;
991 drv->safe_state_index = count;
992 break;
993
994 case ACPI_STATE_C2:
995 state->enter = acpi_idle_enter_simple;
996 state->enter_dead = acpi_idle_play_dead; 925 state->enter_dead = acpi_idle_play_dead;
997 drv->safe_state_index = count; 926 drv->safe_state_index = count;
998 break;
999
1000 case ACPI_STATE_C3:
1001 state->enter = pr->flags.bm_check ?
1002 acpi_idle_enter_bm :
1003 acpi_idle_enter_simple;
1004 break;
1005 } 927 }
1006 928
1007 count++; 929 count++;
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index dc4d8960684a..bbca7830e18a 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -2544,6 +2544,7 @@ int __init acpi_scan_init(void)
2544 acpi_pci_link_init(); 2544 acpi_pci_link_init();
2545 acpi_processor_init(); 2545 acpi_processor_init();
2546 acpi_lpss_init(); 2546 acpi_lpss_init();
2547 acpi_apd_init();
2547 acpi_cmos_rtc_init(); 2548 acpi_cmos_rtc_init();
2548 acpi_container_init(); 2549 acpi_container_init();
2549 acpi_memory_hotplug_init(); 2550 acpi_memory_hotplug_init();
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 8aa9254a387f..7f251dd1a687 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -321,7 +321,7 @@ static struct dmi_system_id acpisleep_dmi_table[] __initdata = {
321 {}, 321 {},
322}; 322};
323 323
324static void acpi_sleep_dmi_check(void) 324static void __init acpi_sleep_dmi_check(void)
325{ 325{
326 int year; 326 int year;
327 327
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 032db459370f..88a4f99dd2a7 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -522,6 +522,24 @@ static struct dmi_system_id video_dmi_table[] __initdata = {
522 DMI_MATCH(DMI_PRODUCT_NAME, "370R4E/370R4V/370R5E/3570RE/370R5V"), 522 DMI_MATCH(DMI_PRODUCT_NAME, "370R4E/370R4V/370R5E/3570RE/370R5V"),
523 }, 523 },
524 }, 524 },
525 {
526 /* https://bugzilla.redhat.com/show_bug.cgi?id=1186097 */
527 .callback = video_disable_native_backlight,
528 .ident = "SAMSUNG 3570R/370R/470R/450R/510R/4450RV",
529 .matches = {
530 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
531 DMI_MATCH(DMI_PRODUCT_NAME, "3570R/370R/470R/450R/510R/4450RV"),
532 },
533 },
534 {
535 /* https://bugzilla.redhat.com/show_bug.cgi?id=1094948 */
536 .callback = video_disable_native_backlight,
537 .ident = "SAMSUNG 730U3E/740U3E",
538 .matches = {
539 DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."),
540 DMI_MATCH(DMI_PRODUCT_NAME, "730U3E/740U3E"),
541 },
542 },
525 543
526 { 544 {
527 /* https://bugzilla.redhat.com/show_bug.cgi?id=1163574 */ 545 /* https://bugzilla.redhat.com/show_bug.cgi?id=1163574 */