]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge tag 'acpi-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Sep 2019 02:31:36 +0000 (19:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 18 Sep 2019 02:31:36 +0000 (19:31 -0700)
Pull ACPI updates from Rafael Wysocki:
 "These include an ACPICA update (to upstream revision 20190816),
  improvements of support for memory hot-add in the HMAT handling code
  and some assorted fixes and cleanups.

  Specifics:

   - Update the ACPICA code in the kernel to upstream revision 20190816
     including:
      * Internal limits change to support larger systems (Bob Moore).
      * Macros clean up (Bob Moore).
      * printf format string fixes (Bob Moore).
      * Full deployment of the ACPI_PRINTF_LIKE macro (Bob Moore).
      * Tools improvements (Bob Moore, Colin Ian King).
      * Windows _OSI support fixes (Jung-uk Kim).

   - Improve memory hot-add support in the ACPI HMAT handling code (Dan
     Williams, Keith Busch).

   - Fix the ACPI LPSS (Low-Power Subsystem) driver for Intel SoCs to
     save and restore private registers during system-wide suspend and
     resume on systems with the Lynxpoint PCH (Jarkko Nikula).

   - Convert the ACPI documentation related to LEDs to ReST (Sakari
     Ailus).

   - Fix assorted issues and make assorted minor improvements in the
     ACPI-related code (Al Stone, Andy Shevchenko, Jiri Slaby, Kelsey
     Skunberg, Krzysztof Wilczynski, Liguang Zhang, Wenwen Wang,
     YueHaibing)"

* tag 'acpi-5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (23 commits)
  ACPI / PCI: fix acpi_pci_irq_enable() memory leak
  ACPI: custom_method: fix memory leaks
  ACPI: thermal: Remove redundant acpi_has_method() calls
  ACPI / CPPC: do not require the _PSD method
  ACPI: SBS: remove unused const variable 'SMBUS_PEC'
  ACPI / LPSS: Save/restore LPSS private registers also on Lynxpoint
  ACPI/PCI: Remove surplus parentheses from a return statement
  ACPICA: Update version to 20190816.
  ACPICA: Add "Windows 2019" string to _OSI support.
  ACPICA: Differentiate Windows 8.1 from Windows 8.
  ACPICA: Fully deploy ACPI_PRINTF_LIKE macro
  ACPICA: iASL,acpi_dump: Improve y/n query
  ACPICA: Fix issues with arg types within printf format strings
  ACPICA: Macros: remove pointer math on a null pointer
  ACPICA: Increase total number of possible Owner IDs
  ACPICA: Debugger: remove redundant assignment on obj_desc
  Documentation: ACPI: DSD: Convert LED documentation to ReST
  ACPI / APEI: Release resources if gen_pool_add() fails
  HMAT: Skip publishing target info for nodes with no online memory
  HMAT: Register attributes for memory hot add
  ...

36 files changed:
Documentation/firmware-guide/acpi/dsd/leds.rst [moved from Documentation/acpi/dsd/leds.txt with 90% similarity]
Documentation/firmware-guide/acpi/index.rst
drivers/acpi/acpi_lpss.c
drivers/acpi/acpi_processor.c
drivers/acpi/acpica/aclocal.h
drivers/acpi/acpica/acobject.h
drivers/acpi/acpica/acstruct.h
drivers/acpi/acpica/acutils.h
drivers/acpi/acpica/dbhistry.c
drivers/acpi/acpica/dbinput.c
drivers/acpi/acpica/dbmethod.c
drivers/acpi/acpica/dbobject.c
drivers/acpi/acpica/dbstats.c
drivers/acpi/acpica/exdump.c
drivers/acpi/acpica/nsaccess.c
drivers/acpi/acpica/nsalloc.c
drivers/acpi/acpica/nsdump.c
drivers/acpi/acpica/nsrepair2.c
drivers/acpi/acpica/tbdata.c
drivers/acpi/acpica/utdebug.c
drivers/acpi/acpica/uterror.c
drivers/acpi/acpica/utosi.c
drivers/acpi/acpica/utownerid.c
drivers/acpi/apei/ghes.c
drivers/acpi/cppc_acpi.c
drivers/acpi/custom_method.c
drivers/acpi/hmat/hmat.c
drivers/acpi/pci_irq.c
drivers/acpi/pci_link.c
drivers/acpi/sbshc.h
drivers/acpi/thermal.c
include/acpi/acconfig.h
include/acpi/acpiosxf.h
include/acpi/acpixf.h
include/acpi/actypes.h
tools/power/acpi/tools/acpidump/apfiles.c

similarity index 90%
rename from Documentation/acpi/dsd/leds.txt
rename to Documentation/firmware-guide/acpi/dsd/leds.rst
index cc58b1a574c55a5d751c58aafae4edff1fe07809..946efe2b2936a5a4121627fb37a09e07c5ce1fd4 100644 (file)
@@ -1,4 +1,9 @@
+.. SPDX-License-Identifier: GPL-2.0
+.. include:: <isonum.txt>
+
+========================================
 Describing and referring to LEDs in ACPI
+========================================
 
 Individual LEDs are described by hierarchical data extension [6] nodes under the
 device node, the LED driver chip. The "reg" property in the LED specific nodes
@@ -25,8 +30,12 @@ entry shall contain the string "led@" followed by the number of the LED,
 followed by the referred object name. That object shall be named "LED" followed
 by the number of the LED.
 
-An ASL example of a camera sensor device and a LED driver device for two LEDs.
-Objects not relevant for LEDs or the references to them have been omitted.
+Example
+=======
+
+An ASL example of a camera sensor device and a LED driver device for two LEDs is
+show below. Objects not relevant for LEDs or the references to them have been
+omitted. ::
 
        Device (LED)
        {
@@ -71,12 +80,15 @@ Objects not relevant for LEDs or the references to them have been omitted.
        }
 
 where
+::
 
        LED     LED driver device
        LED0    First LED
        LED1    Second LED
-       SEN     Camera sensor device (or another device the LED is
-               related to)
+       SEN     Camera sensor device (or another device the LED is related to)
+
+References
+==========
 
 [1] Device tree. <URL:http://www.devicetree.org>, referenced 2019-02-21.
 
index 90c90d42d9ad6284dbf0a2126d5025cc31d1c491..ad3b5afdae77e869ca8d685c4de1ed2f80ee67b0 100644 (file)
@@ -10,6 +10,7 @@ ACPI Support
    namespace
    dsd/graph
    dsd/data-node-references
+   dsd/leds
    enumeration
    osi
    method-customizing
index d696f165a50e6e815deef12dcc0b19d31fd22494..60bbc5090abec0a626d88dda38c3729b41cc2446 100644 (file)
@@ -219,12 +219,13 @@ static void bsw_pwm_setup(struct lpss_private_data *pdata)
 }
 
 static const struct lpss_device_desc lpt_dev_desc = {
-       .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
+       .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
+                       | LPSS_SAVE_CTX,
        .prv_offset = 0x800,
 };
 
 static const struct lpss_device_desc lpt_i2c_dev_desc = {
-       .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR,
+       .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_LTR | LPSS_SAVE_CTX,
        .prv_offset = 0x800,
 };
 
@@ -236,7 +237,8 @@ static struct property_entry uart_properties[] = {
 };
 
 static const struct lpss_device_desc lpt_uart_dev_desc = {
-       .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR,
+       .flags = LPSS_CLK | LPSS_CLK_GATE | LPSS_CLK_DIVIDER | LPSS_LTR
+                       | LPSS_SAVE_CTX,
        .clk_con_id = "baudclk",
        .prv_offset = 0x800,
        .setup = lpss_uart_setup,
index 24f065114d4240160301a22999a91dc37dca046f..2c4dda0787e849af8034710760393e2b0684e5cd 100644 (file)
@@ -279,9 +279,13 @@ static int acpi_processor_get_info(struct acpi_device *device)
        }
 
        if (acpi_duplicate_processor_id(pr->acpi_id)) {
-               dev_err(&device->dev,
-                       "Failed to get unique processor _UID (0x%x)\n",
-                       pr->acpi_id);
+               if (pr->acpi_id == 0xff)
+                       dev_info_once(&device->dev,
+                               "Entry not well-defined, consider updating BIOS\n");
+               else
+                       dev_err(&device->dev,
+                               "Failed to get unique processor _UID (0x%x)\n",
+                               pr->acpi_id);
                return -ENODEV;
        }
 
index 13d513b81589207a4c9909e9577438310f4c5040..1ea52576f0a2e490c58cba27108b3eae5f9a8679 100644 (file)
@@ -134,12 +134,12 @@ struct acpi_namespace_node {
        union acpi_operand_object *object;      /* Interpreter object */
        u8 descriptor_type;     /* Differentiate object descriptor types */
        u8 type;                /* ACPI Type associated with this name */
-       u8 flags;               /* Miscellaneous flags */
-       acpi_owner_id owner_id; /* Node creator */
+       u16 flags;              /* Miscellaneous flags */
        union acpi_name_union name;     /* ACPI Name, always 4 chars per ACPI spec */
        struct acpi_namespace_node *parent;     /* Parent node */
        struct acpi_namespace_node *child;      /* First child */
        struct acpi_namespace_node *peer;       /* First peer */
+       acpi_owner_id owner_id; /* Node creator */
 
        /*
         * The following fields are used by the ASL compiler and disassembler only
index b2ef703d7df8b63361b7a00c8e2ddbd497aeadca..8def0e3d690fdaa69bb58fc78c59229df0412e52 100644 (file)
@@ -153,8 +153,8 @@ struct acpi_object_method {
        } dispatch;
 
        u32 aml_length;
-       u8 thread_count;
        acpi_owner_id owner_id;
+       u8 thread_count;
 };
 
 /* Flags for info_flags field above */
index 8a4e6b4aaf2c3761ee92adac825c1b0248781fcf..218ff4c8b81715a28da6693de901d8144e40e9d4 100644 (file)
@@ -167,9 +167,9 @@ struct acpi_evaluate_info {
        u32 return_flags;       /* Used for return value analysis */
        u32 return_btype;       /* Bitmapped type of the returned object */
        u16 param_count;        /* Count of the input argument list */
+       u16 node_flags;         /* Same as Node->Flags */
        u8 pass_number;         /* Parser pass number */
        u8 return_object_type;  /* Object type of the returned object */
-       u8 node_flags;          /* Same as Node->Flags */
        u8 flags;               /* General flags */
 };
 
index 9022537567e9d2cd184d36ae01003c8608d203cc..601808be86d18e7a73ad4d731dd0eae164aefc8a 100644 (file)
@@ -686,22 +686,26 @@ void acpi_ut_delete_address_lists(void);
 /*
  * utxferror - various error/warning output functions
  */
+ACPI_PRINTF_LIKE(5)
 void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_predefined_warning(const char *module_name,
                           u32 line_number,
                           char *pathname,
-                          u8 node_flags, const char *format, ...);
+                          u16 node_flags, const char *format, ...);
 
+ACPI_PRINTF_LIKE(5)
 void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_predefined_info(const char *module_name,
                        u32 line_number,
-                       char *pathname, u8 node_flags, const char *format, ...);
+                       char *pathname,
+                       u16 node_flags, const char *format, ...);
 
+ACPI_PRINTF_LIKE(5)
 void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_predefined_bios_error(const char *module_name,
                              u32 line_number,
                              char *pathname,
-                             u8 node_flags, const char *format, ...);
+                             u16 node_flags, const char *format, ...);
 
 void
 acpi_ut_prefixed_namespace_error(const char *module_name,
index 7809bd94a18ddc075e406334afe5ce6ab50d49c5..47d2e50598491964561c302b455c99b19481f8cb 100644 (file)
@@ -121,7 +121,7 @@ void acpi_db_display_history(void)
 
        for (i = 0; i < acpi_gbl_num_history; i++) {
                if (acpi_gbl_history_buffer[history_index].command) {
-                       acpi_os_printf("%3ld %s\n",
+                       acpi_os_printf("%3u %s\n",
                                       acpi_gbl_history_buffer[history_index].
                                       cmd_num,
                                       acpi_gbl_history_buffer[history_index].
index 3e5f95390f0dd8a179c7e23751cf30a1d960e958..55a7e10998d87ed44f5716ab0fdc2d1b6538afe0 100644 (file)
@@ -593,7 +593,7 @@ static u32 acpi_db_get_line(char *input_buffer)
             input_buffer)) {
                acpi_os_printf
                    ("Buffer overflow while parsing input line (max %u characters)\n",
-                    sizeof(acpi_gbl_db_parsed_buf));
+                    (u32)sizeof(acpi_gbl_db_parsed_buf));
                return (0);
        }
 
@@ -853,24 +853,24 @@ acpi_db_command_dispatch(char *input_buffer,
 
                if (param_count == 0) {
                        acpi_os_printf
-                           ("Current debug level for file output is:    %8.8lX\n",
+                           ("Current debug level for file output is:    %8.8X\n",
                             acpi_gbl_db_debug_level);
                        acpi_os_printf
-                           ("Current debug level for console output is: %8.8lX\n",
+                           ("Current debug level for console output is: %8.8X\n",
                             acpi_gbl_db_console_debug_level);
                } else if (param_count == 2) {
                        temp = acpi_gbl_db_console_debug_level;
                        acpi_gbl_db_console_debug_level =
                            strtoul(acpi_gbl_db_args[1], NULL, 16);
                        acpi_os_printf
-                           ("Debug Level for console output was %8.8lX, now %8.8lX\n",
+                           ("Debug Level for console output was %8.8X, now %8.8X\n",
                             temp, acpi_gbl_db_console_debug_level);
                } else {
                        temp = acpi_gbl_db_debug_level;
                        acpi_gbl_db_debug_level =
                            strtoul(acpi_gbl_db_args[1], NULL, 16);
                        acpi_os_printf
-                           ("Debug Level for file output was %8.8lX, now %8.8lX\n",
+                           ("Debug Level for file output was %8.8X, now %8.8X\n",
                             temp, acpi_gbl_db_debug_level);
                }
                break;
index d8b7a0fe92ecd07bca1547ac26f58ea2a5e5e28e..76a15b6ffc5d3688ae5ee2b6a63b0e58178867e6 100644 (file)
@@ -302,6 +302,10 @@ acpi_status acpi_db_disassemble_method(char *name)
        }
 
        status = acpi_ut_allocate_owner_id(&obj_desc->method.owner_id);
+       if (ACPI_FAILURE(status)) {
+               return (status);
+       }
+
        walk_state->owner_id = obj_desc->method.owner_id;
 
        /* Push start scope on scope stack and make it current */
index d220168dca01a4fadf7df7380ccedc6a9a8cd41f..f9fc84bc3e84f8d0f078e58140b33541922a19fa 100644 (file)
@@ -394,7 +394,6 @@ void acpi_db_decode_locals(struct acpi_walk_state *walk_state)
        u8 display_locals = FALSE;
 
        node = walk_state->method_node;
-       obj_desc = walk_state->method_desc;
 
        /* There are no locals for the module-level code case */
 
index bf620937c79b9c28f4ab5e43b2c13ed033256e88..3af88e70238c5c4fb5a505167ee718443e2ed4ed 100644 (file)
@@ -341,17 +341,17 @@ acpi_status acpi_db_display_statistics(char *type_arg)
                               "ACPI_TYPE", "NODES", "OBJECTS");
 
                for (i = 0; i < ACPI_TYPE_NS_NODE_MAX; i++) {
-                       acpi_os_printf("%16.16s % 10ld% 10ld\n",
+                       acpi_os_printf("%16.16s %10u %10u\n",
                                       acpi_ut_get_type_name(i),
                                       acpi_gbl_node_type_count[i],
                                       acpi_gbl_obj_type_count[i]);
                }
 
-               acpi_os_printf("%16.16s % 10ld% 10ld\n", "Misc/Unknown",
+               acpi_os_printf("%16.16s %10u %10u\n", "Misc/Unknown",
                               acpi_gbl_node_type_count_misc,
                               acpi_gbl_obj_type_count_misc);
 
-               acpi_os_printf("%16.16s % 10ld% 10ld\n", "TOTALS:",
+               acpi_os_printf("%16.16s %10u %10u\n", "TOTALS:",
                               acpi_gbl_num_nodes, acpi_gbl_num_objects);
                break;
 
@@ -379,16 +379,14 @@ acpi_status acpi_db_display_statistics(char *type_arg)
        case CMD_STAT_MISC:
 
                acpi_os_printf("\nMiscellaneous Statistics:\n\n");
-               acpi_os_printf("Calls to AcpiPsFind:.. ........% 7ld\n",
+               acpi_os_printf("%-28s:     %7u\n", "Calls to AcpiPsFind",
                               acpi_gbl_ps_find_count);
-               acpi_os_printf("Calls to AcpiNsLookup:..........% 7ld\n",
+               acpi_os_printf("%-28s:     %7u\n", "Calls to AcpiNsLookup",
                               acpi_gbl_ns_lookup_count);
 
-               acpi_os_printf("\n");
-
-               acpi_os_printf("Mutex usage:\n\n");
+               acpi_os_printf("\nMutex usage:\n\n");
                for (i = 0; i < ACPI_NUM_MUTEX; i++) {
-                       acpi_os_printf("%-28s:     % 7ld\n",
+                       acpi_os_printf("%-28s:     %7u\n",
                                       acpi_ut_get_mutex_name(i),
                                       acpi_gbl_mutex_info[i].use_count);
                }
@@ -399,87 +397,87 @@ acpi_status acpi_db_display_statistics(char *type_arg)
                acpi_os_printf("\nInternal object sizes:\n\n");
 
                acpi_os_printf("Common         %3d\n",
-                              sizeof(struct acpi_object_common));
+                              (u32)sizeof(struct acpi_object_common));
                acpi_os_printf("Number         %3d\n",
-                              sizeof(struct acpi_object_integer));
+                              (u32)sizeof(struct acpi_object_integer));
                acpi_os_printf("String         %3d\n",
-                              sizeof(struct acpi_object_string));
+                              (u32)sizeof(struct acpi_object_string));
                acpi_os_printf("Buffer         %3d\n",
-                              sizeof(struct acpi_object_buffer));
+                              (u32)sizeof(struct acpi_object_buffer));
                acpi_os_printf("Package        %3d\n",
-                              sizeof(struct acpi_object_package));
+                              (u32)sizeof(struct acpi_object_package));
                acpi_os_printf("BufferField    %3d\n",
-                              sizeof(struct acpi_object_buffer_field));
+                              (u32)sizeof(struct acpi_object_buffer_field));
                acpi_os_printf("Device         %3d\n",
-                              sizeof(struct acpi_object_device));
+                              (u32)sizeof(struct acpi_object_device));
                acpi_os_printf("Event          %3d\n",
-                              sizeof(struct acpi_object_event));
+                              (u32)sizeof(struct acpi_object_event));
                acpi_os_printf("Method         %3d\n",
-                              sizeof(struct acpi_object_method));
+                              (u32)sizeof(struct acpi_object_method));
                acpi_os_printf("Mutex          %3d\n",
-                              sizeof(struct acpi_object_mutex));
+                              (u32)sizeof(struct acpi_object_mutex));
                acpi_os_printf("Region         %3d\n",
-                              sizeof(struct acpi_object_region));
+                              (u32)sizeof(struct acpi_object_region));
                acpi_os_printf("PowerResource  %3d\n",
-                              sizeof(struct acpi_object_power_resource));
+                              (u32)sizeof(struct acpi_object_power_resource));
                acpi_os_printf("Processor      %3d\n",
-                              sizeof(struct acpi_object_processor));
+                              (u32)sizeof(struct acpi_object_processor));
                acpi_os_printf("ThermalZone    %3d\n",
-                              sizeof(struct acpi_object_thermal_zone));
+                              (u32)sizeof(struct acpi_object_thermal_zone));
                acpi_os_printf("RegionField    %3d\n",
-                              sizeof(struct acpi_object_region_field));
+                              (u32)sizeof(struct acpi_object_region_field));
                acpi_os_printf("BankField      %3d\n",
-                              sizeof(struct acpi_object_bank_field));
+                              (u32)sizeof(struct acpi_object_bank_field));
                acpi_os_printf("IndexField     %3d\n",
-                              sizeof(struct acpi_object_index_field));
+                              (u32)sizeof(struct acpi_object_index_field));
                acpi_os_printf("Reference      %3d\n",
-                              sizeof(struct acpi_object_reference));
+                              (u32)sizeof(struct acpi_object_reference));
                acpi_os_printf("Notify         %3d\n",
-                              sizeof(struct acpi_object_notify_handler));
+                              (u32)sizeof(struct acpi_object_notify_handler));
                acpi_os_printf("AddressSpace   %3d\n",
-                              sizeof(struct acpi_object_addr_handler));
+                              (u32)sizeof(struct acpi_object_addr_handler));
                acpi_os_printf("Extra          %3d\n",
-                              sizeof(struct acpi_object_extra));
+                              (u32)sizeof(struct acpi_object_extra));
                acpi_os_printf("Data           %3d\n",
-                              sizeof(struct acpi_object_data));
+                              (u32)sizeof(struct acpi_object_data));
 
                acpi_os_printf("\n");
 
                acpi_os_printf("ParseObject    %3d\n",
-                              sizeof(struct acpi_parse_obj_common));
+                              (u32)sizeof(struct acpi_parse_obj_common));
                acpi_os_printf("ParseObjectNamed %3d\n",
-                              sizeof(struct acpi_parse_obj_named));
+                              (u32)sizeof(struct acpi_parse_obj_named));
                acpi_os_printf("ParseObjectAsl %3d\n",
-                              sizeof(struct acpi_parse_obj_asl));
+                              (u32)sizeof(struct acpi_parse_obj_asl));
                acpi_os_printf("OperandObject  %3d\n",
-                              sizeof(union acpi_operand_object));
+                              (u32)sizeof(union acpi_operand_object));
                acpi_os_printf("NamespaceNode  %3d\n",
-                              sizeof(struct acpi_namespace_node));
+                              (u32)sizeof(struct acpi_namespace_node));
                acpi_os_printf("AcpiObject     %3d\n",
-                              sizeof(union acpi_object));
+                              (u32)sizeof(union acpi_object));
 
                acpi_os_printf("\n");
 
                acpi_os_printf("Generic State  %3d\n",
-                              sizeof(union acpi_generic_state));
+                              (u32)sizeof(union acpi_generic_state));
                acpi_os_printf("Common State   %3d\n",
-                              sizeof(struct acpi_common_state));
+                              (u32)sizeof(struct acpi_common_state));
                acpi_os_printf("Control State  %3d\n",
-                              sizeof(struct acpi_control_state));
+                              (u32)sizeof(struct acpi_control_state));
                acpi_os_printf("Update State   %3d\n",
-                              sizeof(struct acpi_update_state));
+                              (u32)sizeof(struct acpi_update_state));
                acpi_os_printf("Scope State    %3d\n",
-                              sizeof(struct acpi_scope_state));
+                              (u32)sizeof(struct acpi_scope_state));
                acpi_os_printf("Parse Scope    %3d\n",
-                              sizeof(struct acpi_pscope_state));
+                              (u32)sizeof(struct acpi_pscope_state));
                acpi_os_printf("Package State  %3d\n",
-                              sizeof(struct acpi_pkg_state));
+                              (u32)sizeof(struct acpi_pkg_state));
                acpi_os_printf("Thread State   %3d\n",
-                              sizeof(struct acpi_thread_state));
+                              (u32)sizeof(struct acpi_thread_state));
                acpi_os_printf("Result Values  %3d\n",
-                              sizeof(struct acpi_result_values));
+                              (u32)sizeof(struct acpi_result_values));
                acpi_os_printf("Notify Info    %3d\n",
-                              sizeof(struct acpi_notify_info));
+                              (u32)sizeof(struct acpi_notify_info));
                break;
 
        case CMD_STAT_STACK:
index 6526b2deeaada44251d6869f07ae45791650fc6e..a9bc938a3b55743803241e8d0fe15c26ed177e95 100644 (file)
@@ -94,7 +94,7 @@ static struct acpi_exdump_info acpi_ex_dump_method[9] = {
         "Parameter Count"},
        {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.sync_level), "Sync Level"},
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.mutex), "Mutex"},
-       {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"},
+       {ACPI_EXD_UINT16, ACPI_EXD_OFFSET(method.owner_id), "Owner Id"},
        {ACPI_EXD_UINT8, ACPI_EXD_OFFSET(method.thread_count), "Thread Count"},
        {ACPI_EXD_UINT32, ACPI_EXD_OFFSET(method.aml_length), "Aml Length"},
        {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(method.aml_start), "Aml Start"}
@@ -269,8 +269,8 @@ static struct acpi_exdump_info acpi_ex_dump_field_common[7] = {
 
 static struct acpi_exdump_info acpi_ex_dump_node[7] = {
        {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_node), NULL},
-       {ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(flags), "Flags"},
-       {ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(owner_id), "Owner Id"},
+       {ACPI_EXD_UINT16, ACPI_EXD_NSOFFSET(flags), "Flags"},
+       {ACPI_EXD_UINT16, ACPI_EXD_NSOFFSET(owner_id), "Owner Id"},
        {ACPI_EXD_LIST, ACPI_EXD_NSOFFSET(object), "Object List"},
        {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET(parent), "Parent"},
        {ACPI_EXD_NODE, ACPI_EXD_NSOFFSET(child), "Child"},
index 2566e2d4c78031b4194ada252878b0b88194d1e4..3f045b5953b2e85ac7c2345fc568f57418c234b2 100644 (file)
@@ -598,7 +598,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
                                if (flags & ACPI_NS_PREFIX_MUST_EXIST) {
                                        acpi_os_printf(ACPI_MSG_BIOS_ERROR
                                                       "Object does not exist: %4.4s\n",
-                                                      &simple_name);
+                                                      (char *)&simple_name);
                                }
 #endif
                                /* Name not found in ACPI namespace */
index 6eb63db72249b0291be099310163841f2b59340e..fe9b3639a87dcbf10bc7b622417ff464d64108e6 100644 (file)
@@ -241,7 +241,7 @@ void acpi_ns_install_node(struct acpi_walk_state *walk_state, struct acpi_namesp
        node->type = (u8) type;
 
        ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
-                         "%4.4s (%s) [Node %p Owner %X] added to %4.4s (%s) [Node %p]\n",
+                         "%4.4s (%s) [Node %p Owner %3.3X] added to %4.4s (%s) [Node %p]\n",
                          acpi_ut_get_node_name(node),
                          acpi_ut_get_type_name(node->type), node, owner_id,
                          acpi_ut_get_node_name(parent_node),
index 1b12c172e115150e267d312413b4b7bdc6ce8ebe..9731d7cf1b83c1face62588ffce214a1a32986bc 100644 (file)
@@ -197,7 +197,7 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
 
        /* Now we can print out the pertinent information */
 
-       acpi_os_printf(" %-12s %p %2.2X ",
+       acpi_os_printf(" %-12s %p %3.3X ",
                       acpi_ut_get_type_name(type), this_node,
                       this_node->owner_id);
 
index 8d776256b21318827de8de97eb365ad1dc35df3d..663d85e0adba92fd2cd6f77f7608a9c01dca6bd6 100644 (file)
@@ -126,7 +126,7 @@ static const struct acpi_repair_info acpi_ns_repairable_names[] = {
 
 #define ACPI_FDE_FIELD_COUNT        5
 #define ACPI_FDE_BYTE_BUFFER_SIZE   5
-#define ACPI_FDE_DWORD_BUFFER_SIZE  (ACPI_FDE_FIELD_COUNT * sizeof (u32))
+#define ACPI_FDE_DWORD_BUFFER_SIZE  (ACPI_FDE_FIELD_COUNT * (u32) sizeof (u32))
 
 /******************************************************************************
  *
index 91a4b984f224c71ced026462db951b08c2e478f1..309440010ab2adc8dab4e27856aee74ef39f6e84 100644 (file)
@@ -750,6 +750,7 @@ acpi_status acpi_tb_delete_namespace_by_owner(u32 table_index)
        if (ACPI_FAILURE(status)) {
                return_ACPI_STATUS(status);
        }
+
        acpi_ns_delete_namespace_by_owner(owner_id);
        acpi_ut_release_write_lock(&acpi_gbl_namespace_rw_lock);
        return_ACPI_STATUS(status);
index 01b1b36c8a8e2ac5798a633b2da1cd53d283e9d3..5b169b5f0f1a3a098c2061f788bb1718364619c7 100644 (file)
@@ -158,7 +158,7 @@ acpi_debug_print(u32 requested_debug_level,
         * Display the module name, current line number, thread ID (if requested),
         * current procedure nesting level, and the current procedure name
         */
-       acpi_os_printf("%9s-%04ld ", module_name, line_number);
+       acpi_os_printf("%9s-%04d ", module_name, line_number);
 
 #ifdef ACPI_APPLICATION
        /*
@@ -177,7 +177,7 @@ acpi_debug_print(u32 requested_debug_level,
                fill_count = 0;
        }
 
-       acpi_os_printf("[%02ld] %*s",
+       acpi_os_printf("[%02d] %*s",
                       acpi_gbl_nesting_level, acpi_gbl_nesting_level + 1, " ");
        acpi_os_printf("%s%*s: ",
                       acpi_ut_trim_function_name(function_name), fill_count,
index 075457341bad19bd8c7a4b2a251533e536dda003..918aca7c4db41d62e0ba9285647b4dd9600b03ef 100644 (file)
@@ -39,7 +39,7 @@ void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_predefined_warning(const char *module_name,
                           u32 line_number,
                           char *pathname,
-                          u8 node_flags, const char *format, ...)
+                          u16 node_flags, const char *format, ...)
 {
        va_list arg_list;
 
@@ -81,7 +81,7 @@ acpi_ut_predefined_warning(const char *module_name,
 void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_predefined_info(const char *module_name,
                        u32 line_number,
-                       char *pathname, u8 node_flags, const char *format, ...)
+                       char *pathname, u16 node_flags, const char *format, ...)
 {
        va_list arg_list;
 
@@ -124,7 +124,7 @@ void ACPI_INTERNAL_VAR_XFACE
 acpi_ut_predefined_bios_error(const char *module_name,
                              u32 line_number,
                              char *pathname,
-                             u8 node_flags, const char *format, ...)
+                             u16 node_flags, const char *format, ...)
 {
        va_list arg_list;
 
index 688c61a90725a51635f6cd8998ade2c48736205e..ad2b218039d0f9eee89225e014dbe921afac601d 100644 (file)
@@ -65,13 +65,14 @@ static struct acpi_interface_info acpi_default_supported_interfaces[] = {
        {"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 */
-       {"Windows 2013", NULL, 0, ACPI_OSI_WIN_8},      /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */
+       {"Windows 2013", NULL, 0, ACPI_OSI_WIN_8_1},    /* Windows 8.1 and Server 2012 R2 - Added 01/2014 */
        {"Windows 2015", NULL, 0, ACPI_OSI_WIN_10},     /* Windows 10 - Added 03/2015 */
        {"Windows 2016", NULL, 0, ACPI_OSI_WIN_10_RS1}, /* Windows 10 version 1607 - Added 12/2017 */
        {"Windows 2017", NULL, 0, ACPI_OSI_WIN_10_RS2}, /* Windows 10 version 1703 - Added 12/2017 */
        {"Windows 2017.2", NULL, 0, ACPI_OSI_WIN_10_RS3},       /* Windows 10 version 1709 - Added 02/2018 */
        {"Windows 2018", NULL, 0, ACPI_OSI_WIN_10_RS4}, /* Windows 10 version 1803 - Added 11/2018 */
        {"Windows 2018.2", NULL, 0, ACPI_OSI_WIN_10_RS5},       /* Windows 10 version 1809 - Added 11/2018 */
+       {"Windows 2019", NULL, 0, ACPI_OSI_WIN_10_19H1},        /* Windows 10 version 1903 - Added 08/2019 */
 
        /* Feature Group Strings */
 
index 5eb8b76ce9d8db9a912d293b65c3ce3751ed72d4..d3525ef8ed28550eb05d0a45e90d3790612626b0 100644 (file)
@@ -38,7 +38,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id *owner_id)
 
        if (*owner_id) {
                ACPI_ERROR((AE_INFO,
-                           "Owner ID [0x%2.2X] already exists", *owner_id));
+                           "Owner ID [0x%3.3X] already exists", *owner_id));
                return_ACPI_STATUS(AE_ALREADY_EXISTS);
        }
 
@@ -88,14 +88,14 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id *owner_id)
                                /*
                                 * Construct encoded ID from the index and bit position
                                 *
-                                * Note: Last [j].k (bit 255) is never used and is marked
+                                * Note: Last [j].k (bit 4095) is never used and is marked
                                 * permanently allocated (prevents +1 overflow)
                                 */
                                *owner_id =
                                    (acpi_owner_id)((k + 1) + ACPI_MUL_32(j));
 
                                ACPI_DEBUG_PRINT((ACPI_DB_VALUES,
-                                                 "Allocated OwnerId: %2.2X\n",
+                                                 "Allocated OwnerId: 0x%3.3X\n",
                                                  (unsigned int)*owner_id));
                                goto exit;
                        }
@@ -116,7 +116,7 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id *owner_id)
         */
        status = AE_OWNER_ID_LIMIT;
        ACPI_ERROR((AE_INFO,
-                   "Could not allocate new OwnerId (255 max), AE_OWNER_ID_LIMIT"));
+                   "Could not allocate new OwnerId (4095 max), AE_OWNER_ID_LIMIT"));
 
 exit:
        (void)acpi_ut_release_mutex(ACPI_MTX_CACHES);
@@ -153,7 +153,7 @@ void acpi_ut_release_owner_id(acpi_owner_id *owner_id_ptr)
        /* Zero is not a valid owner_ID */
 
        if (owner_id == 0) {
-               ACPI_ERROR((AE_INFO, "Invalid OwnerId: 0x%2.2X", owner_id));
+               ACPI_ERROR((AE_INFO, "Invalid OwnerId: 0x%3.3X", owner_id));
                return_VOID;
        }
 
@@ -179,7 +179,7 @@ void acpi_ut_release_owner_id(acpi_owner_id *owner_id_ptr)
                acpi_gbl_owner_id_mask[index] ^= bit;
        } else {
                ACPI_ERROR((AE_INFO,
-                           "Release of non-allocated OwnerId: 0x%2.2X",
+                           "Attempted release of non-allocated OwnerId: 0x%3.3X",
                            owner_id + 1));
        }
 
index a66e00fe31fec16774bbb795c50427183c137e27..777f6f7122b404a3bbdbd2712e023e1fc6fb2f0a 100644 (file)
@@ -153,6 +153,7 @@ static void ghes_unmap(void __iomem *vaddr, enum fixed_addresses fixmap_idx)
 int ghes_estatus_pool_init(int num_ghes)
 {
        unsigned long addr, len;
+       int rc;
 
        ghes_estatus_pool = gen_pool_create(GHES_ESTATUS_POOL_MIN_ALLOC_ORDER, -1);
        if (!ghes_estatus_pool)
@@ -164,7 +165,7 @@ int ghes_estatus_pool_init(int num_ghes)
        ghes_estatus_pool_size_request = PAGE_ALIGN(len);
        addr = (unsigned long)vmalloc(PAGE_ALIGN(len));
        if (!addr)
-               return -ENOMEM;
+               goto err_pool_alloc;
 
        /*
         * New allocation must be visible in all pgd before it can be found by
@@ -172,7 +173,19 @@ int ghes_estatus_pool_init(int num_ghes)
         */
        vmalloc_sync_all();
 
-       return gen_pool_add(ghes_estatus_pool, addr, PAGE_ALIGN(len), -1);
+       rc = gen_pool_add(ghes_estatus_pool, addr, PAGE_ALIGN(len), -1);
+       if (rc)
+               goto err_pool_add;
+
+       return 0;
+
+err_pool_add:
+       vfree((void *)addr);
+
+err_pool_alloc:
+       gen_pool_destroy(ghes_estatus_pool);
+
+       return -ENOMEM;
 }
 
 static int map_gen_v2(struct ghes *ghes)
@@ -483,7 +496,7 @@ static void ghes_do_proc(struct ghes *ghes,
        int sev, sec_sev;
        struct acpi_hest_generic_data *gdata;
        guid_t *sec_type;
-       guid_t *fru_id = &NULL_UUID_LE;
+       const guid_t *fru_id = &guid_null;
        char *fru_text = "";
 
        sev = ghes_severity(estatus->error_severity);
index 15f103d7532b09d83ec9df1475bfba0a0dd7fe76..3b2525908dd8cfaed9074d7926d2036102e77f34 100644 (file)
@@ -365,8 +365,10 @@ static int acpi_get_psd(struct cpc_desc *cpc_ptr, acpi_handle handle)
        union acpi_object  *psd = NULL;
        struct acpi_psd_package *pdomain;
 
-       status = acpi_evaluate_object_typed(handle, "_PSD", NULL, &buffer,
-                       ACPI_TYPE_PACKAGE);
+       status = acpi_evaluate_object_typed(handle, "_PSD", NULL,
+                                           &buffer, ACPI_TYPE_PACKAGE);
+       if (status == AE_NOT_FOUND)     /* _PSD is optional */
+               return 0;
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
index b2ef4c2ec955d5c737a69aac1cde444dcd351caf..fd66a736621cff9627b7c6bec47e2079f48de684 100644 (file)
@@ -49,8 +49,10 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
        if ((*ppos > max_size) ||
            (*ppos + count > max_size) ||
            (*ppos + count < count) ||
-           (count > uncopied_bytes))
+           (count > uncopied_bytes)) {
+               kfree(buf);
                return -EINVAL;
+       }
 
        if (copy_from_user(buf + (*ppos), user_buf, count)) {
                kfree(buf);
@@ -70,6 +72,7 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf,
                add_taint(TAINT_OVERRIDDEN_ACPI_TABLE, LOCKDEP_NOW_UNRELIABLE);
        }
 
+       kfree(buf);
        return count;
 }
 
index 96b7d39a97c65db544a7e8ec32159f57c595d673..8f9a28a870b0c5a4315c683abe7a67b0da28a664 100644 (file)
 #include <linux/init.h>
 #include <linux/list.h>
 #include <linux/list_sort.h>
+#include <linux/memory.h>
+#include <linux/mutex.h>
 #include <linux/node.h>
 #include <linux/sysfs.h>
 
-static __initdata u8 hmat_revision;
+static u8 hmat_revision;
 
-static __initdata LIST_HEAD(targets);
-static __initdata LIST_HEAD(initiators);
-static __initdata LIST_HEAD(localities);
+static LIST_HEAD(targets);
+static LIST_HEAD(initiators);
+static LIST_HEAD(localities);
+
+static DEFINE_MUTEX(target_lock);
 
 /*
  * The defined enum order is used to prioritize attributes to break ties when
@@ -36,11 +40,19 @@ enum locality_types {
 
 static struct memory_locality *localities_types[4];
 
+struct target_cache {
+       struct list_head node;
+       struct node_cache_attrs cache_attrs;
+};
+
 struct memory_target {
        struct list_head node;
        unsigned int memory_pxm;
        unsigned int processor_pxm;
        struct node_hmem_attrs hmem_attrs;
+       struct list_head caches;
+       struct node_cache_attrs cache_attrs;
+       bool registered;
 };
 
 struct memory_initiator {
@@ -53,7 +65,7 @@ struct memory_locality {
        struct acpi_hmat_locality *hmat_loc;
 };
 
-static __init struct memory_initiator *find_mem_initiator(unsigned int cpu_pxm)
+static struct memory_initiator *find_mem_initiator(unsigned int cpu_pxm)
 {
        struct memory_initiator *initiator;
 
@@ -63,7 +75,7 @@ static __init struct memory_initiator *find_mem_initiator(unsigned int cpu_pxm)
        return NULL;
 }
 
-static __init struct memory_target *find_mem_target(unsigned int mem_pxm)
+static struct memory_target *find_mem_target(unsigned int mem_pxm)
 {
        struct memory_target *target;
 
@@ -96,9 +108,6 @@ static __init void alloc_memory_target(unsigned int mem_pxm)
 {
        struct memory_target *target;
 
-       if (pxm_to_node(mem_pxm) == NUMA_NO_NODE)
-               return;
-
        target = find_mem_target(mem_pxm);
        if (target)
                return;
@@ -110,6 +119,7 @@ static __init void alloc_memory_target(unsigned int mem_pxm)
        target->memory_pxm = mem_pxm;
        target->processor_pxm = PXM_INVAL;
        list_add_tail(&target->node, &targets);
+       INIT_LIST_HEAD(&target->caches);
 }
 
 static __init const char *hmat_data_type(u8 type)
@@ -148,7 +158,7 @@ static __init const char *hmat_data_type_suffix(u8 type)
        }
 }
 
-static __init u32 hmat_normalize(u16 entry, u64 base, u8 type)
+static u32 hmat_normalize(u16 entry, u64 base, u8 type)
 {
        u32 value;
 
@@ -183,7 +193,7 @@ static __init u32 hmat_normalize(u16 entry, u64 base, u8 type)
        return value;
 }
 
-static __init void hmat_update_target_access(struct memory_target *target,
+static void hmat_update_target_access(struct memory_target *target,
                                             u8 type, u32 value)
 {
        switch (type) {
@@ -314,7 +324,8 @@ static __init int hmat_parse_cache(union acpi_subtable_headers *header,
                                   const unsigned long end)
 {
        struct acpi_hmat_cache *cache = (void *)header;
-       struct node_cache_attrs cache_attrs;
+       struct memory_target *target;
+       struct target_cache *tcache;
        u32 attrs;
 
        if (cache->header.length < sizeof(*cache)) {
@@ -328,37 +339,47 @@ static __init int hmat_parse_cache(union acpi_subtable_headers *header,
                cache->memory_PD, cache->cache_size, attrs,
                cache->number_of_SMBIOShandles);
 
-       cache_attrs.size = cache->cache_size;
-       cache_attrs.level = (attrs & ACPI_HMAT_CACHE_LEVEL) >> 4;
-       cache_attrs.line_size = (attrs & ACPI_HMAT_CACHE_LINE_SIZE) >> 16;
+       target = find_mem_target(cache->memory_PD);
+       if (!target)
+               return 0;
+
+       tcache = kzalloc(sizeof(*tcache), GFP_KERNEL);
+       if (!tcache) {
+               pr_notice_once("Failed to allocate HMAT cache info\n");
+               return 0;
+       }
+
+       tcache->cache_attrs.size = cache->cache_size;
+       tcache->cache_attrs.level = (attrs & ACPI_HMAT_CACHE_LEVEL) >> 4;
+       tcache->cache_attrs.line_size = (attrs & ACPI_HMAT_CACHE_LINE_SIZE) >> 16;
 
        switch ((attrs & ACPI_HMAT_CACHE_ASSOCIATIVITY) >> 8) {
        case ACPI_HMAT_CA_DIRECT_MAPPED:
-               cache_attrs.indexing = NODE_CACHE_DIRECT_MAP;
+               tcache->cache_attrs.indexing = NODE_CACHE_DIRECT_MAP;
                break;
        case ACPI_HMAT_CA_COMPLEX_CACHE_INDEXING:
-               cache_attrs.indexing = NODE_CACHE_INDEXED;
+               tcache->cache_attrs.indexing = NODE_CACHE_INDEXED;
                break;
        case ACPI_HMAT_CA_NONE:
        default:
-               cache_attrs.indexing = NODE_CACHE_OTHER;
+               tcache->cache_attrs.indexing = NODE_CACHE_OTHER;
                break;
        }
 
        switch ((attrs & ACPI_HMAT_WRITE_POLICY) >> 12) {
        case ACPI_HMAT_CP_WB:
-               cache_attrs.write_policy = NODE_CACHE_WRITE_BACK;
+               tcache->cache_attrs.write_policy = NODE_CACHE_WRITE_BACK;
                break;
        case ACPI_HMAT_CP_WT:
-               cache_attrs.write_policy = NODE_CACHE_WRITE_THROUGH;
+               tcache->cache_attrs.write_policy = NODE_CACHE_WRITE_THROUGH;
                break;
        case ACPI_HMAT_CP_NONE:
        default:
-               cache_attrs.write_policy = NODE_CACHE_WRITE_OTHER;
+               tcache->cache_attrs.write_policy = NODE_CACHE_WRITE_OTHER;
                break;
        }
+       list_add_tail(&tcache->node, &target->caches);
 
-       node_add_cache(pxm_to_node(cache->memory_PD), &cache_attrs);
        return 0;
 }
 
@@ -435,7 +456,7 @@ static __init int srat_parse_mem_affinity(union acpi_subtable_headers *header,
        return 0;
 }
 
-static __init u32 hmat_initiator_perf(struct memory_target *target,
+static u32 hmat_initiator_perf(struct memory_target *target,
                               struct memory_initiator *initiator,
                               struct acpi_hmat_locality *hmat_loc)
 {
@@ -473,7 +494,7 @@ static __init u32 hmat_initiator_perf(struct memory_target *target,
                              hmat_loc->data_type);
 }
 
-static __init bool hmat_update_best(u8 type, u32 value, u32 *best)
+static bool hmat_update_best(u8 type, u32 value, u32 *best)
 {
        bool updated = false;
 
@@ -517,7 +538,7 @@ static int initiator_cmp(void *priv, struct list_head *a, struct list_head *b)
        return ia->processor_pxm - ib->processor_pxm;
 }
 
-static __init void hmat_register_target_initiators(struct memory_target *target)
+static void hmat_register_target_initiators(struct memory_target *target)
 {
        static DECLARE_BITMAP(p_nodes, MAX_NUMNODES);
        struct memory_initiator *initiator;
@@ -577,29 +598,89 @@ static __init void hmat_register_target_initiators(struct memory_target *target)
        }
 }
 
-static __init void hmat_register_target_perf(struct memory_target *target)
+static void hmat_register_target_cache(struct memory_target *target)
+{
+       unsigned mem_nid = pxm_to_node(target->memory_pxm);
+       struct target_cache *tcache;
+
+       list_for_each_entry(tcache, &target->caches, node)
+               node_add_cache(mem_nid, &tcache->cache_attrs);
+}
+
+static void hmat_register_target_perf(struct memory_target *target)
 {
        unsigned mem_nid = pxm_to_node(target->memory_pxm);
        node_set_perf_attrs(mem_nid, &target->hmem_attrs, 0);
 }
 
-static __init void hmat_register_targets(void)
+static void hmat_register_target(struct memory_target *target)
 {
-       struct memory_target *target;
+       int nid = pxm_to_node(target->memory_pxm);
 
-       list_for_each_entry(target, &targets, node) {
+       /*
+        * Skip offline nodes. This can happen when memory
+        * marked EFI_MEMORY_SP, "specific purpose", is applied
+        * to all the memory in a promixity domain leading to
+        * the node being marked offline / unplugged, or if
+        * memory-only "hotplug" node is offline.
+        */
+       if (nid == NUMA_NO_NODE || !node_online(nid))
+               return;
+
+       mutex_lock(&target_lock);
+       if (!target->registered) {
                hmat_register_target_initiators(target);
+               hmat_register_target_cache(target);
                hmat_register_target_perf(target);
+               target->registered = true;
        }
+       mutex_unlock(&target_lock);
+}
+
+static void hmat_register_targets(void)
+{
+       struct memory_target *target;
+
+       list_for_each_entry(target, &targets, node)
+               hmat_register_target(target);
+}
+
+static int hmat_callback(struct notifier_block *self,
+                        unsigned long action, void *arg)
+{
+       struct memory_target *target;
+       struct memory_notify *mnb = arg;
+       int pxm, nid = mnb->status_change_nid;
+
+       if (nid == NUMA_NO_NODE || action != MEM_ONLINE)
+               return NOTIFY_OK;
+
+       pxm = node_to_pxm(nid);
+       target = find_mem_target(pxm);
+       if (!target)
+               return NOTIFY_OK;
+
+       hmat_register_target(target);
+       return NOTIFY_OK;
 }
 
+static struct notifier_block hmat_callback_nb = {
+       .notifier_call = hmat_callback,
+       .priority = 2,
+};
+
 static __init void hmat_free_structures(void)
 {
        struct memory_target *target, *tnext;
        struct memory_locality *loc, *lnext;
        struct memory_initiator *initiator, *inext;
+       struct target_cache *tcache, *cnext;
 
        list_for_each_entry_safe(target, tnext, &targets, node) {
+               list_for_each_entry_safe(tcache, cnext, &target->caches, node) {
+                       list_del(&tcache->node);
+                       kfree(tcache);
+               }
                list_del(&target->node);
                kfree(target);
        }
@@ -658,6 +739,10 @@ static __init int hmat_init(void)
                }
        }
        hmat_register_targets();
+
+       /* Keep the table and structures if the notifier may use them */
+       if (!register_hotmemory_notifier(&hmat_callback_nb))
+               return 0;
 out_put:
        hmat_free_structures();
        acpi_put_table(tbl);
index d2549ae65e1b6f049c0c68199010f0d652433c70..dea8a60e18a4c00929cb6f7c759615f075bcfe12 100644 (file)
@@ -449,8 +449,10 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
                 * No IRQ known to the ACPI subsystem - maybe the BIOS /
                 * driver reported one, then use it. Exit in any case.
                 */
-               if (!acpi_pci_irq_valid(dev, pin))
+               if (!acpi_pci_irq_valid(dev, pin)) {
+                       kfree(entry);
                        return 0;
+               }
 
                if (acpi_isa_register_gsi(dev))
                        dev_warn(&dev->dev, "PCI INT %c: no GSI\n",
index db11f7771ef1b9ed401c99fb047c275bd8f7079f..00a6da2121be30bd08de4bcbe2f9a6e9a12c4488 100644 (file)
@@ -661,7 +661,7 @@ int acpi_pci_link_allocate_irq(acpi_handle handle, int index, int *triggering,
        ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                          "Link %s is referenced\n",
                          acpi_device_bid(link->device)));
-       return (link->irq.active);
+       return link->irq.active;
 }
 
 /*
@@ -712,7 +712,7 @@ int acpi_pci_link_free_irq(acpi_handle handle)
                acpi_evaluate_object(link->device->handle, "_DIS", NULL, NULL);
 
        mutex_unlock(&acpi_link_lock);
-       return (link->irq.active);
+       return link->irq.active;
 }
 
 /* --------------------------------------------------------------------------
index 06372a37df10f1da6e345f73020bbae53aa68c5d..c3522bb8279246861da743b7841492ef8b578d8c 100644 (file)
@@ -15,8 +15,6 @@ enum acpi_smb_protocol {
        SMBUS_BLOCK_PROCESS_CALL = 0xd,
 };
 
-static const u8 SMBUS_PEC = 0x80;
-
 enum acpi_sbs_device_addr {
        ACPI_SBS_CHARGER = 0x9,
        ACPI_SBS_MANAGER = 0xa,
index 00f12a86ecbd42fc5ca401bef64b2a03d8249c7f..d831a61e0010eaf69dd16c96f0983315cf0a0972 100644 (file)
@@ -225,13 +225,9 @@ static int acpi_thermal_set_cooling_mode(struct acpi_thermal *tz, int mode)
        if (!tz)
                return -EINVAL;
 
-       if (!acpi_has_method(tz->device->handle, "_SCP")) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "_SCP not present\n"));
+       if (ACPI_FAILURE(acpi_execute_simple_method(tz->device->handle,
+                                                   "_SCP", mode)))
                return -ENODEV;
-       } else if (ACPI_FAILURE(acpi_execute_simple_method(tz->device->handle,
-                                                          "_SCP", mode))) {
-               return -ENODEV;
-       }
 
        return 0;
 }
@@ -463,8 +459,7 @@ static int acpi_thermal_trips_update(struct acpi_thermal *tz, int flag)
                        break;
        }
 
-       if ((flag & ACPI_TRIPS_DEVICES)
-           && acpi_has_method(tz->device->handle, "_TZD")) {
+       if (flag & ACPI_TRIPS_DEVICES) {
                memset(&devices, 0, sizeof(devices));
                status = acpi_evaluate_reference(tz->device->handle, "_TZD",
                                                NULL, &devices);
index 16a83959e616f114001f19870047787d2bb2eac4..42d573172e5396babc64bc0663e31562befa1c22 100644 (file)
@@ -95,9 +95,9 @@
 
 #define ACPI_DEFAULT_PAGE_SIZE          4096   /* Must be power of 2 */
 
-/* owner_id tracking. 8 entries allows for 255 owner_ids */
+/* owner_id tracking. 128 entries allows for 4095 owner_ids */
 
-#define ACPI_NUM_OWNERID_MASKS          8
+#define ACPI_NUM_OWNERID_MASKS          128
 
 /* Size of the root table array is increased by this increment */
 
index 1b59fb61f67d503725fb40d78763173ded00e412..2e63b7b390f5a77ed39901ad11f8b084565d7603 100644 (file)
@@ -330,6 +330,7 @@ acpi_status acpi_os_enter_sleep(u8 sleep_state, u32 rega_value, u32 regb_value);
  * Debug print routines
  */
 #ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_printf
+ACPI_PRINTF_LIKE(1)
 void ACPI_INTERNAL_VAR_XFACE acpi_os_printf(const char *format, ...);
 #endif
 
index 4ed603a3b4487af284036db2a404af948998867d..e5e0414135818dd6bad81942153523c4b16d0319 100644 (file)
@@ -12,7 +12,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20190703
+#define ACPI_CA_VERSION                 0x20190816
 
 #include <acpi/acconfig.h>
 #include <acpi/actypes.h>
index ad6892a24015ee7fea303b163bc1d7f80e01dac9..2f3f28c7cea369a99c6ecab1847cc6feba129d5c 100644 (file)
@@ -442,8 +442,8 @@ typedef void *acpi_handle;  /* Actually a ptr to a NS Node */
 
 /* Owner IDs are used to track namespace nodes for selective deletion */
 
-typedef u8 acpi_owner_id;
-#define ACPI_OWNER_ID_MAX               0xFF
+typedef u16 acpi_owner_id;
+#define ACPI_OWNER_ID_MAX               0xFFF  /* 4095 possible owner IDs */
 
 #define ACPI_INTEGER_BIT_SIZE           64
 #define ACPI_MAX_DECIMAL_DIGITS         20     /* 2^64 = 18,446,744,073,709,551,616 */
@@ -506,7 +506,7 @@ typedef u64 acpi_integer;
 
 /* Pointer/Integer type conversions */
 
-#define ACPI_TO_POINTER(i)              ACPI_ADD_PTR (void, (void *) 0, (acpi_size) (i))
+#define ACPI_TO_POINTER(i)              ACPI_CAST_PTR (void, (acpi_size) (i))
 #define ACPI_TO_INTEGER(p)              ACPI_PTR_DIFF (p, (void *) 0)
 #define ACPI_OFFSET(d, f)               ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) 0)
 #define ACPI_PHYSADDR_TO_PTR(i)         ACPI_TO_POINTER(i)
@@ -1265,12 +1265,14 @@ typedef enum {
 #define ACPI_OSI_WIN_VISTA_SP2          0x0A
 #define ACPI_OSI_WIN_7                  0x0B
 #define ACPI_OSI_WIN_8                  0x0C
-#define ACPI_OSI_WIN_10                 0x0D
-#define ACPI_OSI_WIN_10_RS1             0x0E
-#define ACPI_OSI_WIN_10_RS2             0x0F
-#define ACPI_OSI_WIN_10_RS3             0x10
-#define ACPI_OSI_WIN_10_RS4             0x11
-#define ACPI_OSI_WIN_10_RS5             0x12
+#define ACPI_OSI_WIN_8_1                0x0D
+#define ACPI_OSI_WIN_10                 0x0E
+#define ACPI_OSI_WIN_10_RS1             0x0F
+#define ACPI_OSI_WIN_10_RS2             0x10
+#define ACPI_OSI_WIN_10_RS3             0x11
+#define ACPI_OSI_WIN_10_RS4             0x12
+#define ACPI_OSI_WIN_10_RS5             0x13
+#define ACPI_OSI_WIN_10_19H1            0x14
 
 /* Definitions of getopt */
 
index a42cfcaa32938fb2923a84bbe59c09aac5c1526f..16d919bd133b6824f80d533a8f4c490b199023f5 100644 (file)
@@ -29,18 +29,24 @@ static int ap_is_existing_file(char *pathname)
 {
 #if !defined(_GNU_EFI) && !defined(_EDK2_EFI)
        struct stat stat_info;
+       int in_char;
 
        if (!stat(pathname, &stat_info)) {
                fprintf(stderr,
                        "Target path already exists, overwrite? [y|n] ");
 
-               if (getchar() != 'y') {
+               in_char = fgetc(stdin);
+               if (in_char == '\n') {
+                       in_char = fgetc(stdin);
+               }
+
+               if (in_char != 'y' && in_char != 'Y') {
                        return (-1);
                }
        }
 #endif
 
-       return 0;
+       return (0);
 }
 
 /******************************************************************************