Skip to content

Commit

Permalink
Merge tag 'acpi-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kerne…
Browse files Browse the repository at this point in the history
…l/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
 "These update ACPICA to upstream revision 20170831, fix APEI to use the
  fixmap instead of ioremap_page_range(), add an operation region driver
  for TI PMIC TPS68470, add support for PCC subspace IDs to the ACPI
  CPPC driver, fix a few assorted issues and clean up some code.

  Specifics:

   - Update the ACPICA code to upstream revision 20170831 including
      * PDTT table header support (Bob Moore).
      * Cleanup and extension of internal string-to-integer conversion
        functions (Bob Moore).
      * Support for 64-bit hardware accesses (Lv Zheng).
      * ACPI PM Timer code adjustment to deal with 64-bit return values
        of acpi_hw_read() (Bob Moore).
      * Support for deferred table verification in acpiexec (Lv Zheng).

   - Fix APEI to use the fixmap instead of ioremap_page_range() which
     cannot work correctly the way the code in there attempted to use it
     and drop some code that's not necessary any more after that change
     (James Morse).

   - Clean up the APEI support code and make it use 64-bit timestamps
     (Arnd Bergmann, Dongjiu Geng, Jan Beulich).

   - Add operation region driver for TI PMIC TPS68470 (Rajmohan Mani).

   - Add support for PCC subspace IDs to the ACPI CPPC driver (George
     Cherian).

   - Fix an ACPI EC driver regression related to the handling of EC
     events during the "noirq" phases of system suspend/resume (Lv
     Zheng).

   - Delay the initialization of the lid state in the ACPI button driver
     to fix issues appearing on some systems (Hans de Goede).

   - Extend the KIOX000A "device always present" quirk to cover all
     affected BIOS versions (Hans de Goede).

   - Clean up some code in the ACPI core and drivers (Colin Ian King,
     Gustavo Silva)"

* tag 'acpi-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (24 commits)
  ACPI: Mark expected switch fall-throughs
  ACPI / LPSS: Remove redundant initialization of clk
  ACPI / CPPC: Make CPPC ACPI driver aware of PCC subspace IDs
  mailbox: PCC: Move the MAX_PCC_SUBSPACES definition to header file
  ACPI / sysfs: Make function param_set_trace_method_name() static
  ACPI / button: Delay acpi_lid_initialize_state() until first user space open
  ACPI / EC: Fix regression related to triggering source of EC event handling
  APEI / ERST: use 64-bit timestamps
  ACPI / APEI: Remove arch_apei_flush_tlb_one()
  arm64: mm: Remove arch_apei_flush_tlb_one()
  ACPI / APEI: Remove ghes_ioremap_area
  ACPI / APEI: Replace ioremap_page_range() with fixmap
  ACPI / APEI: remove the unused dead-code for SEA/NMI notification type
  ACPI / x86: Extend KIOX000A quirk to cover all affected BIOS versions
  ACPI / APEI: adjust a local variable type in ghes_ioremap_pfn_irq()
  ACPICA: Update version to 20170831
  ACPICA: Update acpi_get_timer for 64-bit interface to acpi_hw_read
  ACPICA: String conversions: Update to add new behaviors
  ACPICA: String conversions: Cleanup/format comments. No functional changes
  ACPICA: Restructure/cleanup all string-to-integer conversion functions
  ...
  • Loading branch information
Linus Torvalds committed Nov 14, 2017
2 parents bd2cd7d + eb5fcc3 commit 04ed510
Show file tree
Hide file tree
Showing 48 changed files with 1,551 additions and 629 deletions.
12 changes: 0 additions & 12 deletions arch/arm64/include/asm/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,6 @@ static inline const char *acpi_get_enable_method(int cpu)
*/
#define acpi_disable_cmcff 1
pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr);

/*
* Despite its name, this function must still broadcast the TLB
* invalidation in order to ensure other CPUs don't end up with junk
* entries as a result of speculation. Unusually, its also called in
* IRQ context (ghes_iounmap_irq) so if we ever need to use IPIs for
* TLB broadcasting, then we're in trouble here.
*/
static inline void arch_apei_flush_tlb_one(unsigned long addr)
{
flush_tlb_kernel_range(addr, addr + PAGE_SIZE);
}
#endif /* CONFIG_ACPI_APEI */

#ifdef CONFIG_ACPI_NUMA
Expand Down
7 changes: 7 additions & 0 deletions arch/arm64/include/asm/fixmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ enum fixed_addresses {

FIX_EARLYCON_MEM_BASE,
FIX_TEXT_POKE0,

#ifdef CONFIG_ACPI_APEI_GHES
/* Used for GHES mapping from assorted contexts */
FIX_APEI_GHES_IRQ,
FIX_APEI_GHES_NMI,
#endif /* CONFIG_ACPI_APEI_GHES */

__end_of_permanent_fixed_addresses,

/*
Expand Down
4 changes: 4 additions & 0 deletions arch/arm64/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,10 @@ void __init early_fixmap_init(void)
}
}

/*
* Unusually, this is also called in IRQ context (ghes_iounmap_irq) so if we
* ever need to use IPIs for TLB broadcasting, then we're in trouble here.
*/
void __set_fixmap(enum fixed_addresses idx,
phys_addr_t phys, pgprot_t flags)
{
Expand Down
6 changes: 6 additions & 0 deletions arch/x86/include/asm/fixmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ enum fixed_addresses {
FIX_GDT_REMAP_BEGIN,
FIX_GDT_REMAP_END = FIX_GDT_REMAP_BEGIN + NR_CPUS - 1,

#ifdef CONFIG_ACPI_APEI_GHES
/* Used for GHES mapping from assorted contexts */
FIX_APEI_GHES_IRQ,
FIX_APEI_GHES_NMI,
#endif

__end_of_permanent_fixed_addresses,

/*
Expand Down
5 changes: 0 additions & 5 deletions arch/x86/kernel/acpi/apei.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,3 @@ void arch_apei_report_mem_error(int sev, struct cper_sec_mem_err *mem_err)
apei_mce_report_mem_error(sev, mem_err);
#endif
}

void arch_apei_flush_tlb_one(unsigned long addr)
{
__flush_tlb_one(addr);
}
16 changes: 16 additions & 0 deletions drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -541,4 +541,20 @@ if ARM64
source "drivers/acpi/arm64/Kconfig"
endif

config TPS68470_PMIC_OPREGION
bool "ACPI operation region support for TPS68470 PMIC"
depends on MFD_TPS68470
help
This config adds ACPI operation region support for TI TPS68470 PMIC.
TPS68470 device is an advanced power management unit that powers
a Compact Camera Module (CCM), generates clocks for image sensors,
drives a dual LED for flash and incorporates two LED drivers for
general purpose indicators.
This driver enables ACPI operation region support control voltage
regulators and clocks.

This option is a bool as it provides an ACPI operation
region, which must be available before any of the devices
using this, are probed.

endif # ACPI
2 changes: 2 additions & 0 deletions drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ obj-$(CONFIG_CHT_WC_PMIC_OPREGION) += pmic/intel_pmic_chtwc.o

obj-$(CONFIG_ACPI_CONFIGFS) += acpi_configfs.o

obj-$(CONFIG_TPS68470_PMIC_OPREGION) += pmic/tps68470_pmic.o

video-objs += acpi_video.o video_detect.o
obj-y += dptf/

Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event)
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Unsupported event [0x%x]\n", event));
/* fall through */
case ACPI_AC_NOTIFY_STATUS:
case ACPI_NOTIFY_BUS_CHECK:
case ACPI_NOTIFY_DEVICE_CHECK:
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpi_lpss.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ static int register_device_clock(struct acpi_device *adev,
{
const struct lpss_device_desc *dev_desc = pdata->dev_desc;
const char *devname = dev_name(&adev->dev);
struct clk *clk = ERR_PTR(-ENODEV);
struct clk *clk;
struct lpss_clk_data *clk_data;
const char *parent, *clk_name;
void __iomem *prv_base;
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/acpi_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
* PIIX4 models.
*/
errata.piix4.throttle = 1;
/* fall through*/

case 2: /* PIIX4E */
case 3: /* PIIX4M */
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/acpica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ acpi-y += \
utresrc.o \
utstate.o \
utstring.o \
utstrsuppt.o \
utstrtoul64.o \
utxface.o \
utxfinit.o \
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/achware.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ acpi_status
acpi_hw_validate_register(struct acpi_generic_address *reg,
u8 max_bit_width, u64 *address);

acpi_status acpi_hw_read(u32 *value, struct acpi_generic_address *reg);
acpi_status acpi_hw_read(u64 *value, struct acpi_generic_address *reg);

acpi_status acpi_hw_write(u32 value, struct acpi_generic_address *reg);
acpi_status acpi_hw_write(u64 value, struct acpi_generic_address *reg);

struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id);

Expand Down
6 changes: 2 additions & 4 deletions drivers/acpi/acpica/acinterp.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ typedef const struct acpi_exdump_info {
*/
acpi_status
acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
union acpi_operand_object **result_desc, u32 flags);
union acpi_operand_object **result_desc,
u32 implicit_conversion);

acpi_status
acpi_ex_convert_to_buffer(union acpi_operand_object *obj_desc,
Expand Down Expand Up @@ -424,9 +425,6 @@ acpi_ex_store_object_to_node(union acpi_operand_object *source_desc,
struct acpi_walk_state *walk_state,
u8 implicit_conversion);

#define ACPI_IMPLICIT_CONVERSION TRUE
#define ACPI_NO_IMPLICIT_CONVERSION FALSE

/*
* exstoren - resolve/store object
*/
Expand Down
33 changes: 27 additions & 6 deletions drivers/acpi/acpica/acutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ extern const char *acpi_gbl_ptyp_decode[];
#define ACPI_MSG_SUFFIX \
acpi_os_printf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, module_name, line_number)

/* Flags to indicate implicit or explicit string-to-integer conversion */

#define ACPI_IMPLICIT_CONVERSION TRUE
#define ACPI_NO_IMPLICIT_CONVERSION FALSE

/* Types for Resource descriptor entries */

#define ACPI_INVALID_RESOURCE 0
Expand Down Expand Up @@ -197,15 +202,31 @@ void acpi_ut_strlwr(char *src_string);

int acpi_ut_stricmp(char *string1, char *string2);

acpi_status acpi_ut_strtoul64(char *string, u32 flags, u64 *ret_integer);
/*
* utstrsuppt - string-to-integer conversion support functions
*/
acpi_status acpi_ut_convert_octal_string(char *string, u64 *return_value);

acpi_status acpi_ut_convert_decimal_string(char *string, u64 *return_value_ptr);

acpi_status acpi_ut_convert_hex_string(char *string, u64 *return_value_ptr);

char acpi_ut_remove_whitespace(char **string);

char acpi_ut_remove_leading_zeros(char **string);

u8 acpi_ut_detect_hex_prefix(char **string);

u8 acpi_ut_detect_octal_prefix(char **string);

/*
* Values for Flags above
* Note: LIMIT values correspond to acpi_gbl_integer_byte_width values (4/8)
* utstrtoul64 - string-to-integer conversion functions
*/
#define ACPI_STRTOUL_32BIT 0x04 /* 4 bytes */
#define ACPI_STRTOUL_64BIT 0x08 /* 8 bytes */
#define ACPI_STRTOUL_BASE16 0x10 /* Default: Base10/16 */
acpi_status acpi_ut_strtoul64(char *string, u64 *ret_integer);

u64 acpi_ut_explicit_strtoul64(char *string);

u64 acpi_ut_implicit_strtoul64(char *string);

/*
* utglobal - Global data structures and procedures
Expand Down
5 changes: 1 addition & 4 deletions drivers/acpi/acpica/dbconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,7 @@ acpi_db_convert_to_object(acpi_object_type type,
default:

object->type = ACPI_TYPE_INTEGER;
status = acpi_ut_strtoul64(string,
(acpi_gbl_integer_byte_width |
ACPI_STRTOUL_BASE16),
&object->integer.value);
status = acpi_ut_strtoul64(string, &object->integer.value);
break;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/dswexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ acpi_ds_get_predicate_value(struct acpi_walk_state *walk_state,
* object. Implicitly convert the argument if necessary.
*/
status = acpi_ex_convert_to_integer(obj_desc, &local_obj_desc,
ACPI_STRTOUL_BASE16);
ACPI_IMPLICIT_CONVERSION);
if (ACPI_FAILURE(status)) {
goto cleanup;
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/acpica/evgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
struct acpi_gpe_handler_info *gpe_handler_info;
u32 int_status = ACPI_INTERRUPT_NOT_HANDLED;
u8 enabled_status_byte;
u32 status_reg;
u32 enable_reg;
u64 status_reg;
u64 enable_reg;
acpi_cpu_flags flags;
u32 i;
u32 j;
Expand Down Expand Up @@ -472,7 +472,7 @@ u32 acpi_ev_gpe_detect(struct acpi_gpe_xrupt_info *gpe_xrupt_list)
gpe_register_info->base_gpe_number,
gpe_register_info->base_gpe_number +
(ACPI_GPE_REGISTER_WIDTH - 1),
status_reg, enable_reg,
(u32)status_reg, (u32)enable_reg,
gpe_register_info->enable_for_run,
gpe_register_info->enable_for_wake));

Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/exconcat.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ acpi_ex_do_concatenate(union acpi_operand_object *operand0,

status =
acpi_ex_convert_to_integer(local_operand1, &temp_operand1,
ACPI_STRTOUL_BASE16);
ACPI_IMPLICIT_CONVERSION);
break;

case ACPI_TYPE_BUFFER:
Expand Down
30 changes: 18 additions & 12 deletions drivers/acpi/acpica/exconvrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 max_length);
*
* FUNCTION: acpi_ex_convert_to_integer
*
* PARAMETERS: obj_desc - Object to be converted. Must be an
* Integer, Buffer, or String
* result_desc - Where the new Integer object is returned
* flags - Used for string conversion
* PARAMETERS: obj_desc - Object to be converted. Must be an
* Integer, Buffer, or String
* result_desc - Where the new Integer object is returned
* implicit_conversion - Used for string conversion
*
* RETURN: Status
*
Expand All @@ -70,14 +70,14 @@ acpi_ex_convert_to_ascii(u64 integer, u16 base, u8 *string, u8 max_length);

acpi_status
acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
union acpi_operand_object **result_desc, u32 flags)
union acpi_operand_object **result_desc,
u32 implicit_conversion)
{
union acpi_operand_object *return_desc;
u8 *pointer;
u64 result;
u32 i;
u32 count;
acpi_status status;

ACPI_FUNCTION_TRACE_PTR(ex_convert_to_integer, obj_desc);

Expand Down Expand Up @@ -123,12 +123,18 @@ acpi_ex_convert_to_integer(union acpi_operand_object *obj_desc,
* hexadecimal as per the ACPI specification. The only exception (as
* of ACPI 3.0) is that the to_integer() operator allows both decimal
* and hexadecimal strings (hex prefixed with "0x").
*
* Explicit conversion is used only by to_integer.
* All other string-to-integer conversions are implicit conversions.
*/
status = acpi_ut_strtoul64(ACPI_CAST_PTR(char, pointer),
(acpi_gbl_integer_byte_width |
flags), &result);
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
if (implicit_conversion) {
result =
acpi_ut_implicit_strtoul64(ACPI_CAST_PTR
(char, pointer));
} else {
result =
acpi_ut_explicit_strtoul64(ACPI_CAST_PTR
(char, pointer));
}
break;

Expand Down Expand Up @@ -631,7 +637,7 @@ acpi_ex_convert_to_target_type(acpi_object_type destination_type,
*/
status =
acpi_ex_convert_to_integer(source_desc, result_desc,
ACPI_STRTOUL_BASE16);
ACPI_IMPLICIT_CONVERSION);
break;

case ACPI_TYPE_STRING:
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/exmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ acpi_ex_do_logical_op(u16 opcode,
case ACPI_TYPE_INTEGER:

status = acpi_ex_convert_to_integer(operand1, &local_operand1,
ACPI_STRTOUL_BASE16);
ACPI_IMPLICIT_CONVERSION);
break;

case ACPI_TYPE_STRING:
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/exresop.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ acpi_ex_resolve_operands(u16 opcode,
* Known as "Implicit Source Operand Conversion"
*/
status = acpi_ex_convert_to_integer(obj_desc, stack_ptr,
ACPI_STRTOUL_BASE16);
ACPI_IMPLICIT_CONVERSION);
if (ACPI_FAILURE(status)) {
if (status == AE_TYPE) {
ACPI_ERROR((AE_INFO,
Expand Down
4 changes: 2 additions & 2 deletions drivers/acpi/acpica/hwgpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action)
{
struct acpi_gpe_register_info *gpe_register_info;
acpi_status status = AE_OK;
u32 enable_mask;
u64 enable_mask;
u32 register_bit;

ACPI_FUNCTION_ENTRY();
Expand Down Expand Up @@ -214,7 +214,7 @@ acpi_status
acpi_hw_get_gpe_status(struct acpi_gpe_event_info *gpe_event_info,
acpi_event_status *event_status)
{
u32 in_byte;
u64 in_byte;
u32 register_bit;
struct acpi_gpe_register_info *gpe_register_info;
acpi_event_status local_event_status = 0;
Expand Down
Loading

0 comments on commit 04ed510

Please sign in to comment.