Skip to content

Commit 303a407

Browse files
committed
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: ACPI: invoke DSDT corruption workaround on all Toshiba Satellite ACPI, APEI, Fix ERST MOVE_DATA instruction implementation ACPI: fan: Fix more unbalanced code block ACPI: acpi_pad: simplify code to avoid false gcc build warning ACPI, APEI, Fix error path for memory allocation ACPI, APEI, HEST Fix the unsuitable usage of platform_data ACPI, APEI, Fix acpi_pre_map() return value ACPI, APEI, Fix APEI related table size checking ACPI: Disable Windows Vista compatibility for Toshiba P305D ACPI: Kconfig: fix typo. ACPI: add missing __percpu markup in arch/x86/kernel/acpi/cstate.c ACPI: Fix typos ACPI video: fix a poor warning message ACPI: fix build warnings resulting from merge window conflict ACPI: EC: add Vista incompatibility DMI entry for Toshiba Satellite L355 ACPI: expand Vista blacklist to include SP1 and SP2 ACPI: delete ZEPTO idle=nomwait DMI quirk ACPI: enable repeated PCIEXP wakeup by clearing PCIEXP_WAKE_STS on resume PM / ACPI: Blacklist systems known to require acpi_sleep=nonvs ACPI: Don't report current_now if battery reports in mWh
2 parents 35ec421 + fdb8c58 commit 303a407

File tree

24 files changed

+153
-76
lines changed

24 files changed

+153
-76
lines changed

arch/x86/kernel/acpi/cstate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct cstate_entry {
6161
unsigned int ecx;
6262
} states[ACPI_PROCESSOR_MAX_POWER];
6363
};
64-
static struct cstate_entry *cpu_cstate_entry; /* per CPU ptr */
64+
static struct cstate_entry __percpu *cpu_cstate_entry; /* per CPU ptr */
6565

6666
static short mwait_supported[ACPI_PROCESSOR_MAX_POWER];
6767

drivers/acpi/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ config ACPI_EC_DEBUGFS
105105

106106
Be aware that using this interface can confuse your Embedded
107107
Controller in a way that a normal reboot is not enough. You then
108-
have to power of your system, and remove the laptop battery for
108+
have to power off your system, and remove the laptop battery for
109109
some seconds.
110110
An Embedded Controller typically is available on laptops and reads
111111
sensor values like battery state and temperature.

drivers/acpi/acpi_pad.c

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -382,31 +382,32 @@ static void acpi_pad_remove_sysfs(struct acpi_device *device)
382382
device_remove_file(&device->dev, &dev_attr_rrtime);
383383
}
384384

385-
/* Query firmware how many CPUs should be idle */
386-
static int acpi_pad_pur(acpi_handle handle, int *num_cpus)
385+
/*
386+
* Query firmware how many CPUs should be idle
387+
* return -1 on failure
388+
*/
389+
static int acpi_pad_pur(acpi_handle handle)
387390
{
388391
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
389392
union acpi_object *package;
390-
int rev, num, ret = -EINVAL;
393+
int num = -1;
391394

392395
if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
393-
return -EINVAL;
396+
return num;
394397

395398
if (!buffer.length || !buffer.pointer)
396-
return -EINVAL;
399+
return num;
397400

398401
package = buffer.pointer;
399-
if (package->type != ACPI_TYPE_PACKAGE || package->package.count != 2)
400-
goto out;
401-
rev = package->package.elements[0].integer.value;
402-
num = package->package.elements[1].integer.value;
403-
if (rev != 1 || num < 0)
404-
goto out;
405-
*num_cpus = num;
406-
ret = 0;
407-
out:
402+
403+
if (package->type == ACPI_TYPE_PACKAGE &&
404+
package->package.count == 2 &&
405+
package->package.elements[0].integer.value == 1) /* rev 1 */
406+
407+
num = package->package.elements[1].integer.value;
408+
408409
kfree(buffer.pointer);
409-
return ret;
410+
return num;
410411
}
411412

412413
/* Notify firmware how many CPUs are idle */
@@ -433,7 +434,8 @@ static void acpi_pad_handle_notify(acpi_handle handle)
433434
uint32_t idle_cpus;
434435

435436
mutex_lock(&isolated_cpus_lock);
436-
if (acpi_pad_pur(handle, &num_cpus)) {
437+
num_cpus = acpi_pad_pur(handle);
438+
if (num_cpus < 0) {
437439
mutex_unlock(&isolated_cpus_lock);
438440
return;
439441
}

drivers/acpi/acpica/aclocal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ struct acpi_bit_register_info {
854854
ACPI_BITMASK_POWER_BUTTON_STATUS | \
855855
ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
856856
ACPI_BITMASK_RT_CLOCK_STATUS | \
857+
ACPI_BITMASK_PCIEXP_WAKE_DISABLE | \
857858
ACPI_BITMASK_WAKE_STATUS)
858859

859860
#define ACPI_BITMASK_TIMER_ENABLE 0x0001

drivers/acpi/acpica/exutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void acpi_ex_enter_interpreter(void)
109109
*
110110
* DESCRIPTION: Reacquire the interpreter execution region from within the
111111
* interpreter code. Failure to enter the interpreter region is a
112-
* fatal system error. Used in conjuction with
112+
* fatal system error. Used in conjunction with
113113
* relinquish_interpreter
114114
*
115115
******************************************************************************/

drivers/acpi/acpica/rsutils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type)
149149

150150
/*
151151
* 16-, 32-, and 64-bit cases must use the move macros that perform
152-
* endian conversion and/or accomodate hardware that cannot perform
152+
* endian conversion and/or accommodate hardware that cannot perform
153153
* misaligned memory transfers
154154
*/
155155
case ACPI_RSC_MOVE16:

drivers/acpi/apei/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ config ACPI_APEI_ERST_DEBUG
3434
depends on ACPI_APEI
3535
help
3636
ERST is a way provided by APEI to save and retrieve hardware
37-
error infomation to and from a persistent store. Enable this
37+
error information to and from a persistent store. Enable this
3838
if you want to debugging and testing the ERST kernel support
3939
and firmware implementation.

drivers/acpi/apei/apei-base.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,15 @@ EXPORT_SYMBOL_GPL(apei_resources_sub);
445445
int apei_resources_request(struct apei_resources *resources,
446446
const char *desc)
447447
{
448-
struct apei_res *res, *res_bak;
448+
struct apei_res *res, *res_bak = NULL;
449449
struct resource *r;
450+
int rc;
450451

451-
apei_resources_sub(resources, &apei_resources_all);
452+
rc = apei_resources_sub(resources, &apei_resources_all);
453+
if (rc)
454+
return rc;
452455

456+
rc = -EINVAL;
453457
list_for_each_entry(res, &resources->iomem, list) {
454458
r = request_mem_region(res->start, res->end - res->start,
455459
desc);
@@ -475,7 +479,11 @@ int apei_resources_request(struct apei_resources *resources,
475479
}
476480
}
477481

478-
apei_resources_merge(&apei_resources_all, resources);
482+
rc = apei_resources_merge(&apei_resources_all, resources);
483+
if (rc) {
484+
pr_err(APEI_PFX "Fail to merge resources!\n");
485+
goto err_unmap_ioport;
486+
}
479487

480488
return 0;
481489
err_unmap_ioport:
@@ -491,20 +499,23 @@ int apei_resources_request(struct apei_resources *resources,
491499
break;
492500
release_mem_region(res->start, res->end - res->start);
493501
}
494-
return -EINVAL;
502+
return rc;
495503
}
496504
EXPORT_SYMBOL_GPL(apei_resources_request);
497505

498506
void apei_resources_release(struct apei_resources *resources)
499507
{
508+
int rc;
500509
struct apei_res *res;
501510

502511
list_for_each_entry(res, &resources->iomem, list)
503512
release_mem_region(res->start, res->end - res->start);
504513
list_for_each_entry(res, &resources->ioport, list)
505514
release_region(res->start, res->end - res->start);
506515

507-
apei_resources_sub(&apei_resources_all, resources);
516+
rc = apei_resources_sub(&apei_resources_all, resources);
517+
if (rc)
518+
pr_err(APEI_PFX "Fail to sub resources!\n");
508519
}
509520
EXPORT_SYMBOL_GPL(apei_resources_release);
510521

drivers/acpi/apei/einj.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,9 @@ DEFINE_SIMPLE_ATTRIBUTE(error_inject_fops, NULL,
426426

427427
static int einj_check_table(struct acpi_table_einj *einj_tab)
428428
{
429-
if (einj_tab->header_length != sizeof(struct acpi_table_einj))
429+
if ((einj_tab->header_length !=
430+
(sizeof(struct acpi_table_einj) - sizeof(einj_tab->header)))
431+
&& (einj_tab->header_length != sizeof(struct acpi_table_einj)))
430432
return -EINVAL;
431433
if (einj_tab->header.length < sizeof(struct acpi_table_einj))
432434
return -EINVAL;

drivers/acpi/apei/erst-dbg.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* APEI Error Record Serialization Table debug support
33
*
44
* ERST is a way provided by APEI to save and retrieve hardware error
5-
* infomation to and from a persistent store. This file provide the
5+
* information to and from a persistent store. This file provide the
66
* debugging/testing support for ERST kernel support and firmware
77
* implementation.
88
*
@@ -111,11 +111,13 @@ static ssize_t erst_dbg_read(struct file *filp, char __user *ubuf,
111111
goto out;
112112
}
113113
if (len > erst_dbg_buf_len) {
114-
kfree(erst_dbg_buf);
114+
void *p;
115115
rc = -ENOMEM;
116-
erst_dbg_buf = kmalloc(len, GFP_KERNEL);
117-
if (!erst_dbg_buf)
116+
p = kmalloc(len, GFP_KERNEL);
117+
if (!p)
118118
goto out;
119+
kfree(erst_dbg_buf);
120+
erst_dbg_buf = p;
119121
erst_dbg_buf_len = len;
120122
goto retry;
121123
}
@@ -150,11 +152,13 @@ static ssize_t erst_dbg_write(struct file *filp, const char __user *ubuf,
150152
if (mutex_lock_interruptible(&erst_dbg_mutex))
151153
return -EINTR;
152154
if (usize > erst_dbg_buf_len) {
153-
kfree(erst_dbg_buf);
155+
void *p;
154156
rc = -ENOMEM;
155-
erst_dbg_buf = kmalloc(usize, GFP_KERNEL);
156-
if (!erst_dbg_buf)
157+
p = kmalloc(usize, GFP_KERNEL);
158+
if (!p)
157159
goto out;
160+
kfree(erst_dbg_buf);
161+
erst_dbg_buf = p;
158162
erst_dbg_buf_len = usize;
159163
}
160164
rc = copy_from_user(erst_dbg_buf, ubuf, usize);

drivers/acpi/apei/erst.c

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* APEI Error Record Serialization Table support
33
*
44
* ERST is a way provided by APEI to save and retrieve hardware error
5-
* infomation to and from a persistent store.
5+
* information to and from a persistent store.
66
*
77
* For more information about ERST, please refer to ACPI Specification
88
* version 4.0, section 17.4.
@@ -266,13 +266,30 @@ static int erst_exec_move_data(struct apei_exec_context *ctx,
266266
{
267267
int rc;
268268
u64 offset;
269+
void *src, *dst;
270+
271+
/* ioremap does not work in interrupt context */
272+
if (in_interrupt()) {
273+
pr_warning(ERST_PFX
274+
"MOVE_DATA can not be used in interrupt context");
275+
return -EBUSY;
276+
}
269277

270278
rc = __apei_exec_read_register(entry, &offset);
271279
if (rc)
272280
return rc;
273-
memmove((void *)ctx->dst_base + offset,
274-
(void *)ctx->src_base + offset,
275-
ctx->var2);
281+
282+
src = ioremap(ctx->src_base + offset, ctx->var2);
283+
if (!src)
284+
return -ENOMEM;
285+
dst = ioremap(ctx->dst_base + offset, ctx->var2);
286+
if (!dst)
287+
return -ENOMEM;
288+
289+
memmove(dst, src, ctx->var2);
290+
291+
iounmap(src);
292+
iounmap(dst);
276293

277294
return 0;
278295
}
@@ -750,7 +767,9 @@ __setup("erst_disable", setup_erst_disable);
750767

751768
static int erst_check_table(struct acpi_table_erst *erst_tab)
752769
{
753-
if (erst_tab->header_length != sizeof(struct acpi_table_erst))
770+
if ((erst_tab->header_length !=
771+
(sizeof(struct acpi_table_erst) - sizeof(erst_tab->header)))
772+
&& (erst_tab->header_length != sizeof(struct acpi_table_einj)))
754773
return -EINVAL;
755774
if (erst_tab->header.length < sizeof(struct acpi_table_erst))
756775
return -EINVAL;

drivers/acpi/apei/ghes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ static int __devinit ghes_probe(struct platform_device *ghes_dev)
302302
struct ghes *ghes = NULL;
303303
int rc = -EINVAL;
304304

305-
generic = ghes_dev->dev.platform_data;
305+
generic = *(struct acpi_hest_generic **)ghes_dev->dev.platform_data;
306306
if (!generic->enabled)
307307
return -ENODEV;
308308

drivers/acpi/apei/hest.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,20 +137,23 @@ static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)
137137

138138
static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
139139
{
140-
struct acpi_hest_generic *generic;
141140
struct platform_device *ghes_dev;
142141
struct ghes_arr *ghes_arr = data;
143142
int rc;
144143

145144
if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR)
146145
return 0;
147-
generic = (struct acpi_hest_generic *)hest_hdr;
148-
if (!generic->enabled)
146+
147+
if (!((struct acpi_hest_generic *)hest_hdr)->enabled)
149148
return 0;
150149
ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id);
151150
if (!ghes_dev)
152151
return -ENOMEM;
153-
ghes_dev->dev.platform_data = generic;
152+
153+
rc = platform_device_add_data(ghes_dev, &hest_hdr, sizeof(void *));
154+
if (rc)
155+
goto err;
156+
154157
rc = platform_device_add(ghes_dev);
155158
if (rc)
156159
goto err;

drivers/acpi/atomicio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ static void __iomem *acpi_pre_map(phys_addr_t paddr,
142142
list_add_tail_rcu(&map->list, &acpi_iomaps);
143143
spin_unlock_irqrestore(&acpi_iomaps_lock, flags);
144144

145-
return vaddr + (paddr - pg_off);
145+
return map->vaddr + (paddr - map->paddr);
146146
err_unmap:
147147
iounmap(vaddr);
148148
return NULL;

drivers/acpi/battery.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ static enum power_supply_property energy_battery_props[] = {
273273
POWER_SUPPLY_PROP_CYCLE_COUNT,
274274
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
275275
POWER_SUPPLY_PROP_VOLTAGE_NOW,
276-
POWER_SUPPLY_PROP_CURRENT_NOW,
277276
POWER_SUPPLY_PROP_POWER_NOW,
278277
POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
279278
POWER_SUPPLY_PROP_ENERGY_FULL,

drivers/acpi/blacklist.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ static int __init dmi_disable_osi_vista(const struct dmi_system_id *d)
183183
{
184184
printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
185185
acpi_osi_setup("!Windows 2006");
186+
acpi_osi_setup("!Windows 2006 SP1");
187+
acpi_osi_setup("!Windows 2006 SP2");
186188
return 0;
187189
}
188190
static int __init dmi_disable_osi_win7(const struct dmi_system_id *d)
@@ -226,13 +228,29 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
226228
},
227229
},
228230
{
231+
.callback = dmi_disable_osi_vista,
232+
.ident = "Toshiba Satellite L355",
233+
.matches = {
234+
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
235+
DMI_MATCH(DMI_PRODUCT_VERSION, "Satellite L355"),
236+
},
237+
},
238+
{
229239
.callback = dmi_disable_osi_win7,
230240
.ident = "ASUS K50IJ",
231241
.matches = {
232242
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
233243
DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"),
234244
},
235245
},
246+
{
247+
.callback = dmi_disable_osi_vista,
248+
.ident = "Toshiba P305D",
249+
.matches = {
250+
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
251+
DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P305D"),
252+
},
253+
},
236254

237255
/*
238256
* BIOS invocation of _OSI(Linux) is almost always a BIOS bug.

0 commit comments

Comments
 (0)