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

Pul ACPI & Power Management updates from Len Brown:
 - acpidump utility added
 - intel_idle driver now supports IVB Xeon
 - turbostat utility can now count SMIs
 - ACPI can now bind to USB3 hubs
 - misc fixes

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (49 commits)
  ACPI: Add new sysfs interface to export device description
  ACPI: Harden acpi_table_parse_entries() against BIOS bug
  tools/power/turbostat: add option to count SMIs, re-name some options
  tools/power turbostat: add [-d MSR#][-D MSR#] options to print counter deltas
  intel_idle: enable IVB Xeon support
  tools/power turbostat: add [-m MSR#] option
  tools/power turbostat: make -M output pretty
  tools/power turbostat: print more turbo-limit information
  tools/power turbostat: delete unused line
  tools/power turbostat: run on IVB Xeon
  tools/power/acpi/acpidump: create acpidump(8), local make install targets
  tools/power/acpi/acpidump: version 20101221 - find dynamic tables in sysfs
  ACPI: run _OSC after ACPI_FULL_INITIALIZATION
  tools/power/acpi/acpidump: create acpidump(8), local make install targets
  tools/power/acpi/acpidump: version 20101221 - find dynamic tables in sysfs
  tools/power/acpi/acpidump: version 20071116
  tools/power/acpi/acpidump: version 20070714
  tools/power/acpi/acpidump: version 20060606
  tools/power/acpi/acpidump: version 20051111
  xo15-ebook: convert to module_acpi_driver()
  ...
  • Loading branch information
torvalds committed Oct 7, 2012
2 parents 7035cdf + 3f44ea0 commit d8dc91b
Show file tree
Hide file tree
Showing 51 changed files with 2,073 additions and 737 deletions.
17 changes: 17 additions & 0 deletions Documentation/ABI/testing/sysfs-devices-firmware_node
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
What: /sys/devices/.../firmware_node/
Date: September 2012
Contact: <>
Description:
The /sys/devices/.../firmware_node directory contains attributes
allowing the user space to check and modify some firmware
related properties of given device.

What: /sys/devices/.../firmware_node/description
Date: September 2012
Contact: Lance Ortiz <lance.ortiz@hp.com>
Description:
The /sys/devices/.../firmware/description attribute contains a string
that describes the device as provided by the _STR method in the ACPI
namespace. This attribute is read-only. If the device does not have
an _STR method associated with it in the ACPI namespace, this
attribute is not present.
1 change: 1 addition & 0 deletions drivers/acpi/acpica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,6 @@ acpi-y += \
utresrc.o \
utstate.o \
utxface.o \
utxfinit.o \
utxferror.o \
utxfmutex.o
3 changes: 1 addition & 2 deletions drivers/acpi/acpica/achware.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ acpi_status acpi_hw_write_port(acpi_io_address address, u32 value, u32 width);
/*
* hwgpe - GPE support
*/
u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info,
struct acpi_gpe_register_info *gpe_register_info);
u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info);

acpi_status
acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action);
Expand Down
23 changes: 14 additions & 9 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -707,15 +707,18 @@ union acpi_parse_value {
u8 disasm_opcode; /* Subtype used for disassembly */\
char aml_op_name[16]) /* Op name (debug only) */

#define ACPI_DASM_BUFFER 0x00
#define ACPI_DASM_RESOURCE 0x01
#define ACPI_DASM_STRING 0x02
#define ACPI_DASM_UNICODE 0x03
#define ACPI_DASM_EISAID 0x04
#define ACPI_DASM_MATCHOP 0x05
#define ACPI_DASM_LNOT_PREFIX 0x06
#define ACPI_DASM_LNOT_SUFFIX 0x07
#define ACPI_DASM_IGNORE 0x08
/* Flags for disasm_flags field above */

#define ACPI_DASM_BUFFER 0x00 /* Buffer is a simple data buffer */
#define ACPI_DASM_RESOURCE 0x01 /* Buffer is a Resource Descriptor */
#define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */
#define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */
#define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */
#define ACPI_DASM_EISAID 0x05 /* Integer is an EISAID */
#define ACPI_DASM_MATCHOP 0x06 /* Parent opcode is a Match() operator */
#define ACPI_DASM_LNOT_PREFIX 0x07 /* Start of a Lnot_equal (etc.) pair of opcodes */
#define ACPI_DASM_LNOT_SUFFIX 0x08 /* End of a Lnot_equal (etc.) pair of opcodes */
#define ACPI_DASM_IGNORE 0x09 /* Not used at this time */

/*
* Generic operation (for example: If, While, Store)
Expand Down Expand Up @@ -932,6 +935,7 @@ struct acpi_bit_register_info {
#define ACPI_OSI_WIN_VISTA_SP1 0x09
#define ACPI_OSI_WIN_VISTA_SP2 0x0A
#define ACPI_OSI_WIN_7 0x0B
#define ACPI_OSI_WIN_8 0x0C

#define ACPI_ALWAYS_ILLEGAL 0x00

Expand Down Expand Up @@ -1024,6 +1028,7 @@ struct acpi_port_info {
****************************************************************************/

struct acpi_db_method_info {
acpi_handle method;
acpi_handle main_thread_gate;
acpi_handle thread_complete_gate;
acpi_thread_id *threads;
Expand Down
29 changes: 26 additions & 3 deletions drivers/acpi/acpica/acmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,33 @@

/* Bitfields within ACPI registers */

#define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) ((val << pos) & mask)
#define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask)
#define ACPI_REGISTER_PREPARE_BITS(val, pos, mask) \
((val << pos) & mask)

#define ACPI_INSERT_BITS(target, mask, source) target = ((target & (~(mask))) | (source & mask))
#define ACPI_REGISTER_INSERT_VALUE(reg, pos, mask, val) \
reg = (reg & (~(mask))) | ACPI_REGISTER_PREPARE_BITS(val, pos, mask)

#define ACPI_INSERT_BITS(target, mask, source) \
target = ((target & (~(mask))) | (source & mask))

/* Generic bitfield macros and masks */

#define ACPI_GET_BITS(source_ptr, position, mask) \
((*source_ptr >> position) & mask)

#define ACPI_SET_BITS(target_ptr, position, mask, value) \
(*target_ptr |= ((value & mask) << position))

#define ACPI_1BIT_MASK 0x00000001
#define ACPI_2BIT_MASK 0x00000003
#define ACPI_3BIT_MASK 0x00000007
#define ACPI_4BIT_MASK 0x0000000F
#define ACPI_5BIT_MASK 0x0000001F
#define ACPI_6BIT_MASK 0x0000003F
#define ACPI_7BIT_MASK 0x0000007F
#define ACPI_8BIT_MASK 0x000000FF
#define ACPI_16BIT_MASK 0x0000FFFF
#define ACPI_24BIT_MASK 0x00FFFFFF

/*
* An object of type struct acpi_namespace_node can appear in some contexts
Expand Down
14 changes: 14 additions & 0 deletions drivers/acpi/acpica/dswload.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,20 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
walk_state->scope_info->common.value = ACPI_TYPE_ANY;
break;

case ACPI_TYPE_METHOD:

/*
* Allow scope change to root during execution of module-level
* code. Root is typed METHOD during this time.
*/
if ((node == acpi_gbl_root_node) &&
(walk_state->
parse_flags & ACPI_PARSE_MODULE_LEVEL)) {
break;
}

/*lint -fallthrough */

default:

/* All other types are an error */
Expand Down
14 changes: 14 additions & 0 deletions drivers/acpi/acpica/dswload2.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,20 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state,
walk_state->scope_info->common.value = ACPI_TYPE_ANY;
break;

case ACPI_TYPE_METHOD:

/*
* Allow scope change to root during execution of module-level
* code. Root is typed METHOD during this time.
*/
if ((node == acpi_gbl_root_node) &&
(walk_state->
parse_flags & ACPI_PARSE_MODULE_LEVEL)) {
break;
}

/*lint -fallthrough */

default:

/* All other types are an error */
Expand Down
24 changes: 20 additions & 4 deletions drivers/acpi/acpica/evgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ acpi_ev_update_gpe_enable_mask(struct acpi_gpe_event_info *gpe_event_info)
return_ACPI_STATUS(AE_NOT_EXIST);
}

register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info,
gpe_register_info);
register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);

/* Clear the run bit up front */

Expand Down Expand Up @@ -379,6 +378,18 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
*/
if (!(gpe_register_info->enable_for_run |
gpe_register_info->enable_for_wake)) {
ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS,
"Ignore disabled registers for GPE%02X-GPE%02X: "
"RunEnable=%02X, WakeEnable=%02X\n",
gpe_register_info->
base_gpe_number,
gpe_register_info->
base_gpe_number +
(ACPI_GPE_REGISTER_WIDTH - 1),
gpe_register_info->
enable_for_run,
gpe_register_info->
enable_for_wake));
continue;
}

Expand All @@ -401,9 +412,14 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info * gpe_xrupt_list)
}

ACPI_DEBUG_PRINT((ACPI_DB_INTERRUPTS,
"Read GPE Register at GPE%02X: Status=%02X, Enable=%02X\n",
"Read registers for GPE%02X-GPE%02X: Status=%02X, Enable=%02X, "
"RunEnable=%02X, WakeEnable=%02X\n",
gpe_register_info->base_gpe_number,
status_reg, enable_reg));
gpe_register_info->base_gpe_number +
(ACPI_GPE_REGISTER_WIDTH - 1),
status_reg, enable_reg,
gpe_register_info->enable_for_run,
gpe_register_info->enable_for_wake));

/* Check if there is anything active at all in this register */

Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/acpica/evxfgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,7 @@ acpi_status acpi_set_gpe_wake_mask(acpi_handle gpe_device, u32 gpe_number, u8 ac
goto unlock_and_exit;
}

register_bit =
acpi_hw_get_gpe_register_bit(gpe_event_info, gpe_register_info);
register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);

/* Perform the action */

Expand Down
15 changes: 5 additions & 10 deletions drivers/acpi/acpica/hwgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
* FUNCTION: acpi_hw_get_gpe_register_bit
*
* PARAMETERS: gpe_event_info - Info block for the GPE
* gpe_register_info - Info block for the GPE register
*
* RETURN: Register mask with a one in the GPE bit position
*
Expand All @@ -69,11 +68,10 @@ acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
*
******************************************************************************/

u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info,
struct acpi_gpe_register_info *gpe_register_info)
u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info)
{
return (u32)1 << (gpe_event_info->gpe_number -
gpe_register_info->base_gpe_number);
gpe_event_info->register_info->base_gpe_number);
}

/******************************************************************************
Expand Down Expand Up @@ -115,8 +113,7 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action)

/* Set or clear just the bit that corresponds to this GPE */

register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info,
gpe_register_info);
register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);
switch (action) {
case ACPI_GPE_CONDITIONAL_ENABLE:

Expand Down Expand Up @@ -178,8 +175,7 @@ acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
* Write a one to the appropriate bit in the status register to
* clear this GPE.
*/
register_bit =
acpi_hw_get_gpe_register_bit(gpe_event_info, gpe_register_info);
register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);

status = acpi_hw_write(register_bit,
&gpe_register_info->status_address);
Expand Down Expand Up @@ -222,8 +218,7 @@ acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,

/* Get the register bitmask for this GPE */

register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info,
gpe_register_info);
register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);

/* GPE currently enabled? (enabled for runtime?) */

Expand Down
1 change: 0 additions & 1 deletion drivers/acpi/acpica/hwxfsleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,6 @@ ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state)
* FUNCTION: acpi_leave_sleep_state_prep
*
* PARAMETERS: sleep_state - Which sleep state we are exiting
* flags - ACPI_EXECUTE_BFS to run optional method
*
* RETURN: Status
*
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/nsdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
switch (type) {
case ACPI_TYPE_PROCESSOR:

acpi_os_printf("ID %X Len %.4X Addr %p\n",
acpi_os_printf("ID %02X Len %02X Addr %p\n",
obj_desc->processor.proc_id,
obj_desc->processor.length,
ACPI_CAST_PTR(void,
Expand Down
20 changes: 13 additions & 7 deletions drivers/acpi/acpica/tbinstal.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,7 @@ struct acpi_table_header *acpi_tb_table_override(struct acpi_table_header
acpi_status acpi_tb_resize_root_table_list(void)
{
struct acpi_table_desc *tables;
u32 table_count;

ACPI_FUNCTION_TRACE(tb_resize_root_table_list);

Expand All @@ -363,8 +364,13 @@ acpi_status acpi_tb_resize_root_table_list(void)

/* Increase the Table Array size */

tables = ACPI_ALLOCATE_ZEROED(((acpi_size) acpi_gbl_root_table_list.
max_table_count +
if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) {
table_count = acpi_gbl_root_table_list.max_table_count;
} else {
table_count = acpi_gbl_root_table_list.current_table_count;
}

tables = ACPI_ALLOCATE_ZEROED(((acpi_size) table_count +
ACPI_ROOT_TABLE_SIZE_INCREMENT) *
sizeof(struct acpi_table_desc));
if (!tables) {
Expand All @@ -377,18 +383,18 @@ acpi_status acpi_tb_resize_root_table_list(void)

if (acpi_gbl_root_table_list.tables) {
ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables,
(acpi_size) acpi_gbl_root_table_list.
max_table_count * sizeof(struct acpi_table_desc));
(acpi_size) table_count *
sizeof(struct acpi_table_desc));

if (acpi_gbl_root_table_list.flags & ACPI_ROOT_ORIGIN_ALLOCATED) {
ACPI_FREE(acpi_gbl_root_table_list.tables);
}
}

acpi_gbl_root_table_list.tables = tables;
acpi_gbl_root_table_list.max_table_count +=
ACPI_ROOT_TABLE_SIZE_INCREMENT;
acpi_gbl_root_table_list.flags |= (u8)ACPI_ROOT_ORIGIN_ALLOCATED;
acpi_gbl_root_table_list.max_table_count =
table_count + ACPI_ROOT_TABLE_SIZE_INCREMENT;
acpi_gbl_root_table_list.flags |= ACPI_ROOT_ORIGIN_ALLOCATED;

return_ACPI_STATUS(AE_OK);
}
Expand Down
41 changes: 5 additions & 36 deletions drivers/acpi/acpica/tbxface.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,12 @@ acpi_initialize_tables(struct acpi_table_desc * initial_table_array,
* DESCRIPTION: Reallocate Root Table List into dynamic memory. Copies the
* root list from the previously provided scratch area. Should
* be called once dynamic memory allocation is available in the
* kernel
* kernel.
*
******************************************************************************/
acpi_status acpi_reallocate_root_table(void)
{
struct acpi_table_desc *tables;
acpi_size new_size;
acpi_size current_size;
acpi_status status;

ACPI_FUNCTION_TRACE(acpi_reallocate_root_table);

Expand All @@ -178,39 +176,10 @@ acpi_status acpi_reallocate_root_table(void)
return_ACPI_STATUS(AE_SUPPORT);
}

/*
* Get the current size of the root table and add the default
* increment to create the new table size.
*/
current_size = (acpi_size)
acpi_gbl_root_table_list.current_table_count *
sizeof(struct acpi_table_desc);

new_size = current_size +
(ACPI_ROOT_TABLE_SIZE_INCREMENT * sizeof(struct acpi_table_desc));

/* Create new array and copy the old array */

tables = ACPI_ALLOCATE_ZEROED(new_size);
if (!tables) {
return_ACPI_STATUS(AE_NO_MEMORY);
}
acpi_gbl_root_table_list.flags |= ACPI_ROOT_ALLOW_RESIZE;

ACPI_MEMCPY(tables, acpi_gbl_root_table_list.tables, current_size);

/*
* Update the root table descriptor. The new size will be the current
* number of tables plus the increment, independent of the reserved
* size of the original table list.
*/
acpi_gbl_root_table_list.tables = tables;
acpi_gbl_root_table_list.max_table_count =
acpi_gbl_root_table_list.current_table_count +
ACPI_ROOT_TABLE_SIZE_INCREMENT;
acpi_gbl_root_table_list.flags =
ACPI_ROOT_ORIGIN_ALLOCATED | ACPI_ROOT_ALLOW_RESIZE;

return_ACPI_STATUS(AE_OK);
status = acpi_tb_resize_root_table_list();
return_ACPI_STATUS(status);
}

/*******************************************************************************
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/acpica/utosi.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = {
{"Windows 2006 SP1", NULL, 0, ACPI_OSI_WIN_VISTA_SP1}, /* Windows Vista SP1 - Added 09/2009 */
{"Windows 2006 SP2", NULL, 0, ACPI_OSI_WIN_VISTA_SP2}, /* Windows Vista SP2 - Added 09/2010 */
{"Windows 2009", NULL, 0, ACPI_OSI_WIN_7}, /* Windows 7 and Server 2008 R2 - Added 09/2009 */
{"Windows 2012", NULL, 0, ACPI_OSI_WIN_8}, /* Windows 8 and Server 2012 - Added 08/2012 */

/* Feature Group Strings */

Expand Down
Loading

0 comments on commit d8dc91b

Please sign in to comment.