Skip to content

Commit

Permalink
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/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
  • Loading branch information
Linus Torvalds committed Oct 1, 2010
2 parents 35ec421 + fdb8c58 commit 303a407
Show file tree
Hide file tree
Showing 24 changed files with 153 additions and 76 deletions.
2 changes: 1 addition & 1 deletion arch/x86/kernel/acpi/cstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct cstate_entry {
unsigned int ecx;
} states[ACPI_PROCESSOR_MAX_POWER];
};
static struct cstate_entry *cpu_cstate_entry; /* per CPU ptr */
static struct cstate_entry __percpu *cpu_cstate_entry; /* per CPU ptr */

static short mwait_supported[ACPI_PROCESSOR_MAX_POWER];

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ config ACPI_EC_DEBUGFS

Be aware that using this interface can confuse your Embedded
Controller in a way that a normal reboot is not enough. You then
have to power of your system, and remove the laptop battery for
have to power off your system, and remove the laptop battery for
some seconds.
An Embedded Controller typically is available on laptops and reads
sensor values like battery state and temperature.
Expand Down
34 changes: 18 additions & 16 deletions drivers/acpi/acpi_pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,31 +382,32 @@ static void acpi_pad_remove_sysfs(struct acpi_device *device)
device_remove_file(&device->dev, &dev_attr_rrtime);
}

/* Query firmware how many CPUs should be idle */
static int acpi_pad_pur(acpi_handle handle, int *num_cpus)
/*
* Query firmware how many CPUs should be idle
* return -1 on failure
*/
static int acpi_pad_pur(acpi_handle handle)
{
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
union acpi_object *package;
int rev, num, ret = -EINVAL;
int num = -1;

if (ACPI_FAILURE(acpi_evaluate_object(handle, "_PUR", NULL, &buffer)))
return -EINVAL;
return num;

if (!buffer.length || !buffer.pointer)
return -EINVAL;
return num;

package = buffer.pointer;
if (package->type != ACPI_TYPE_PACKAGE || package->package.count != 2)
goto out;
rev = package->package.elements[0].integer.value;
num = package->package.elements[1].integer.value;
if (rev != 1 || num < 0)
goto out;
*num_cpus = num;
ret = 0;
out:

if (package->type == ACPI_TYPE_PACKAGE &&
package->package.count == 2 &&
package->package.elements[0].integer.value == 1) /* rev 1 */

num = package->package.elements[1].integer.value;

kfree(buffer.pointer);
return ret;
return num;
}

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

mutex_lock(&isolated_cpus_lock);
if (acpi_pad_pur(handle, &num_cpus)) {
num_cpus = acpi_pad_pur(handle);
if (num_cpus < 0) {
mutex_unlock(&isolated_cpus_lock);
return;
}
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,7 @@ struct acpi_bit_register_info {
ACPI_BITMASK_POWER_BUTTON_STATUS | \
ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
ACPI_BITMASK_RT_CLOCK_STATUS | \
ACPI_BITMASK_PCIEXP_WAKE_DISABLE | \
ACPI_BITMASK_WAKE_STATUS)

#define ACPI_BITMASK_TIMER_ENABLE 0x0001
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/exutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void acpi_ex_enter_interpreter(void)
*
* DESCRIPTION: Reacquire the interpreter execution region from within the
* interpreter code. Failure to enter the interpreter region is a
* fatal system error. Used in conjuction with
* fatal system error. Used in conjunction with
* relinquish_interpreter
*
******************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/rsutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ acpi_rs_move_data(void *destination, void *source, u16 item_count, u8 move_type)

/*
* 16-, 32-, and 64-bit cases must use the move macros that perform
* endian conversion and/or accomodate hardware that cannot perform
* endian conversion and/or accommodate hardware that cannot perform
* misaligned memory transfers
*/
case ACPI_RSC_MOVE16:
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/apei/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ config ACPI_APEI_ERST_DEBUG
depends on ACPI_APEI
help
ERST is a way provided by APEI to save and retrieve hardware
error infomation to and from a persistent store. Enable this
error information to and from a persistent store. Enable this
if you want to debugging and testing the ERST kernel support
and firmware implementation.
21 changes: 16 additions & 5 deletions drivers/acpi/apei/apei-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,11 +445,15 @@ EXPORT_SYMBOL_GPL(apei_resources_sub);
int apei_resources_request(struct apei_resources *resources,
const char *desc)
{
struct apei_res *res, *res_bak;
struct apei_res *res, *res_bak = NULL;
struct resource *r;
int rc;

apei_resources_sub(resources, &apei_resources_all);
rc = apei_resources_sub(resources, &apei_resources_all);
if (rc)
return rc;

rc = -EINVAL;
list_for_each_entry(res, &resources->iomem, list) {
r = request_mem_region(res->start, res->end - res->start,
desc);
Expand All @@ -475,7 +479,11 @@ int apei_resources_request(struct apei_resources *resources,
}
}

apei_resources_merge(&apei_resources_all, resources);
rc = apei_resources_merge(&apei_resources_all, resources);
if (rc) {
pr_err(APEI_PFX "Fail to merge resources!\n");
goto err_unmap_ioport;
}

return 0;
err_unmap_ioport:
Expand All @@ -491,20 +499,23 @@ int apei_resources_request(struct apei_resources *resources,
break;
release_mem_region(res->start, res->end - res->start);
}
return -EINVAL;
return rc;
}
EXPORT_SYMBOL_GPL(apei_resources_request);

void apei_resources_release(struct apei_resources *resources)
{
int rc;
struct apei_res *res;

list_for_each_entry(res, &resources->iomem, list)
release_mem_region(res->start, res->end - res->start);
list_for_each_entry(res, &resources->ioport, list)
release_region(res->start, res->end - res->start);

apei_resources_sub(&apei_resources_all, resources);
rc = apei_resources_sub(&apei_resources_all, resources);
if (rc)
pr_err(APEI_PFX "Fail to sub resources!\n");
}
EXPORT_SYMBOL_GPL(apei_resources_release);

Expand Down
4 changes: 3 additions & 1 deletion drivers/acpi/apei/einj.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ DEFINE_SIMPLE_ATTRIBUTE(error_inject_fops, NULL,

static int einj_check_table(struct acpi_table_einj *einj_tab)
{
if (einj_tab->header_length != sizeof(struct acpi_table_einj))
if ((einj_tab->header_length !=
(sizeof(struct acpi_table_einj) - sizeof(einj_tab->header)))
&& (einj_tab->header_length != sizeof(struct acpi_table_einj)))
return -EINVAL;
if (einj_tab->header.length < sizeof(struct acpi_table_einj))
return -EINVAL;
Expand Down
18 changes: 11 additions & 7 deletions drivers/acpi/apei/erst-dbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* APEI Error Record Serialization Table debug support
*
* ERST is a way provided by APEI to save and retrieve hardware error
* infomation to and from a persistent store. This file provide the
* information to and from a persistent store. This file provide the
* debugging/testing support for ERST kernel support and firmware
* implementation.
*
Expand Down Expand Up @@ -111,11 +111,13 @@ static ssize_t erst_dbg_read(struct file *filp, char __user *ubuf,
goto out;
}
if (len > erst_dbg_buf_len) {
kfree(erst_dbg_buf);
void *p;
rc = -ENOMEM;
erst_dbg_buf = kmalloc(len, GFP_KERNEL);
if (!erst_dbg_buf)
p = kmalloc(len, GFP_KERNEL);
if (!p)
goto out;
kfree(erst_dbg_buf);
erst_dbg_buf = p;
erst_dbg_buf_len = len;
goto retry;
}
Expand Down Expand Up @@ -150,11 +152,13 @@ static ssize_t erst_dbg_write(struct file *filp, const char __user *ubuf,
if (mutex_lock_interruptible(&erst_dbg_mutex))
return -EINTR;
if (usize > erst_dbg_buf_len) {
kfree(erst_dbg_buf);
void *p;
rc = -ENOMEM;
erst_dbg_buf = kmalloc(usize, GFP_KERNEL);
if (!erst_dbg_buf)
p = kmalloc(usize, GFP_KERNEL);
if (!p)
goto out;
kfree(erst_dbg_buf);
erst_dbg_buf = p;
erst_dbg_buf_len = usize;
}
rc = copy_from_user(erst_dbg_buf, ubuf, usize);
Expand Down
29 changes: 24 additions & 5 deletions drivers/acpi/apei/erst.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* APEI Error Record Serialization Table support
*
* ERST is a way provided by APEI to save and retrieve hardware error
* infomation to and from a persistent store.
* information to and from a persistent store.
*
* For more information about ERST, please refer to ACPI Specification
* version 4.0, section 17.4.
Expand Down Expand Up @@ -266,13 +266,30 @@ static int erst_exec_move_data(struct apei_exec_context *ctx,
{
int rc;
u64 offset;
void *src, *dst;

/* ioremap does not work in interrupt context */
if (in_interrupt()) {
pr_warning(ERST_PFX
"MOVE_DATA can not be used in interrupt context");
return -EBUSY;
}

rc = __apei_exec_read_register(entry, &offset);
if (rc)
return rc;
memmove((void *)ctx->dst_base + offset,
(void *)ctx->src_base + offset,
ctx->var2);

src = ioremap(ctx->src_base + offset, ctx->var2);
if (!src)
return -ENOMEM;
dst = ioremap(ctx->dst_base + offset, ctx->var2);
if (!dst)
return -ENOMEM;

memmove(dst, src, ctx->var2);

iounmap(src);
iounmap(dst);

return 0;
}
Expand Down Expand Up @@ -750,7 +767,9 @@ __setup("erst_disable", setup_erst_disable);

static int erst_check_table(struct acpi_table_erst *erst_tab)
{
if (erst_tab->header_length != sizeof(struct acpi_table_erst))
if ((erst_tab->header_length !=
(sizeof(struct acpi_table_erst) - sizeof(erst_tab->header)))
&& (erst_tab->header_length != sizeof(struct acpi_table_einj)))
return -EINVAL;
if (erst_tab->header.length < sizeof(struct acpi_table_erst))
return -EINVAL;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/apei/ghes.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static int __devinit ghes_probe(struct platform_device *ghes_dev)
struct ghes *ghes = NULL;
int rc = -EINVAL;

generic = ghes_dev->dev.platform_data;
generic = *(struct acpi_hest_generic **)ghes_dev->dev.platform_data;
if (!generic->enabled)
return -ENODEV;

Expand Down
11 changes: 7 additions & 4 deletions drivers/acpi/apei/hest.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,20 +137,23 @@ static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)

static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
{
struct acpi_hest_generic *generic;
struct platform_device *ghes_dev;
struct ghes_arr *ghes_arr = data;
int rc;

if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR)
return 0;
generic = (struct acpi_hest_generic *)hest_hdr;
if (!generic->enabled)

if (!((struct acpi_hest_generic *)hest_hdr)->enabled)
return 0;
ghes_dev = platform_device_alloc("GHES", hest_hdr->source_id);
if (!ghes_dev)
return -ENOMEM;
ghes_dev->dev.platform_data = generic;

rc = platform_device_add_data(ghes_dev, &hest_hdr, sizeof(void *));
if (rc)
goto err;

rc = platform_device_add(ghes_dev);
if (rc)
goto err;
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/atomicio.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static void __iomem *acpi_pre_map(phys_addr_t paddr,
list_add_tail_rcu(&map->list, &acpi_iomaps);
spin_unlock_irqrestore(&acpi_iomaps_lock, flags);

return vaddr + (paddr - pg_off);
return map->vaddr + (paddr - map->paddr);
err_unmap:
iounmap(vaddr);
return NULL;
Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ static enum power_supply_property energy_battery_props[] = {
POWER_SUPPLY_PROP_CYCLE_COUNT,
POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
POWER_SUPPLY_PROP_VOLTAGE_NOW,
POWER_SUPPLY_PROP_CURRENT_NOW,
POWER_SUPPLY_PROP_POWER_NOW,
POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
POWER_SUPPLY_PROP_ENERGY_FULL,
Expand Down
18 changes: 18 additions & 0 deletions drivers/acpi/blacklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ static int __init dmi_disable_osi_vista(const struct dmi_system_id *d)
{
printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident);
acpi_osi_setup("!Windows 2006");
acpi_osi_setup("!Windows 2006 SP1");
acpi_osi_setup("!Windows 2006 SP2");
return 0;
}
static int __init dmi_disable_osi_win7(const struct dmi_system_id *d)
Expand Down Expand Up @@ -226,13 +228,29 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = {
},
},
{
.callback = dmi_disable_osi_vista,
.ident = "Toshiba Satellite L355",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
DMI_MATCH(DMI_PRODUCT_VERSION, "Satellite L355"),
},
},
{
.callback = dmi_disable_osi_win7,
.ident = "ASUS K50IJ",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK Computer Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "K50IJ"),
},
},
{
.callback = dmi_disable_osi_vista,
.ident = "Toshiba P305D",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
DMI_MATCH(DMI_PRODUCT_NAME, "Satellite P305D"),
},
},

/*
* BIOS invocation of _OSI(Linux) is almost always a BIOS bug.
Expand Down
Loading

0 comments on commit 303a407

Please sign in to comment.