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 / PM: Move ACPI video resume to a PM notifier
  ACPI: Reduce ACPI resource conflict message to KERN_WARNING, printk cleanup
  ACPI: battery drivers should call power_supply_changed()
  ACPI: battery: Fix CONFIG_ACPI_SYSFS_POWER=n
  PNPACPI: truncate _CRS windows with _LEN > _MAX - _MIN + 1
  ACPI: Don't send KEY_UNKNOWN for random video notifications
  ACPI: NUMA: map pxms to low node ids
  ACPI: use _HID when supplied by root-level devices
  ACPI / ACPICA: Do not check reference counters in acpi_ev_enable_gpe()
  ACPI: fixes a false alarm from lockdep
  ACPI dock: support multiple ACPI dock devices
  ACPI: EC: Allow multibyte access to EC
  • Loading branch information
Linus Torvalds committed Apr 8, 2010
2 parents f5284e7 + c25f7cf commit 0a2851b
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 98 deletions.
19 changes: 7 additions & 12 deletions drivers/acpi/acpica/evgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,14 @@ acpi_status acpi_ev_enable_gpe(struct acpi_gpe_event_info *gpe_event_info)
if (ACPI_FAILURE(status))
return_ACPI_STATUS(status);

/* Mark wake-enabled or HW enable, or both */

if (gpe_event_info->runtime_count) {
/* Clear the GPE (of stale events), then enable it */
status = acpi_hw_clear_gpe(gpe_event_info);
if (ACPI_FAILURE(status))
return_ACPI_STATUS(status);

/* Enable the requested runtime GPE */
status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
}
/* Clear the GPE (of stale events), then enable it */
status = acpi_hw_clear_gpe(gpe_event_info);
if (ACPI_FAILURE(status))
return_ACPI_STATUS(status);

return_ACPI_STATUS(AE_OK);
/* Enable the requested GPE */
status = acpi_hw_write_gpe_enable_reg(gpe_event_info);
return_ACPI_STATUS(status);
}

/*******************************************************************************
Expand Down
12 changes: 12 additions & 0 deletions drivers/acpi/acpica/exprep.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,18 @@ acpi_status acpi_ex_prep_field_value(struct acpi_create_field_info *info)

acpi_ut_add_reference(obj_desc->field.region_obj);

/* allow full data read from EC address space */
if (obj_desc->field.region_obj->region.space_id ==
ACPI_ADR_SPACE_EC) {
if (obj_desc->common_field.bit_length > 8)
obj_desc->common_field.access_bit_width =
ACPI_ROUND_UP(obj_desc->common_field.
bit_length, 8);
obj_desc->common_field.access_byte_width =
ACPI_DIV_8(obj_desc->common_field.
access_bit_width);
}

ACPI_DEBUG_PRINT((ACPI_DB_BFIELD,
"RegionField: BitOff %X, Off %X, Gran %X, Region %p\n",
obj_desc->field.start_field_bit_offset,
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,13 +568,13 @@ static int acpi_battery_update(struct acpi_battery *battery)
result = acpi_battery_get_status(battery);
if (result)
return result;
#ifdef CONFIG_ACPI_SYSFS_POWER
if (!acpi_battery_present(battery)) {
#ifdef CONFIG_ACPI_SYSFS_POWER
sysfs_remove_battery(battery);
#endif
battery->update_time = 0;
return 0;
}
#endif
if (!battery->update_time ||
old_present != acpi_battery_present(battery)) {
result = acpi_battery_get_info(battery);
Expand Down Expand Up @@ -880,7 +880,7 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
#ifdef CONFIG_ACPI_SYSFS_POWER
/* acpi_battery_update could remove power_supply object */
if (battery->bat.dev)
kobject_uevent(&battery->bat.dev->kobj, KOBJ_CHANGE);
power_supply_changed(&battery->bat);
#endif
}

Expand Down
7 changes: 2 additions & 5 deletions drivers/acpi/dock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,13 +1026,10 @@ static int dock_remove(struct dock_station *ds)
static acpi_status
find_dock(acpi_handle handle, u32 lvl, void *context, void **rv)
{
acpi_status status = AE_OK;

if (is_dock(handle))
if (dock_add(handle) >= 0)
status = AE_CTRL_TERMINATE;
dock_add(handle);

return status;
return AE_OK;
}

static acpi_status
Expand Down
35 changes: 9 additions & 26 deletions drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,45 +629,28 @@ static u32 acpi_ec_gpe_handler(void *data)

static acpi_status
acpi_ec_space_handler(u32 function, acpi_physical_address address,
u32 bits, u64 *value,
u32 bits, u64 *value64,
void *handler_context, void *region_context)
{
struct acpi_ec *ec = handler_context;
int result = 0, i;
u8 temp = 0;
int result = 0, i, bytes = bits / 8;
u8 *value = (u8 *)value64;

if ((address > 0xFF) || !value || !handler_context)
return AE_BAD_PARAMETER;

if (function != ACPI_READ && function != ACPI_WRITE)
return AE_BAD_PARAMETER;

if (bits != 8 && acpi_strict)
return AE_BAD_PARAMETER;

if (EC_FLAGS_MSI)
if (EC_FLAGS_MSI || bits > 8)
acpi_ec_burst_enable(ec);

if (function == ACPI_READ) {
result = acpi_ec_read(ec, address, &temp);
*value = temp;
} else {
temp = 0xff & (*value);
result = acpi_ec_write(ec, address, temp);
}

for (i = 8; unlikely(bits - i > 0); i += 8) {
++address;
if (function == ACPI_READ) {
result = acpi_ec_read(ec, address, &temp);
(*value) |= ((u64)temp) << i;
} else {
temp = 0xff & ((*value) >> i);
result = acpi_ec_write(ec, address, temp);
}
}
for (i = 0; i < bytes; ++i, ++address, ++value)
result = (function == ACPI_READ) ?
acpi_ec_read(ec, address, value) :
acpi_ec_write(ec, address, *value);

if (EC_FLAGS_MSI)
if (EC_FLAGS_MSI || bits > 8)
acpi_ec_burst_disable(ec);

switch (result) {
Expand Down
6 changes: 4 additions & 2 deletions drivers/acpi/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ int node_to_pxm(int node)

void __acpi_map_pxm_to_node(int pxm, int node)
{
pxm_to_node_map[pxm] = node;
node_to_pxm_map[node] = pxm;
if (pxm_to_node_map[pxm] == NUMA_NO_NODE || node < pxm_to_node_map[pxm])
pxm_to_node_map[pxm] = node;
if (node_to_pxm_map[node] == PXM_INVAL || pxm < node_to_pxm_map[node])
node_to_pxm_map[node] = pxm;
}

int acpi_map_pxm_to_node(int pxm)
Expand Down
23 changes: 12 additions & 11 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,14 @@ static acpi_status __acpi_os_execute(acpi_execute_type type,
queue = hp ? kacpi_hotplug_wq :
(type == OSL_NOTIFY_HANDLER ? kacpi_notify_wq : kacpid_wq);
dpc->wait = hp ? 1 : 0;
INIT_WORK(&dpc->work, acpi_os_execute_deferred);

if (queue == kacpi_hotplug_wq)
INIT_WORK(&dpc->work, acpi_os_execute_deferred);
else if (queue == kacpi_notify_wq)
INIT_WORK(&dpc->work, acpi_os_execute_deferred);
else
INIT_WORK(&dpc->work, acpi_os_execute_deferred);

ret = queue_work(queue, &dpc->work);

if (!ret) {
Expand Down Expand Up @@ -1151,16 +1158,10 @@ int acpi_check_resource_conflict(const struct resource *res)

if (clash) {
if (acpi_enforce_resources != ENFORCE_RESOURCES_NO) {
printk("%sACPI: %s resource %s [0x%llx-0x%llx]"
" conflicts with ACPI region %s"
" [0x%llx-0x%llx]\n",
acpi_enforce_resources == ENFORCE_RESOURCES_LAX
? KERN_WARNING : KERN_ERR,
ioport ? "I/O" : "Memory", res->name,
(long long) res->start, (long long) res->end,
res_list_elem->name,
(long long) res_list_elem->start,
(long long) res_list_elem->end);
printk(KERN_WARNING "ACPI: resource %s %pR"
" conflicts with ACPI region %s %pR\n",
res->name, res, res_list_elem->name,
res_list_elem);
if (acpi_enforce_resources == ENFORCE_RESOURCES_LAX)
printk(KERN_NOTICE "ACPI: This conflict may"
" cause random problems and system"
Expand Down
12 changes: 6 additions & 6 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,12 +1081,6 @@ static void acpi_device_set_id(struct acpi_device *device)
if (ACPI_IS_ROOT_DEVICE(device)) {
acpi_add_id(device, ACPI_SYSTEM_HID);
break;
} else if (ACPI_IS_ROOT_DEVICE(device->parent)) {
/* \_SB_, the only root-level namespace device */
acpi_add_id(device, ACPI_BUS_HID);
strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
strcpy(device->pnp.device_class, ACPI_BUS_CLASS);
break;
}

status = acpi_get_object_info(device->handle, &info);
Expand Down Expand Up @@ -1121,6 +1115,12 @@ static void acpi_device_set_id(struct acpi_device *device)
acpi_add_id(device, ACPI_DOCK_HID);
else if (!acpi_ibm_smbus_match(device))
acpi_add_id(device, ACPI_SMBUS_IBM_HID);
else if (!acpi_device_hid(device) &&
ACPI_IS_ROOT_DEVICE(device->parent)) {
acpi_add_id(device, ACPI_BUS_HID); /* \_SB, LNXSYBUS */
strcpy(device->pnp.device_name, ACPI_BUS_DEVICE_NAME);
strcpy(device->pnp.device_class, ACPI_BUS_CLASS);
}

break;
case ACPI_BUS_TYPE_POWER:
Expand Down
Loading

0 comments on commit 0a2851b

Please sign in to comment.