Commit d8f9176b authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'acpi-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull ACPI updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to the most recent upstream
  revision including (but not limited to) new material introduced in the
  6.4 version of the spec, update message printing in the ACPI-related
  code, address a few issues and clean up code in a number of places.

  Specifics:

   - Update ACPICA code in the kernel to upstream revision 20210331
     including the following changes:

      * Add parsing for IVRS IVHD 40h and device entry F0h (Alexander
        Monakov).

      * Add new CEDT table for CXL 2.0 and iASL support for it (Ben
        Widawsky, Bob Moore).

      * NFIT: add Location Cookie field (Bob Moore).

      * HMAT: add new fields/flags (Bob Moore).

      * Add new flags in SRAT (Bob Moore).

      * PMTT: add new fields/structures (Bob Moore).

      * Add CSI2Bus resource template (Bob Moore).

      * iASL: Decode subtable type field for VIOT (Bob Moore).

      * Fix various typos and spelling mistakes (Colin Ian King).

      * Add new predefined objects _BPC, _BPS, and _BPT (Erik Kaneda).

      * Add USB4 capabilities UUID (Erik Kaneda).

      * Add CXL ACPI device ID and _CBR object (Erik Kaneda).

      * MADT: add Multiprocessor Wakeup Structure (Erik Kaneda).

      * PCCT: add support for subtable type 5 (Erik Kaneda).

      * PPTT: add new version of subtable type 1 (Erik Kaneda).

      * Add SDEV secure access components (Erik Kaneda).

      * Add support for PHAT table (Erik Kaneda).

      * iASL: Add definitions for the VIOT table (Jean-Philippe
        Brucker).

      * acpisrc: Add missing conversion for VIOT support (Jean-Philippe
        Brucker).

      * IORT: Updates for revision E.b (Shameer Kolothum).

   - Rearrange message printing in ACPI-related code to avoid using the
     ACPICA's internal message printing macros outside ACPICA and do
     some related code cleanups (Rafael Wysocki).

   - Modify the device enumeration code to turn off all of the unused
     ACPI power resources at the end (Rafael Wysocki).

   - Change the ACPI power resources handling code to turn off unused
     ACPI power resources without checking their status which should not
     be necessary by the spec (Rafael Wysocki).

   - Add empty stubs for CPPC-related functions to be used when
     CONFIG_ACPI_CPPC_LIB is not set (Rafael Wysocki).

   - Simplify device enumeration code (Rafael Wysocki).

   - Change device enumeration code to use match_string() for string
     matching (Andy Shevchenko).

   - Modify irqresource_disabled() to retain the resouce flags that have
     been set already (Angela Czubak).

   - Add native backlight whitelist entry for GA401/GA502/GA503 (Luke
     Jones).

   - Modify the ACPI backlight driver to let the native backlight
     handling take over on hardware-reduced systems (Hans de Goede).

   - Introduce acpi_dev_get() and switch over the ACPI core code to
     using it (Andy Shevchenko).

   - Use kobj_attribute as callback argument instead of a local struct
     type in the CPPC linrary code (Nathan Chancellor).

   - Drop unneeded initializatio of a static variable from the ACPI
     processor driver (Tian Tao).

   - Drop unnecessary local variable assignment from the ACPI APEI code
     (Colin Ian King).

   - Document for_each_acpi_dev_match() macro (Andy Shevchenko).

   - Address assorted coding style issues in multiple places (Xiaofei
     Tan).

   - Capitalize TLAs in a few comments (Andy Shevchenko).

   - Correct assorted typos in comments (Tom Saeger)"

* tag 'acpi-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (68 commits)
  ACPI: video: use native backlight for GA401/GA502/GA503
  ACPI: APEI: remove redundant assignment to variable rc
  ACPI: utils: Capitalize abbreviations in the comments
  ACPI: utils: Document for_each_acpi_dev_match() macro
  ACPI: bus: Introduce acpi_dev_get() and reuse it in ACPI code
  ACPI: scan: Utilize match_string() API
  resource: Prevent irqresource_disabled() from erasing flags
  ACPI: CPPC: Replace cppc_attr with kobj_attribute
  ACPI: scan: Call acpi_get_object_info() from acpi_set_pnp_ids()
  ACPI: scan: Drop sta argument from acpi_init_device_object()
  ACPI: scan: Drop sta argument from acpi_add_single_object()
  ACPI: scan: Rearrange checks in acpi_bus_check_add()
  ACPI: scan: Fold acpi_bus_type_and_status() into its caller
  ACPI: video: Check LCD flag on ACPI-reduced-hardware devices
  ACPI: utils: Add acpi_reduced_hardware() helper
  ACPI: dock: fix some coding style issues
  ACPI: sysfs: fix some coding style issues
  ACPI: PM: add a missed blank line after declarations
  ACPI: custom_method: fix a coding style issue
  ACPI: CPPC: fix some coding style issues
  ...
parents 47080f22 b6237f61
......@@ -50,7 +50,7 @@
CONFIG_ACPI_DEBUG must be enabled to produce any ACPI
debug output. Bits in debug_layer correspond to a
_COMPONENT in an ACPI source file, e.g.,
#define _COMPONENT ACPI_PCI_COMPONENT
#define _COMPONENT ACPI_EVENTS
Bits in debug_level correspond to a level in
ACPI_DEBUG_PRINT statements, e.g.,
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ...
......@@ -60,8 +60,6 @@
Enable processor driver info messages:
acpi.debug_layer=0x20000000
Enable PCI/PCI interrupt routing info messages:
acpi.debug_layer=0x400000
Enable AML "Debug" output, i.e., stores to the Debug
object while interpreting AML:
acpi.debug_layer=0xffffffff acpi.debug_level=0x2
......
.. SPDX-License-Identifier: GPL-2.0
=================
ACPI Debug Output
=================
====================
ACPI CA Debug Output
====================
The ACPI CA, the Linux ACPI core, and some ACPI drivers can generate debug
output. This document describes how to use this facility.
The ACPI CA can generate debug output. This document describes how to use this
facility.
Compile-time configuration
==========================
ACPI debug output is globally enabled by CONFIG_ACPI_DEBUG. If this config
option is turned off, the debug messages are not even built into the
kernel.
The ACPI CA debug output is globally enabled by CONFIG_ACPI_DEBUG. If this
config option is not set, the debug messages are not even built into the kernel.
Boot- and run-time configuration
================================
......@@ -27,16 +26,16 @@ debug_layer (component)
=======================
The "debug_layer" is a mask that selects components of interest, e.g., a
specific driver or part of the ACPI interpreter. To build the debug_layer
bitmask, look for the "#define _COMPONENT" in an ACPI source file.
specific part of the ACPI interpreter. To build the debug_layer bitmask, look
for the "#define _COMPONENT" in an ACPI source file.
You can set the debug_layer mask at boot-time using the acpi.debug_layer
command line argument, and you can change it after boot by writing values
to /sys/module/acpi/parameters/debug_layer.
The possible components are defined in include/acpi/acoutput.h and
include/acpi/acpi_drivers.h. Reading /sys/module/acpi/parameters/debug_layer
shows the supported mask values, currently these::
The possible components are defined in include/acpi/acoutput.h.
Reading /sys/module/acpi/parameters/debug_layer shows the supported mask values::
ACPI_UTILITIES 0x00000001
ACPI_HARDWARE 0x00000002
......@@ -52,13 +51,6 @@ shows the supported mask values, currently these::
ACPI_CA_DISASSEMBLER 0x00000800
ACPI_COMPILER 0x00001000
ACPI_TOOLS 0x00002000
ACPI_SBS_COMPONENT 0x00100000
ACPI_FAN_COMPONENT 0x00200000
ACPI_PCI_COMPONENT 0x00400000
ACPI_CONTAINER_COMPONENT 0x01000000
ACPI_SYSTEM_COMPONENT 0x02000000
ACPI_MEMORY_DEVICE_COMPONENT 0x08000000
ACPI_PROCESSOR_COMPONENT 0x20000000
debug_level
===========
......@@ -127,10 +119,6 @@ AML) during boot::
acpi.debug_layer=0xffffffff acpi.debug_level=0x2
Enable PCI and PCI interrupt routing debug messages::
acpi.debug_layer=0x400000 acpi.debug_level=0x4
Enable all ACPI hardware-related messages::
acpi.debug_layer=0x2 acpi.debug_level=0xffffffff
......
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* acpi_ac.c - ACPI AC Adapter Driver ($Revision: 27 $)
* acpi_ac.c - ACPI AC Adapter Driver (Revision: 27)
*
* Copyright (C) 2001, 2002 Andy Grover <andrew.grover@intel.com>
* Copyright (C) 2001, 2002 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
......@@ -78,17 +78,14 @@ static struct acpi_driver acpi_ac_driver = {
struct acpi_ac {
struct power_supply *charger;
struct power_supply_desc charger_desc;
struct acpi_device * device;
struct acpi_device *device;
unsigned long long state;
struct notifier_block battery_nb;
};
#define to_acpi_ac(x) power_supply_get_drvdata(x)
/* --------------------------------------------------------------------------
AC Adapter Management
-------------------------------------------------------------------------- */
/* AC Adapter Management */
static int acpi_ac_get_state(struct acpi_ac *ac)
{
acpi_status status = AE_OK;
......@@ -109,9 +106,7 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
return 0;
}
/* --------------------------------------------------------------------------
sysfs I/F
-------------------------------------------------------------------------- */
/* sysfs I/F */
static int get_ac_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
......@@ -138,10 +133,7 @@ static enum power_supply_property ac_props[] = {
POWER_SUPPLY_PROP_ONLINE,
};
/* --------------------------------------------------------------------------
Driver Model
-------------------------------------------------------------------------- */
/* Driver Model */
static void acpi_ac_notify(struct acpi_device *device, u32 event)
{
struct acpi_ac *ac = acpi_driver_data(device);
......@@ -174,8 +166,6 @@ static void acpi_ac_notify(struct acpi_device *device, u32 event)
acpi_notifier_call_chain(device, event, (u32) ac->state);
kobject_uevent(&ac->charger->dev.kobj, KOBJ_CHANGE);
}
return;
}
static int acpi_ac_battery_notify(struct notifier_block *nb,
......@@ -187,7 +177,7 @@ static int acpi_ac_battery_notify(struct notifier_block *nb,
/*
* On HP Pavilion dv6-6179er AC status notifications aren't triggered
* when adapter is plugged/unplugged. However, battery status
* notifcations are triggered when battery starts charging or
* notifications are triggered when battery starts charging or
* discharging. Re-reading AC status triggers lost AC notifications,
* if AC status has changed.
*/
......@@ -282,9 +272,8 @@ static int acpi_ac_add(struct acpi_device *device)
ac->battery_nb.notifier_call = acpi_ac_battery_notify;
register_acpi_notifier(&ac->battery_nb);
end:
if (result) {
if (result)
kfree(ac);
}
return result;
}
......@@ -293,7 +282,7 @@ static int acpi_ac_add(struct acpi_device *device)
static int acpi_ac_resume(struct device *dev)
{
struct acpi_ac *ac;
unsigned old_state;
unsigned int old_state;
if (!dev)
return -EINVAL;
......@@ -352,9 +341,8 @@ static int __init acpi_ac_init(void)
}
result = acpi_bus_register_driver(&acpi_ac_driver);
if (result < 0) {
if (result < 0)
return -ENODEV;
}
return 0;
}
......
......@@ -176,10 +176,10 @@ static const struct apd_device_desc hip08_spi_desc = {
#endif
/**
* Create platform device during acpi scan attach handle.
* Return value > 0 on success of creating device.
*/
/*
* Create platform device during acpi scan attach handle.
* Return value > 0 on success of creating device.
*/
static int acpi_apd_create_device(struct acpi_device *adev,
const struct acpi_device_id *id)
{
......
......@@ -478,7 +478,6 @@ static void ipmi_register_bmc(int iface, struct device *dev)
ipmi_dev_release(ipmi_device);
err_ref:
put_device(smi_data.dev);
return;
}
static void ipmi_bmc_gone(int iface)
......
......@@ -377,6 +377,7 @@ static const struct acpi_device_id acpi_lpss_device_ids[] = {
static int is_memory(struct acpi_resource *res, void *not_used)
{
struct resource r;
return !acpi_dev_resource_memory(res, &r);
}
......@@ -1200,6 +1201,7 @@ static int acpi_lpss_poweroff_noirq(struct device *dev)
if (pdata->dev_desc->resume_from_noirq) {
/* This is analogous to the acpi_lpss_suspend_noirq() case. */
int ret = acpi_lpss_do_poweroff_late(dev);
if (ret)
return ret;
}
......
......@@ -128,6 +128,7 @@ static void round_robin_cpu(unsigned int tsk_index)
static void exit_round_robin(unsigned int tsk_index)
{
struct cpumask *pad_busy_cpus = to_cpumask(pad_busy_cpus_bits);
cpumask_clear_cpu(tsk_in_cpu[tsk_index], pad_busy_cpus);
tsk_in_cpu[tsk_index] = -1;
}
......@@ -265,6 +266,7 @@ static ssize_t rrtime_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
unsigned long num;
if (kstrtoul(buf, 0, &num))
return -EINVAL;
if (num < 1 || num >= 100)
......@@ -286,6 +288,7 @@ static ssize_t idlepct_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
unsigned long num;
if (kstrtoul(buf, 0, &num))
return -EINVAL;
if (num < 1 || num >= 100)
......@@ -307,6 +310,7 @@ static ssize_t idlecpus_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
unsigned long num;
if (kstrtoul(buf, 0, &num))
return -EINVAL;
mutex_lock(&isolated_cpus_lock);
......
......@@ -22,17 +22,10 @@
#include "internal.h"
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor");
DEFINE_PER_CPU(struct acpi_processor *, processors);
EXPORT_PER_CPU_SYMBOL(processors);
/* --------------------------------------------------------------------------
Errata Handling
-------------------------------------------------------------------------- */
/* Errata Handling */
struct acpi_processor_errata errata __read_mostly;
EXPORT_SYMBOL_GPL(errata);
......@@ -51,19 +44,19 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
switch (dev->revision) {
case 0:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 A-step\n"));
dev_dbg(&dev->dev, "Found PIIX4 A-step\n");
break;
case 1:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 B-step\n"));
dev_dbg(&dev->dev, "Found PIIX4 B-step\n");
break;
case 2:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4E\n"));
dev_dbg(&dev->dev, "Found PIIX4E\n");
break;
case 3:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4M\n"));
dev_dbg(&dev->dev, "Found PIIX4M\n");
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found unknown PIIX4\n"));
dev_dbg(&dev->dev, "Found unknown PIIX4\n");
break;
}
......@@ -129,11 +122,9 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev)
}
if (errata.piix4.bmisx)
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Bus master activity detection (BM-IDE) erratum enabled\n"));
dev_dbg(&dev->dev, "Bus master activity detection (BM-IDE) erratum enabled\n");
if (errata.piix4.fdma)
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Type-F DMA livelock erratum (C3 disabled)\n"));
dev_dbg(&dev->dev, "Type-F DMA livelock erratum (C3 disabled)\n");
return 0;
}
......@@ -157,10 +148,7 @@ static int acpi_processor_errata(void)
return result;
}
/* --------------------------------------------------------------------------
Initialization
-------------------------------------------------------------------------- */
/* Initialization */
#ifdef CONFIG_ACPI_HOTPLUG_CPU
int __weak acpi_map_cpu(acpi_handle handle,
phys_cpuid_t physid, u32 acpi_id, int *pcpu)
......@@ -244,11 +232,9 @@ static int acpi_processor_get_info(struct acpi_device *device)
*/
if (acpi_gbl_FADT.pm2_control_block && acpi_gbl_FADT.pm2_control_length) {
pr->flags.bm_control = 1;
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Bus mastering arbitration control present\n"));
dev_dbg(&device->dev, "Bus mastering arbitration control present\n");
} else
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"No bus mastering arbitration control\n"));
dev_dbg(&device->dev, "No bus mastering arbitration control\n");
if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) {
/* Declared with "Processor" statement; match ProcessorID */
......@@ -291,7 +277,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
pr->phys_id = acpi_get_phys_id(pr->handle, device_declaration,
pr->acpi_id);
if (invalid_phys_cpuid(pr->phys_id))
acpi_handle_debug(pr->handle, "failed to get CPU physical ID.\n");
dev_dbg(&device->dev, "Failed to get CPU physical ID.\n");
pr->id = acpi_map_cpuid(pr->phys_id, pr->acpi_id);
if (!cpu0_initialized && !acpi_has_cpu_in_madt()) {
......@@ -314,6 +300,7 @@ static int acpi_processor_get_info(struct acpi_device *device)
*/
if (invalid_logical_cpuid(pr->id) || !cpu_present(pr->id)) {
int ret = acpi_processor_hotadd_init(pr);
if (ret)
return ret;
}
......@@ -328,11 +315,10 @@ static int acpi_processor_get_info(struct acpi_device *device)
* CPU+CPU ID.
*/
sprintf(acpi_device_bid(device), "CPU%X", pr->id);
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Processor [%d:%d]\n", pr->id,
pr->acpi_id));
dev_dbg(&device->dev, "Processor [%d:%d]\n", pr->id, pr->acpi_id);
if (!object.processor.pblk_address)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n"));
dev_dbg(&device->dev, "No PBLK (NULL address)\n");
else if (object.processor.pblk_length != 6)
dev_err(&device->dev, "Invalid PBLK length [%d]\n",
object.processor.pblk_length);
......@@ -440,10 +426,7 @@ static int acpi_processor_add(struct acpi_device *device,
}
#ifdef CONFIG_ACPI_HOTPLUG_CPU
/* --------------------------------------------------------------------------
Removal
-------------------------------------------------------------------------- */
/* Removal */
static void acpi_processor_remove(struct acpi_device *device)
{
struct acpi_processor *pr;
......@@ -901,7 +884,7 @@ int acpi_processor_evaluate_cst(acpi_handle handle, u32 cpu,
info->count = last_index;
end:
end:
kfree(buffer.pointer);
return ret;
......
......@@ -1392,7 +1392,7 @@ acpi_video_get_next_level(struct acpi_video_device *device,
break;
}
}
/* Ajust level_current to closest available level */
/* Adjust level_current to closest available level */
level_current += delta;
for (i = ACPI_VIDEO_FIRST_LEVEL; i < device->brightness->count; i++) {
l = device->brightness->levels[i];
......@@ -1555,7 +1555,7 @@ acpi_video_bus_get_devices(struct acpi_video_bus *video,
/*
* Win8 requires setting bit2 of _DOS to let firmware know it shouldn't
* preform any automatic brightness change on receiving a notification.
* perform any automatic brightness change on receiving a notification.
*/
static int acpi_video_bus_start_devices(struct acpi_video_bus *video)
{
......@@ -2182,6 +2182,30 @@ static bool dmi_is_desktop(void)
return false;
}
/*
* We're seeing a lot of bogus backlight interfaces on newer machines
* without a LCD such as desktops, servers and HDMI sticks. Checking the
* lcd flag fixes this, enable this by default on any machines which are:
* 1. Win8 ready (where we also prefer the native backlight driver, so
* normally the acpi_video code should not register there anyways); *and*
* 2.1 Report a desktop/server DMI chassis-type, or
* 2.2 Are an ACPI-reduced-hardware platform (and thus won't use the EC for
backlight control)
*/
static bool should_check_lcd_flag(void)
{
if (!acpi_osi_is_win8())
return false;
if (dmi_is_desktop())
return true;
if (acpi_reduced_hardware())
return true;
return false;
}
int acpi_video_register(void)
{
int ret = 0;
......@@ -2195,19 +2219,8 @@ int acpi_video_register(void)
goto leave;
}
/*
* We're seeing a lot of bogus backlight interfaces on newer machines
* without a LCD such as desktops, servers and HDMI sticks. Checking
* the lcd flag fixes this, so enable this on any machines which are
* win8 ready (where we also prefer the native backlight driver, so
* normally the acpi_video code should not register there anyways).
*/
if (only_lcd == -1) {
if (dmi_is_desktop() && acpi_osi_is_win8())
only_lcd = true;
else
only_lcd = false;
}
if (only_lcd == -1)
only_lcd = should_check_lcd_flag();
dmi_check_system(video_dmi_table);
......
......@@ -328,6 +328,17 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
{{"_BMS", METHOD_1ARGS(ACPI_TYPE_INTEGER),
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
{{"_BPC", METHOD_0ARGS,
METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */
PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4, 0, 0, 0),
{{"_BPS", METHOD_0ARGS,
METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (5 Int) */
PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 5, 0, 0, 0),
{{"_BPT", METHOD_1ARGS(ACPI_TYPE_PACKAGE),
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
{{"_BQC", METHOD_0ARGS,
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}},
......@@ -347,6 +358,10 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = {
{{"_CBA", METHOD_0ARGS,
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */
{{"_CBR", METHOD_0ARGS,
METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (3 Int) */
PACKAGE_INFO(ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 3, 0, 0, 0),
{{"_CCA", METHOD_0ARGS,
METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* ACPI 5.1 */
......
......@@ -46,6 +46,7 @@ typedef enum {
ACPI_RSC_1BITFLAG,
ACPI_RSC_2BITFLAG,
ACPI_RSC_3BITFLAG,
ACPI_RSC_6BITFLAG,
ACPI_RSC_ADDRESS,
ACPI_RSC_BITMASK,
ACPI_RSC_BITMASK16,
......@@ -102,6 +103,7 @@ typedef enum {
ACPI_RSD_1BITFLAG,
ACPI_RSD_2BITFLAG,
ACPI_RSD_3BITFLAG,
ACPI_RSD_6BITFLAG,
ACPI_RSD_ADDRESS,
ACPI_RSD_DWORDLIST,
ACPI_RSD_LITERAL,
......@@ -295,6 +297,7 @@ extern struct acpi_rsconvert_info acpi_rs_convert_address64[];
extern struct acpi_rsconvert_info acpi_rs_convert_ext_address64[];
extern struct acpi_rsconvert_info acpi_rs_convert_gpio[];
extern struct acpi_rsconvert_info acpi_rs_convert_fixed_dma[];
extern struct acpi_rsconvert_info acpi_rs_convert_csi2_serial_bus[];
extern struct acpi_rsconvert_info acpi_rs_convert_i2c_serial_bus[];
extern struct acpi_rsconvert_info acpi_rs_convert_spi_serial_bus[];
extern struct acpi_rsconvert_info acpi_rs_convert_uart_serial_bus[];
......@@ -349,6 +352,7 @@ extern struct acpi_rsdump_info acpi_rs_dump_gpio[];
extern struct acpi_rsdump_info acpi_rs_dump_pin_function[];
extern struct acpi_rsdump_info acpi_rs_dump_fixed_dma[];
extern struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[];
extern struct acpi_rsdump_info acpi_rs_dump_csi2_serial_bus[];
extern struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[];
extern struct acpi_rsdump_info acpi_rs_dump_spi_serial_bus[];
extern struct acpi_rsdump_info acpi_rs_dump_uart_serial_bus[];
......
......@@ -28,6 +28,7 @@ extern const char *acpi_gbl_max_decode[];
extern const char *acpi_gbl_mem_decode[];
extern const char *acpi_gbl_min_decode[];
extern const char *acpi_gbl_mtp_decode[];
extern const char *acpi_gbl_phy_decode[];
extern const char *acpi_gbl_rng_decode[];
extern const char *acpi_gbl_rw_decode[];
extern const char *acpi_gbl_shr_decode[];
......
......@@ -40,6 +40,7 @@
#define ACPI_RESTAG_IORESTRICTION "_IOR"
#define ACPI_RESTAG_LENGTH "_LEN"
#define ACPI_RESTAG_LINE "_LIN"
#define ACPI_RESTAG_LOCALPORT "_PRT"
#define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
#define ACPI_RESTAG_MEMTYPE "_MEM" /* non_cache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
#define ACPI_RESTAG_MAXADDR "_MAX"
......@@ -49,6 +50,7 @@
#define ACPI_RESTAG_MODE "_MOD"
#define ACPI_RESTAG_PARITY "_PAR"
#define ACPI_RESTAG_PHASE "_PHA"
#define ACPI_RESTAG_PHYTYPE "_PHY"
#define ACPI_RESTAG_PIN "_PIN"
#define ACPI_RESTAG_PINCONFIG "_PPI"
#define ACPI_RESTAG_PINCONFIG_TYPE "_TYP"
......@@ -316,12 +318,26 @@ struct aml_resource_gpio {
#define AML_RESOURCE_I2C_SERIALBUSTYPE 1
#define AML_RESOURCE_SPI_SERIALBUSTYPE 2
#define AML_RESOURCE_UART_SERIALBUSTYPE 3
#define AML_RESOURCE_MAX_SERIALBUSTYPE 3
#define AML_RESOURCE_CSI2_SERIALBUSTYPE 4
#define AML_RESOURCE_MAX_SERIALBUSTYPE 4
#define AML_RESOURCE_VENDOR_SERIALBUSTYPE 192 /* Vendor defined is 0xC0-0xFF (NOT SUPPORTED) */
struct aml_resource_common_serialbus {
AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_SERIAL_COMMON};
struct aml_resource_csi2_serialbus {
AML_RESOURCE_LARGE_HEADER_COMMON AML_RESOURCE_SERIAL_COMMON
/*
* Optional fields follow immediately:
* 1) Vendor Data bytes
* 2) Resource Source String
*/
};
#define AML_RESOURCE_CSI2_REVISION 1 /* ACPI 6.4 */
#define AML_RESOURCE_CSI2_TYPE_REVISION 1 /* ACPI 6.4 */
#define AML_RESOURCE_CSI2_MIN_DATA_LEN 0 /* ACPI 6.4 */
struct aml_resource_i2c_serialbus {
AML_RESOURCE_LARGE_HEADER_COMMON
AML_RESOURCE_SERIAL_COMMON u32 connection_speed;
......@@ -510,6 +526,7 @@ union aml_resource {
struct aml_resource_i2c_serialbus i2c_serial_bus;
struct aml_resource_spi_serialbus spi_serial_bus;
struct aml_resource_uart_serialbus uart_serial_bus;
struct aml_resource_csi2_serialbus csi2_serial_bus;
struct aml_resource_common_serialbus common_serial_bus;
struct aml_resource_pin_function pin_function;
struct aml_resource_pin_config pin_config;
......
......@@ -677,10 +677,10 @@ acpi_rs_get_list_length(u8 *aml_buffer,
*size_needed += buffer_size;
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
"Type %.2X, AmlLength %.2X InternalLength %.2X\n",
"Type %.2X, AmlLength %.2X InternalLength %.2X%8X\n",
acpi_ut_get_resource_type(aml_buffer),
acpi_ut_get_descriptor_length(aml_buffer),
buffer_size));
ACPI_FORMAT_UINT64(*size_needed)));
/*
* Point to the next resource within the AML stream using the length
......
......@@ -87,6 +87,9 @@ void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
("Invalid descriptor type (%X) in resource list\n",
resource_list->type);
return;
} else if (!resource_list->type) {
ACPI_ERROR((AE_INFO, "Invalid Zero Resource Type"));
return;
}
/* Sanity check the length. It must not be zero, or we loop forever */
......@@ -258,6 +261,11 @@ acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
table->pointer[*target & 0x07]);
break;
case ACPI_RSD_6BITFLAG:
acpi_rs_out_integer8(name, (ACPI_GET8(target) & 0x3F));
break;
case ACPI_RSD_SHORTLIST:
/*
* Short byte list (single line output) for DMA and IRQ resources
......
......@@ -421,6 +421,32 @@ struct acpi_rsdump_info acpi_rs_dump_common_serial_bus[11] = {
ACPI_RS_DUMP_COMMON_SERIAL_BUS
};
struct acpi_rsdump_info acpi_rs_dump_csi2_serial_bus[11] = {
{ ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_csi2_serial_bus),
"Camera Serial Bus", NULL },
{ ACPI_RSD_UINT8, ACPI_RSD_OFFSET(csi2_serial_bus.revision_id),
"RevisionId", NULL },
{ ACPI_RSD_UINT8, ACPI_RSD_OFFSET(csi2_serial_bus.type), "Type",
acpi_gbl_sbt_decode },
{ ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(csi2_serial_bus.producer_consumer),
"ProducerConsumer", acpi_gbl_consume_decode },
{ ACPI_RSD_1BITFLAG, ACPI_RSD_OFFSET(csi2_serial_bus.slave_mode),
"SlaveMode", acpi_gbl_sm_decode },
{ ACPI_RSD_2BITFLAG, ACPI_RSD_OFFSET(csi2_serial_bus.phy_type),
"PhyType", acpi_gbl_phy_decode },
{ ACPI_RSD_6BITFLAG,
ACPI_RSD_OFFSET(csi2_serial_bus.local_port_instance),
"LocalPortInstance", NULL },
{ ACPI_RSD_UINT8, ACPI_RSD_OFFSET(csi2_serial_bus.type_revision_id),
"TypeRevisionId", NULL },
{ ACPI_RSD_UINT16, ACPI_RSD_OFFSET(csi2_serial_bus.vendor_length),
"VendorLength", NULL },
{ ACPI_RSD_SHORTLISTX, ACPI_RSD_OFFSET(csi2_serial_bus.vendor_data),
"VendorData", NULL },
{ ACPI_RSD_SOURCE, ACPI_RSD_OFFSET(csi2_serial_bus.resource_source),
"ResourceSource", NULL },
};
struct acpi_rsdump_info acpi_rs_dump_i2c_serial_bus[14] = {
{ACPI_RSD_TITLE, ACPI_RSD_TABLE_SIZE(acpi_rs_dump_i2c_serial_bus),
"I2C Serial Bus", NULL},
......
......@@ -96,13 +96,14 @@ struct acpi_rsconvert_info *acpi_gbl_get_resource_dispatch[] = {
acpi_rs_convert_pin_group_config, /* 0x12, ACPI_RESOURCE_NAME_PIN_GROUP_CONFIG */
};
/* Subtype table for serial_bus -- I2C, SPI, and UART */
/* Subtype table for serial_bus -- I2C, SPI, UART, and CSI2 */
struct acpi_rsconvert_info *acpi_gbl_convert_resource_serial_bus_dispatch[] = {
NULL,
acpi_rs_convert_i2c_serial_bus,
acpi_rs_convert_spi_serial_bus,
acpi_rs_convert_uart_serial_bus,
acpi_rs_convert_csi2_serial_bus
};
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUGGER)
......@@ -142,6 +143,7 @@ struct acpi_rsdump_info *acpi_gbl_dump_serial_bus_dispatch[] = {
acpi_rs_dump_i2c_serial_bus, /* AML_RESOURCE_I2C_BUS_TYPE */
acpi_rs_dump_spi_serial_bus, /* AML_RESOURCE_SPI_BUS_TYPE */
acpi_rs_dump_uart_serial_bus, /* AML_RESOURCE_UART_BUS_TYPE */
acpi_rs_dump_csi2_serial_bus, /* AML_RESOURCE_CSI2_BUS_TYPE */
};
#endif
......@@ -226,6 +228,7 @@ const u8 acpi_gbl_aml_resource_serial_bus_sizes[] = {
sizeof(struct aml_resource_i2c_serialbus),
sizeof(struct aml_resource_spi_serialbus),
sizeof(struct aml_resource_uart_serialbus),
sizeof(struct aml_resource_csi2_serialbus),
};
const u8 acpi_gbl_resource_struct_serial_bus_sizes[] = {
......@@ -233,4 +236,5 @@ const u8 acpi_gbl_resource_struct_serial_bus_sizes[] = {
ACPI_RS_SIZE(struct acpi_resource_i2c_serialbus),
ACPI_RS_SIZE(struct acpi_resource_spi_serialbus),
ACPI_RS_SIZE(struct acpi_resource_uart_serialbus),
ACPI_RS_SIZE(struct acpi_resource_csi2_serialbus),
};
......@@ -59,7 +59,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml,
AML_RESOURCE_MAX_SERIALBUSTYPE) {
conversion_table = NULL;
} else {
/* This is an I2C, SPI, or UART serial_bus descriptor */
/* This is an I2C, SPI, UART, or CSI2 serial_bus descriptor */
conversion_table =
acpi_gbl_convert_resource_serial_bus_dispatch
......@@ -89,6 +89,11 @@ acpi_rs_convert_aml_to_resources(u8 * aml,
return_ACPI_STATUS(status);
}
if (!resource->length) {
ACPI_EXCEPTION((AE_INFO, status,
"Zero-length resource returned from RsConvertAmlToResource"));
}
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES,
"Type %.2X, AmlLength %.2X InternalLength %.2X\n",
acpi_ut_get_resource_type(aml), length,
......@@ -158,7 +163,7 @@ acpi_rs_convert_resources_to_aml(struct acpi_resource *resource,
AML_RESOURCE_MAX_SERIALBUSTYPE) {
conversion_table = NULL;
} else {
/* This is an I2C, SPI, or UART serial_bus descriptor */
/* This is an I2C, SPI, UART or CSI2 serial_bus descriptor */
conversion_table =
acpi_gbl_convert_resource_serial_bus_dispatch
......
......@@ -70,6 +70,8 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
*/
count = INIT_TABLE_LENGTH(info);
while (count) {
target = NULL;
/*
* Source is the external AML byte stream buffer,
* destination is the internal resource descriptor
......@@ -120,6 +122,14 @@ acpi_rs_convert_aml_to_resource(struct acpi_resource *resource,
((ACPI_GET8(source) >> info->value) & 0x07));
break;
case ACPI_RSC_6BITFLAG:
/*
* Mask and shift the flag bits
*/
ACPI_SET8(destination,
((ACPI_GET8(source) >> info->value) & 0x3F));
break;
case ACPI_RSC_COUNT:
item_count = ACPI_GET8(source);
......@@ -509,6 +519,15 @@ acpi_rs_convert_resource_to_aml(struct acpi_resource *resource,
value));
break;
case ACPI_RSC_6BITFLAG:
/*
* Mask and shift the flag bits
*/
ACPI_SET_BIT(*ACPI_CAST8(destination), (u8)
((ACPI_GET8(source) & 0x3F) << info->
value));
break;
case ACPI_RSC_COUNT:
item_count = ACPI_GET8(source);
......
......@@ -185,6 +185,81 @@ struct acpi_rsconvert_info acpi_rs_convert_pin_function[13] = {
0},
};
/*******************************************************************************
*
* acpi_rs_convert_csi2_serial_bus
*
******************************************************************************/
struct acpi_rsconvert_info acpi_rs_convert_csi2_serial_bus[14] = {
{ ACPI_RSC_INITGET, ACPI_RESOURCE_TYPE_SERIAL_BUS,
ACPI_RS_SIZE(struct acpi_resource_csi2_serialbus),
ACPI_RSC_TABLE_SIZE(acpi_rs_convert_csi2_serial_bus) },
{ ACPI_RSC_INITSET, ACPI_RESOURCE_NAME_SERIAL_BUS,
sizeof(struct aml_resource_csi2_serialbus),
0 },
{ ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.common_serial_bus.revision_id),
AML_OFFSET(common_serial_bus.revision_id),
1 },
{ ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.csi2_serial_bus.type),
AML_OFFSET(csi2_serial_bus.type),
1 },
{ ACPI_RSC_1BITFLAG,
ACPI_RS_OFFSET(data.csi2_serial_bus.producer_consumer),
AML_OFFSET(csi2_serial_bus.flags),
1 },
{ ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET(data.csi2_serial_bus.slave_mode),
AML_OFFSET(csi2_serial_bus.flags),
0 },
{ ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET(data.csi2_serial_bus.phy_type),
AML_OFFSET(csi2_serial_bus.type_specific_flags),
0 },
{ ACPI_RSC_6BITFLAG,
ACPI_RS_OFFSET(data.csi2_serial_bus.local_port_instance),
AML_OFFSET(csi2_serial_bus.type_specific_flags),
2 },
{ ACPI_RSC_MOVE8, ACPI_RS_OFFSET(data.csi2_serial_bus.type_revision_id),
AML_OFFSET(csi2_serial_bus.type_revision_id),
1 },
/* Vendor data */
{ ACPI_RSC_COUNT_SERIAL_VEN,
ACPI_RS_OFFSET(data.csi2_serial_bus.vendor_length),
AML_OFFSET(csi2_serial_bus.type_data_length),
AML_RESOURCE_CSI2_MIN_DATA_LEN },
{ ACPI_RSC_MOVE_SERIAL_VEN,
ACPI_RS_OFFSET(data.csi2_serial_bus.vendor_data),
0,
sizeof(struct aml_resource_csi2_serialbus) },
/* Resource Source */
{ ACPI_RSC_MOVE8,
ACPI_RS_OFFSET(data.csi2_serial_bus.resource_source.index),
AML_OFFSET(csi2_serial_bus.res_source_index),
1 },
{ ACPI_RSC_COUNT_SERIAL_RES,
ACPI_RS_OFFSET(data.csi2_serial_bus.resource_source.string_length),
AML_OFFSET(csi2_serial_bus.type_data_length),
sizeof(struct aml_resource_csi2_serialbus) },
{ ACPI_RSC_MOVE_SERIAL_RES,
ACPI_RS_OFFSET(data.csi2_serial_bus.resource_source.string_ptr),
AML_OFFSET(csi2_serial_bus.type_data_length),
sizeof(struct aml_resource_csi2_serialbus) },
};
/*******************************************************************************
*
* acpi_rs_convert_i2c_serial_bus
......
......@@ -82,6 +82,13 @@ const char *acpi_gbl_mtp_decode[] = {
"AddressRangeNVS"
};
const char *acpi_gbl_phy_decode[] = {
"Type C",
"Type D",
"Unknown Type",
"Unknown Type"
};
const char *acpi_gbl_rng_decode[] = {
"InvalidRanges",
"NonISAOnlyRanges",
......@@ -161,7 +168,8 @@ const char *acpi_gbl_sbt_decode[] = {
"/* UNKNOWN serial bus type */",
"I2C",
"SPI",
"UART"
"UART",
"CSI2"
};
/* I2C serial bus access mode */
......
......@@ -64,6 +64,7 @@ const u8 acpi_gbl_resource_aml_serial_bus_sizes[] = {
ACPI_AML_SIZE_LARGE(struct aml_resource_i2c_serialbus),
ACPI_AML_SIZE_LARGE(struct aml_resource_spi_serialbus),
ACPI_AML_SIZE_LARGE(struct aml_resource_uart_serialbus),
ACPI_AML_SIZE_LARGE(struct aml_resource_csi2_serialbus),
};
/*
......
......@@ -725,7 +725,6 @@ static int __init einj_init(void)
goto err_release;
}
rc = -ENOMEM;
einj_param = einj_get_parameter_address();
if ((param_extension || acpi5) && einj_param) {
debugfs_create_x32("flags", S_IRUSR | S_IWUSR, einj_debug_dir,
......
......@@ -54,7 +54,7 @@ EXPORT_SYMBOL_GPL(erst_disable);
static struct acpi_table_erst *erst_tab;
/* ERST Error Log Address Range atrributes */
/* ERST Error Log Address Range attributes */
#define ERST_RANGE_RESERVED 0x0001
#define ERST_RANGE_NVRAM 0x0002
#define ERST_RANGE_SLOW 0x0004
......
// SPDX-License-Identifier: GPL-2.0-only
/*
* APEI Hardware Error Souce Table support
* APEI Hardware Error Source Table support
*
* HEST describes error sources in detail; communicates operational
* parameters (i.e. severity levels, masking bits, and threshold
......
......@@ -74,16 +74,17 @@ enum {
ACPI_BATTERY_XINFO_PRESENT,
ACPI_BATTERY_QUIRK_PERCENTAGE_CAPACITY,
/* On Lenovo Thinkpad models from 2010 and 2011, the power unit
switches between mWh and mAh depending on whether the system
is running on battery or not. When mAh is the unit, most
reported values are incorrect and need to be adjusted by
10000/design_voltage. Verified on x201, t410, t410s, and x220.
Pre-2010 and 2012 models appear to always report in mWh and
are thus unaffected (tested with t42, t61, t500, x200, x300,
and x230). Also, in mid-2012 Lenovo issued a BIOS update for
the 2011 models that fixes the issue (tested on x220 with a
post-1.29 BIOS), but as of Nov. 2012, no such update is
available for the 2010 models. */
* switches between mWh and mAh depending on whether the system
* is running on battery or not. When mAh is the unit, most
* reported values are incorrect and need to be adjusted by
* 10000/design_voltage. Verified on x201, t410, t410s, and x220.
* Pre-2010 and 2012 models appear to always report in mWh and
* are thus unaffected (tested with t42, t61, t500, x200, x300,
* and x230). Also, in mid-2012 Lenovo issued a BIOS update for
* the 2011 models that fixes the issue (tested on x220 with a
* post-1.29 BIOS), but as of Nov. 2012, no such update is
* available for the 2010 models.
*/
ACPI_BATTERY_QUIRK_THINKPAD_MAH,
/* for batteries reporting current capacity with design capacity
* on a full charge, but showing degradation in full charge cap.
......@@ -371,9 +372,7 @@ static enum power_supply_property energy_battery_full_cap_broken_props[] = {
POWER_SUPPLY_PROP_SERIAL_NUMBER,
};
/* --------------------------------------------------------------------------
Battery Management
-------------------------------------------------------------------------- */
/* Battery Management */
struct acpi_offsets {
size_t offset; /* offset inside struct acpi_sbs_battery */
u8 mode; /* int or string? */
......@@ -431,6 +430,7 @@ static int extract_package(struct acpi_battery *battery,
{
int i;
union acpi_object *element;
if (package->type != ACPI_TYPE_PACKAGE)
return -EFAULT;
for (i = 0; i < num; ++i) {
......@@ -439,6 +439,7 @@ static int extract_package(struct acpi_battery *battery,
element = &package->package.elements[i];
if (offsets[i].mode) {
u8 *ptr = (u8 *)battery + offsets[i].offset;
if (element->type == ACPI_TYPE_STRING ||
element->type == ACPI_TYPE_BUFFER)
strncpy(ptr, element->string.pointer, 32);
......@@ -497,10 +498,12 @@ static int extract_battery_info(const int use_bix,
battery->design_capacity_warning *
10000 / battery->design_voltage;
/* Curiously, design_capacity_low, unlike the rest of them,
is correct. */
* is correct.
*/
/* capacity_granularity_* equal 1 on the systems tested, so
it's impossible to tell if they would need an adjustment
or not if their values were higher. */
* it's impossible to tell if they would need an adjustment
* or not if their values were higher.
*/
}
if (test_bit(ACPI_BATTERY_QUIRK_DEGRADED_FULL_CHARGE, &battery->flags) &&
battery->capacity_now > battery->full_charge_capacity)
......@@ -532,8 +535,8 @@ static int acpi_battery_get_info(struct acpi_battery *battery)
if (ACPI_FAILURE(status)) {
acpi_handle_info(battery->device->handle,
"%s evaluation failed: %s\n",
use_bix ?"_BIX":"_BIF",
acpi_format_exception(status));
use_bix ? "_BIX":"_BIF",
acpi_format_exception(status));
} else {
result = extract_battery_info(use_bix,
battery,
......@@ -648,6 +651,7 @@ static ssize_t acpi_battery_alarm_show(struct device *dev,
char *buf)
{
struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
return sprintf(buf, "%d\n", battery->alarm * 1000);
}
......@@ -657,6 +661,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev,
{
unsigned long x;
struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev));
if (sscanf(buf, "%lu\n", &x) == 1)
battery->alarm = x/1000;
if (acpi_battery_present(battery))
......@@ -743,7 +748,7 @@ EXPORT_SYMBOL_GPL(battery_hook_register);
* This function gets called right after the battery sysfs
* attributes have been added, so that the drivers that
* define custom sysfs attributes can add their own.
*/
*/
static void battery_hook_add_battery(struct acpi_battery *battery)
{
struct acpi_battery_hook *hook_node, *tmp;
......@@ -872,10 +877,12 @@ static void find_battery(const struct dmi_header *dm, void *private)
{
struct acpi_battery *battery = (struct acpi_battery *)private;
/* Note: the hardcoded offsets below have been extracted from
the source code of dmidecode. */
* the source code of dmidecode.
*/
if (dm->type == DMI_ENTRY_PORTABLE_BATTERY && dm->length >= 8) {
const u8 *dmi_data = (const u8 *)(dm + 1);
int dmi_capacity = get_unaligned((const u16 *)(dmi_data + 6));
if (dm->length >= 18)
dmi_capacity *= dmi_data[17];
if (battery->design_capacity * battery->design_voltage / 1000
......@@ -917,6 +924,7 @@ static void acpi_battery_quirks(struct acpi_battery *battery)
if (battery->power_unit && dmi_name_in_vendors("LENOVO")) {
const char *s;
s = dmi_get_system_info(DMI_PRODUCT_VERSION);
if (s && !strncasecmp(s, "ThinkPad", 8)) {
dmi_walk(find_battery, battery);
......@@ -1013,10 +1021,7 @@ static void acpi_battery_refresh(struct acpi_battery *battery)
sysfs_add_battery(battery);
}
/* --------------------------------------------------------------------------
Driver Interface
-------------------------------------------------------------------------- */
/* Driver Interface */
static void acpi_battery_notify(struct acpi_device *device, u32 event)
{
struct acpi_battery *battery = acpi_driver_data(device);
......@@ -1026,11 +1031,11 @@ static void acpi_battery_notify(struct acpi_device *device, u32 event)
return;
old = battery->bat;
/*
* On Acer Aspire V5-573G notifications are sometimes triggered too
* early. For example, when AC is unplugged and notification is
* triggered, battery state is still reported as "Full", and changes to
* "Discharging" only after short delay, without any notification.
*/
* On Acer Aspire V5-573G notifications are sometimes triggered too
* early. For example, when AC is unplugged and notification is
* triggered, battery state is still reported as "Full", and changes to
* "Discharging" only after short delay, without any notification.
*/
if (battery_notification_delay_ms > 0)
msleep(battery_notification_delay_ms);
if (event == ACPI_BATTERY_NOTIFY_INFO)
......
......@@ -156,10 +156,7 @@ static unsigned long lid_report_interval __read_mostly = 500;
module_param(lid_report_interval, ulong, 0644);
MODULE_PARM_DESC(lid_report_interval, "Interval (ms) between lid key events");
/* --------------------------------------------------------------------------
FS Interface (/proc)
-------------------------------------------------------------------------- */
/* FS Interface (/proc) */
static struct proc_dir_entry *acpi_button_dir;
static struct proc_dir_entry *acpi_lid_dir;
......@@ -348,9 +345,7 @@ static int acpi_button_remove_fs(struct acpi_device *device)
return 0;
}
/* --------------------------------------------------------------------------
Driver Interface
-------------------------------------------------------------------------- */
/* Driver Interface */
int acpi_lid_open(void)
{
if (!lid_device)
......
......@@ -33,7 +33,6 @@
#define pr_fmt(fmt) "ACPI CPPC: " fmt
#include <linux/cpufreq.h>
#include <linux/delay.h>
#include <linux/iopoll.h>
#include <linux/ktime.h>
......@@ -101,14 +100,14 @@ static DEFINE_PER_CPU(struct cpc_desc *, cpc_desc_ptr);
(cpc)->cpc_entry.reg.space_id == \
ACPI_ADR_SPACE_PLATFORM_COMM)
/* Evalutes to True if reg is a NULL register descriptor */
/* Evaluates to True if reg is a NULL register descriptor */
#define IS_NULL_REG(reg) ((reg)->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY && \
(reg)->address == 0 && \
(reg)->bit_width == 0 && \
(reg)->bit_offset == 0 && \
(reg)->access_width == 0)
/* Evalutes to True if an optional cpc field is supported */
/* Evaluates to True if an optional cpc field is supported */
#define CPC_SUPPORTED(cpc) ((cpc)->type == ACPI_TYPE_INTEGER ? \
!!(cpc)->cpc_entry.int_value : \
!IS_NULL_REG(&(cpc)->cpc_entry.reg))
......@@ -119,23 +118,15 @@ static DEFINE_PER_CPU(struct cpc_desc *, cpc_desc_ptr);
*/
#define NUM_RETRIES 500ULL
struct cppc_attr {
struct attribute attr;
ssize_t (*show)(struct kobject *kobj,
struct attribute *attr, char *buf);
ssize_t (*store)(struct kobject *kobj,
struct attribute *attr, const char *c, ssize_t count);
};
#define define_one_cppc_ro(_name) \
static struct cppc_attr _name = \
static struct kobj_attribute _name = \
__ATTR(_name, 0444, show_##_name, NULL)
#define to_cpc_desc(a) container_of(a, struct cpc_desc, kobj)
#define show_cppc_data(access_fn, struct_name, member_name) \
static ssize_t show_##member_name(struct kobject *kobj, \
struct attribute *attr, char *buf) \
struct kobj_attribute *attr, char *buf) \
{ \
struct cpc_desc *cpc_ptr = to_cpc_desc(kobj); \
struct struct_name st_name = {0}; \
......@@ -161,7 +152,7 @@ show_cppc_data(cppc_get_perf_ctrs, cppc_perf_fb_ctrs, reference_perf);
show_cppc_data(cppc_get_perf_ctrs, cppc_perf_fb_ctrs, wraparound_time);
static ssize_t show_feedback_ctrs(struct kobject *kobj,
struct attribute *attr, char *buf)
struct kobj_attribute *attr, char *buf)
{
struct cpc_desc *cpc_ptr = to_cpc_desc(kobj);
struct cppc_perf_fb_ctrs fb_ctrs = {0};
......@@ -327,6 +318,7 @@ static int send_pcc_cmd(int pcc_ss_id, u16 cmd)
if (unlikely(ret)) {
for_each_possible_cpu(i) {
struct cpc_desc *desc = per_cpu(cpc_desc_ptr, i);
if (!desc)
continue;
......@@ -778,7 +770,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
cpc_ptr->cpc_regs[i-2].type = ACPI_TYPE_BUFFER;
memcpy(&cpc_ptr->cpc_regs[i-2].cpc_entry.reg, gas_t, sizeof(*gas_t));
} else {
pr_debug("Err in entry:%d in CPC table of CPU:%d \n", i, pr->id);
pr_debug("Err in entry:%d in CPC table of CPU:%d\n", i, pr->id);
goto out_free;
}
}
......@@ -868,7 +860,7 @@ void acpi_cppc_processor_exit(struct acpi_processor *pr)
void __iomem *addr;
int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, pr->id);
if (pcc_ss_id >=0 && pcc_data[pcc_ss_id]) {
if (pcc_ss_id >= 0 && pcc_data[pcc_ss_id]) {
if (pcc_data[pcc_ss_id]->pcc_channel_acquired) {
pcc_data[pcc_ss_id]->refcount--;
if (!pcc_data[pcc_ss_id]->refcount) {
......@@ -955,22 +947,22 @@ static int cpc_read(int cpu, struct cpc_register_resource *reg_res, u64 *val)
val, reg->bit_width);
switch (reg->bit_width) {
case 8:
*val = readb_relaxed(vaddr);
break;
case 16:
*val = readw_relaxed(vaddr);
break;
case 32:
*val = readl_relaxed(vaddr);
break;
case 64:
*val = readq_relaxed(vaddr);
break;
default:
pr_debug("Error: Cannot read %u bit width from PCC for ss: %d\n",
reg->bit_width, pcc_ss_id);
ret_val = -EFAULT;
case 8:
*val = readb_relaxed(vaddr);
break;
case 16:
*val = readw_relaxed(vaddr);
break;
case 32:
*val = readl_relaxed(vaddr);
break;
case 64:
*val = readq_relaxed(vaddr);
break;
default:
pr_debug("Error: Cannot read %u bit width from PCC for ss: %d\n",
reg->bit_width, pcc_ss_id);
ret_val = -EFAULT;
}
return ret_val;
......@@ -994,23 +986,23 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
val, reg->bit_width);
switch (reg->bit_width) {
case 8:
writeb_relaxed(val, vaddr);
break;
case 16:
writew_relaxed(val, vaddr);
break;
case 32:
writel_relaxed(val, vaddr);
break;
case 64:
writeq_relaxed(val, vaddr);
break;
default:
pr_debug("Error: Cannot write %u bit width to PCC for ss: %d\n",
reg->bit_width, pcc_ss_id);
ret_val = -EFAULT;
break;
case 8:
writeb_relaxed(val, vaddr);
break;
case 16:
writew_relaxed(val, vaddr);
break;
case 32:
writel_relaxed(val, vaddr);
break;
case 64:
writeq_relaxed(val, vaddr);
break;
default:
pr_debug("Error: Cannot write %u bit width to PCC for ss: %d\n",
reg->bit_width, pcc_ss_id);
ret_val = -EFAULT;
break;
}
return ret_val;
......@@ -1330,7 +1322,7 @@ int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls)
* is still with OSPM.
* pending_pcc_write_cmd can also be cleared by a different CPU, if
* there was a pcc CMD_READ waiting on down_write and it steals the lock
* before the pcc CMD_WRITE is completed. pcc_send_cmd checks for this
* before the pcc CMD_WRITE is completed. send_pcc_cmd checks for this
* case during a CMD_READ and if there are pending writes it delivers
* the write command before servicing the read command
*/
......@@ -1355,8 +1347,8 @@ EXPORT_SYMBOL_GPL(cppc_set_perf);
/**
* cppc_get_transition_latency - returns frequency transition latency in ns
*
* ACPI CPPC does not explicitly specifiy how a platform can specify the
* transition latency for perfromance change requests. The closest we have
* ACPI CPPC does not explicitly specify how a platform can specify the
* transition latency for performance change requests. The closest we have
* is the timing information from the PCCT tables which provides the info
* on the number and frequency of PCC commands the platform can handle.
*/
......
......@@ -19,7 +19,7 @@ static struct dentry *cm_dentry;
/* /sys/kernel/debug/acpi/custom_method */
static ssize_t cm_write(struct file *file, const char __user * user_buf,
static ssize_t cm_write(struct file *file, const char __user *user_buf,
size_t count, loff_t *ppos)
{
static char *buf;
......
......@@ -966,6 +966,7 @@ EXPORT_SYMBOL_GPL(acpi_dev_resume);
int acpi_subsys_runtime_suspend(struct device *dev)
{
int ret = pm_generic_runtime_suspend(dev);
return ret ? ret : acpi_dev_suspend(dev, true);
}
EXPORT_SYMBOL_GPL(acpi_subsys_runtime_suspend);
......@@ -980,6 +981,7 @@ EXPORT_SYMBOL_GPL(acpi_subsys_runtime_suspend);
int acpi_subsys_runtime_resume(struct device *dev)
{
int ret = acpi_dev_resume(dev);
return ret ? ret : pm_generic_runtime_resume(dev);
}
EXPORT_SYMBOL_GPL(acpi_subsys_runtime_resume);
......@@ -1171,6 +1173,7 @@ EXPORT_SYMBOL_GPL(acpi_subsys_freeze);
int acpi_subsys_restore_early(struct device *dev)
{
int ret = acpi_dev_resume(dev);
return ret ? ret : pm_generic_restore_early(dev);
}
EXPORT_SYMBOL_GPL(acpi_subsys_restore_early);
......
......@@ -73,6 +73,7 @@ static const struct sysfs_ops acpi_data_node_sysfs_ops = {
static void acpi_data_node_release(struct kobject *kobj)
{
struct acpi_data_node *dn = to_data_node(kobj);
complete(&dn->kobj_done);
}
......@@ -130,7 +131,7 @@ static void acpi_hide_nondev_subnodes(struct acpi_device_data *data)
* Return: 0: no _HID and no _CID
* -EINVAL: output error
* -ENOMEM: output is truncated
*/
*/
static int create_pnp_modalias(struct acpi_device *acpi_dev, char *modalias,
int size)
{
......@@ -376,12 +377,12 @@ eject_store(struct device *d, struct device_attribute *attr,
if (ACPI_FAILURE(status) || !acpi_device->flags.ejectable)
return -ENODEV;
get_device(&acpi_device->dev);
acpi_dev_get(acpi_device);
status = acpi_hotplug_schedule(acpi_device, ACPI_OST_EC_OSPM_EJECT);
if (ACPI_SUCCESS(status))
return count;
put_device(&acpi_device->dev);
acpi_dev_put(acpi_device);
acpi_evaluate_ost(acpi_device->handle, ACPI_OST_EC_OSPM_EJECT,
ACPI_OST_SC_NON_SPECIFIC_FAILURE, NULL);
return status == AE_NO_MEMORY ? -ENOMEM : -EAGAIN;
......@@ -431,7 +432,8 @@ static DEVICE_ATTR_RO(path);
/* sysfs file that shows description text from the ACPI _STR method */
static ssize_t description_show(struct device *dev,
struct device_attribute *attr,
char *buf) {
char *buf)
{
struct acpi_device *acpi_dev = to_acpi_device(dev);
int result;
......@@ -456,7 +458,8 @@ static DEVICE_ATTR_RO(description);
static ssize_t
sun_show(struct device *dev, struct device_attribute *attr,
char *buf) {
char *buf)
{
struct acpi_device *acpi_dev = to_acpi_device(dev);
acpi_status status;
unsigned long long sun;
......@@ -471,7 +474,8 @@ static DEVICE_ATTR_RO(sun);
static ssize_t
hrv_show(struct device *dev, struct device_attribute *attr,
char *buf) {
char *buf)
{
struct acpi_device *acpi_dev = to_acpi_device(dev);
acpi_status status;
unsigned long long hrv;
......@@ -485,7 +489,8 @@ hrv_show(struct device *dev, struct device_attribute *attr,
static DEVICE_ATTR_RO(hrv);
static ssize_t status_show(struct device *dev, struct device_attribute *attr,
char *buf) {
char *buf)
{
struct acpi_device *acpi_dev = to_acpi_device(dev);
acpi_status status;
unsigned long long sta;
......
......@@ -271,6 +271,7 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event)
if (!acpi_device_enumerated(adev)) {
int ret = acpi_bus_scan(adev->handle);
if (ret)
dev_dbg(&adev->dev, "scan error %d\n", -ret);
}
......@@ -502,6 +503,7 @@ static ssize_t flags_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct dock_station *dock_station = dev->platform_data;
return snprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags);
}
......@@ -523,7 +525,7 @@ static ssize_t undock_store(struct device *dev, struct device_attribute *attr,
begin_undock(dock_station);
ret = handle_eject_request(dock_station, ACPI_NOTIFY_EJECT_REQUEST);
acpi_scan_lock_release();
return ret ? ret: count;
return ret ? ret : count;
}
static DEVICE_ATTR_WO(undock);
......@@ -535,10 +537,11 @@ static ssize_t uid_show(struct device *dev,
{
unsigned long long lbuf;
struct dock_station *dock_station = dev->platform_data;
acpi_status status = acpi_evaluate_integer(dock_station->handle,
"_UID", NULL, &lbuf);
if (ACPI_FAILURE(status))
return 0;
return 0;
return snprintf(buf, PAGE_SIZE, "%llx\n", lbuf);
}
......
......@@ -190,7 +190,7 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
if (!acpi_dev)
return -EINVAL;
get_device(&acpi_dev->dev);
acpi_dev_get(acpi_dev);
get_device(dev);
physical_node = kzalloc(sizeof(*physical_node), GFP_KERNEL);
if (!physical_node) {
......@@ -217,7 +217,7 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
goto err;
put_device(dev);
put_device(&acpi_dev->dev);
acpi_dev_put(acpi_dev);
return 0;
}
if (pn->node_id == node_id) {
......@@ -257,7 +257,7 @@ int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev)
err:
ACPI_COMPANION_SET(dev, NULL);
put_device(dev);
put_device(&acpi_dev->dev);
acpi_dev_put(acpi_dev);
return retval;
}
EXPORT_SYMBOL_GPL(acpi_bind_one);
......@@ -285,7 +285,7 @@ int acpi_unbind_one(struct device *dev)
ACPI_COMPANION_SET(dev, NULL);
/* Drop references taken by acpi_bind_one(). */
put_device(dev);
put_device(&acpi_dev->dev);
acpi_dev_put(acpi_dev);
kfree(entry);
break;
}
......
......@@ -74,7 +74,6 @@ static struct acpi_driver acpi_hed_driver = {
};
module_acpi_driver(acpi_hed_driver);
ACPI_MODULE_NAME("hed");
MODULE_AUTHOR("Huang Ying");
MODULE_DESCRIPTION("ACPI Hardware Error Device Driver");
MODULE_LICENSE("GPL");
......@@ -109,8 +109,7 @@ struct acpi_device_bus_id {
int acpi_device_add(struct acpi_device *device,
void (*release)(struct device *));
void acpi_init_device_object(struct acpi_device *device, acpi_handle handle,
int type, unsigned long long sta,
struct acpi_device_info *info);
int type);
int acpi_device_setup_files(struct acpi_device *dev);
void acpi_device_remove_files(struct acpi_device *dev);
void acpi_device_add_finalize(struct acpi_device *device);
......@@ -143,6 +142,7 @@ int acpi_device_sleep_wake(struct acpi_device *dev,
int acpi_power_get_inferred_state(struct acpi_device *device, int *state);
int acpi_power_on_resources(struct acpi_device *device, int state);
int acpi_power_transition(struct acpi_device *device, int state);
void acpi_turn_off_unused_power_resources(void);
/* --------------------------------------------------------------------------
Device Power Management
......
......@@ -3831,7 +3831,7 @@ static __init int nfit_init(void)
int ret;
BUILD_BUG_ON(sizeof(struct acpi_table_nfit) != 40);
BUILD_BUG_ON(sizeof(struct acpi_nfit_system_address) != 56);
BUILD_BUG_ON(sizeof(struct acpi_nfit_system_address) != 64);
BUILD_BUG_ON(sizeof(struct acpi_nfit_memory_map) != 48);
BUILD_BUG_ON(sizeof(struct acpi_nfit_interleave) != 20);
BUILD_BUG_ON(sizeof(struct acpi_nfit_smbios) != 9);
......
......@@ -722,7 +722,7 @@ static void hmat_register_target(struct memory_target *target)
/*
* 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
* to all the memory in a proximity domain leading to
* the node being marked offline / unplugged, or if
* memory-only "hotplug" node is offline.
*/
......
......@@ -9,6 +9,7 @@
* Bjorn Helgaas <bjorn.helgaas@hp.com>
*/
#define pr_fmt(fmt) "ACPI: PCI: " fmt
#include <linux/dmi.h>
#include <linux/kernel.h>
......@@ -22,11 +23,6 @@
#include <linux/slab.h>
#include <linux/interrupt.h>
#define PREFIX "ACPI: "
#define _COMPONENT ACPI_PCI_COMPONENT
ACPI_MODULE_NAME("pci_irq");
struct acpi_prt_entry {
struct acpi_pci_id id;
u8 pin;
......@@ -126,7 +122,7 @@ static void do_prt_fixups(struct acpi_prt_entry *entry,
entry->pin == quirk->pin &&
!strcmp(prt->source, quirk->source) &&
strlen(prt->source) >= strlen(quirk->actual_source)) {
printk(KERN_WARNING PREFIX "firmware reports "
pr_warn("Firmware reports "
"%04x:%02x:%02x PCI INT %c connected to %s; "
"changing to %s\n",
entry->id.segment, entry->id.bus,
......@@ -191,12 +187,9 @@ static int acpi_pci_irq_check_entry(acpi_handle handle, struct pci_dev *dev,
* the IRQ value, which is hardwired to specific interrupt inputs on
* the interrupt controller.
*/
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INFO,
" %04x:%02x:%02x[%c] -> %s[%d]\n",
entry->id.segment, entry->id.bus,
entry->id.device, pin_name(entry->pin),
prt->source, entry->index));
pr_debug("%04x:%02x:%02x[%c] -> %s[%d]\n",
entry->id.segment, entry->id.bus, entry->id.device,
pin_name(entry->pin), prt->source, entry->index);
*entry_ptr = entry;
......@@ -307,8 +300,7 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
#ifdef CONFIG_X86_IO_APIC
acpi_reroute_boot_interrupt(dev, entry);
#endif /* CONFIG_X86_IO_APIC */
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %s[%c] _PRT entry\n",
pci_name(dev), pin_name(pin)));
dev_dbg(&dev->dev, "Found [%c] _PRT entry\n", pin_name(pin));
return entry;
}
......@@ -324,9 +316,7 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
/* PC card has the same IRQ as its cardbridge */
bridge_pin = bridge->pin;
if (!bridge_pin) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"No interrupt pin configured for device %s\n",
pci_name(bridge)));
dev_dbg(&bridge->dev, "No interrupt pin configured\n");
return NULL;
}
pin = bridge_pin;
......@@ -334,10 +324,8 @@ static struct acpi_prt_entry *acpi_pci_irq_lookup(struct pci_dev *dev, int pin)
ret = acpi_pci_irq_find_prt_entry(bridge, pin, &entry);
if (!ret && entry) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Derived GSI for %s INT %c from %s\n",
pci_name(dev), pin_name(orig_pin),
pci_name(bridge)));
dev_dbg(&dev->dev, "Derived GSI INT %c from %s\n",
pin_name(orig_pin), pci_name(bridge));
return entry;
}
......@@ -413,9 +401,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
pin = dev->pin;
if (!pin) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"No interrupt pin configured for device %s\n",
pci_name(dev)));
dev_dbg(&dev->dev, "No interrupt pin configured\n");
return 0;
}
......
This diff is collapsed.
......@@ -15,7 +15,7 @@
/*
* We have no docs for the CHT Crystal Cove PMIC. The Asus Zenfone-2 kernel
* code has 2 Crystal Cove regulator drivers, one calls the PMIC a "Crystal
* Cove Plus" PMIC and talks about Cherry Trail, so presuambly that one
* Cove Plus" PMIC and talks about Cherry Trail, so presumably that one
* could be used to get register info for the regulators if we need to
* implement regulator support in the future.
*
......
......@@ -925,8 +925,7 @@ int acpi_add_power_resource(acpi_handle handle)
return -ENOMEM;
device = &resource->device;
acpi_init_device_object(device, handle, ACPI_BUS_TYPE_POWER,
ACPI_STA_DEFAULT, NULL);
acpi_init_device_object(device, handle, ACPI_BUS_TYPE_POWER);
mutex_init(&resource->resource_lock);
INIT_LIST_HEAD(&resource->list_node);
INIT_LIST_HEAD(&resource->dependents);
......@@ -935,7 +934,7 @@ int acpi_add_power_resource(acpi_handle handle)
strcpy(acpi_device_class(device), ACPI_POWER_CLASS);
device->power.state = ACPI_STATE_UNKNOWN;
/* Evalute the object to get the system level and resource order. */
/* Evaluate the object to get the system level and resource order. */
status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
if (ACPI_FAILURE(status))
goto err;
......@@ -996,6 +995,7 @@ void acpi_resume_power_resources(void)
mutex_unlock(&power_resource_list_lock);
}
#endif
void acpi_turn_off_unused_power_resources(void)
{
......@@ -1004,18 +1004,9 @@ void acpi_turn_off_unused_power_resources(void)
mutex_lock(&power_resource_list_lock);
list_for_each_entry_reverse(resource, &acpi_power_resource_list, list_node) {
int result, state;
mutex_lock(&resource->resource_lock);
result = acpi_power_get_state(resource->device.handle, &state);
if (result) {
mutex_unlock(&resource->resource_lock);
continue;
}
if (state == ACPI_POWER_RESOURCE_STATE_ON
&& !resource->ref_count) {
if (!resource->ref_count) {
dev_info(&resource->device.dev, "Turning OFF\n");
__acpi_power_off(resource);
}
......@@ -1025,4 +1016,3 @@ void acpi_turn_off_unused_power_resources(void)
mutex_unlock(&power_resource_list_lock);
}
#endif
......@@ -28,9 +28,6 @@
#define ACPI_PROCESSOR_NOTIFY_POWER 0x81
#define ACPI_PROCESSOR_NOTIFY_THROTTLING 0x82
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor_driver");
MODULE_AUTHOR("Paul Diefenbaugh");
MODULE_DESCRIPTION("ACPI Processor Driver");
MODULE_LICENSE("GPL");
......@@ -87,8 +84,7 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data)
dev_name(&device->dev), event, 0);
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Unsupported event [0x%x]\n", event));
acpi_handle_debug(handle, "Unsupported event [0x%x]\n", event);
break;
}
......
......@@ -32,9 +32,6 @@
#include <asm/cpu.h>
#endif
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor_idle");
#define ACPI_IDLE_STATE_START (IS_ENABLED(CONFIG_ARCH_HAS_CPU_RELAX) ? 1 : 0)
static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER;
......@@ -240,8 +237,8 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
* 100 microseconds.
*/
if (acpi_gbl_FADT.c2_latency > ACPI_PROCESSOR_MAX_C2_LATENCY) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"C2 latency too large [%d]\n", acpi_gbl_FADT.c2_latency));
acpi_handle_debug(pr->handle, "C2 latency too large [%d]\n",
acpi_gbl_FADT.c2_latency);
/* invalidate C2 */
pr->power.states[ACPI_STATE_C2].address = 0;
}
......@@ -251,16 +248,15 @@ static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
* 1000 microseconds.
*/
if (acpi_gbl_FADT.c3_latency > ACPI_PROCESSOR_MAX_C3_LATENCY) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"C3 latency too large [%d]\n", acpi_gbl_FADT.c3_latency));
acpi_handle_debug(pr->handle, "C3 latency too large [%d]\n",
acpi_gbl_FADT.c3_latency);
/* invalidate C3 */
pr->power.states[ACPI_STATE_C3].address = 0;
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"lvl2[0x%08x] lvl3[0x%08x]\n",
acpi_handle_debug(pr->handle, "lvl2[0x%08x] lvl3[0x%08x]\n",
pr->power.states[ACPI_STATE_C2].address,
pr->power.states[ACPI_STATE_C3].address));
pr->power.states[ACPI_STATE_C3].address);
snprintf(pr->power.states[ACPI_STATE_C2].desc,
ACPI_CX_DESC_LEN, "ACPI P_LVL2 IOPORT 0x%x",
......@@ -325,8 +321,8 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
* devices thus we take the conservative approach.
*/
else if (errata.piix4.fdma) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"C3 not supported on PIIX4 with Type-F DMA\n"));
acpi_handle_debug(pr->handle,
"C3 not supported on PIIX4 with Type-F DMA\n");
return;
}
......@@ -345,13 +341,13 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
if (!pr->flags.bm_control) {
if (pr->flags.has_cst != 1) {
/* bus mastering control is necessary */
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"C3 support requires BM control\n"));
acpi_handle_debug(pr->handle,
"C3 support requires BM control\n");
return;
} else {
/* Here we enter C3 without bus mastering */
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"C3 support without BM control\n"));
acpi_handle_debug(pr->handle,
"C3 support without BM control\n");
}
}
} else {
......@@ -360,9 +356,9 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr,
* supported on when bm_check is not required.
*/
if (!(acpi_gbl_FADT.flags & ACPI_FADT_WBINVD)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
acpi_handle_debug(pr->handle,
"Cache invalidation should work properly"
" for C3 to be enabled on SMP systems\n"));
" for C3 to be enabled on SMP systems\n");
return;
}
}
......@@ -789,8 +785,8 @@ static inline void acpi_processor_cstate_first_run_checks(void)
dmi_check_system(processor_power_dmi_table);
max_cstate = acpi_processor_cstate_check(max_cstate);
if (max_cstate < ACPI_C_STATES_MAX)
pr_notice("ACPI: processor limited to max C-state %d\n",
max_cstate);
pr_notice("processor limited to max C-state %d\n", max_cstate);
first_run++;
if (nocst)
......@@ -848,7 +844,7 @@ static int acpi_processor_evaluate_lpi(acpi_handle handle,
status = acpi_evaluate_object(handle, "_LPI", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No _LPI, giving up\n"));
acpi_handle_debug(handle, "No _LPI, giving up\n");
return -ENODEV;
}
......
......@@ -16,9 +16,6 @@
#include "internal.h"
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor_pdc");
static bool __init processor_physically_present(acpi_handle handle)
{
int cpuid, type;
......@@ -132,8 +129,8 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in)
status = acpi_evaluate_object(handle, "_PDC", pdc_in, NULL);
if (ACPI_FAILURE(status))
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Could not evaluate _PDC, using legacy perf. control.\n"));
acpi_handle_debug(handle,
"Could not evaluate _PDC, using legacy perf control\n");
return status;
}
......
......@@ -23,8 +23,6 @@
#define PREFIX "ACPI: "
#define ACPI_PROCESSOR_FILE_PERFORMANCE "performance"
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor_perflib");
static DEFINE_MUTEX(performance_mutex);
......@@ -65,13 +63,13 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
* (e.g. 0 = states 0..n; 1 = states 1..n; etc.
*/
status = acpi_evaluate_integer(pr->handle, "_PPC", NULL, &ppc);
if (status != AE_NOT_FOUND)
if (status != AE_NOT_FOUND) {
acpi_processor_ppc_in_use = true;
if (ACPI_FAILURE(status) && status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PPC"));
return -ENODEV;
if (ACPI_FAILURE(status)) {
acpi_evaluation_failure_warn(pr->handle, "_PPC", status);
return -ENODEV;
}
}
pr_debug("CPU %d: _PPC is %d - frequency %s limited\n", pr->id,
......@@ -98,7 +96,7 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
* acpi_processor_ppc_ost: Notify firmware the _PPC evaluation status
* @handle: ACPI processor handle
* @status: the status code of _PPC evaluation
* 0: success. OSPM is now using the performance state specificed.
* 0: success. OSPM is now using the performance state specified.
* 1: failure. OSPM has not changed the number of P-states in use
*/
static void acpi_processor_ppc_ost(acpi_handle handle, int status)
......@@ -199,7 +197,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
status = acpi_evaluate_object(pr->handle, "_PCT", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PCT"));
acpi_evaluation_failure_warn(pr->handle, "_PCT", status);
return -ENODEV;
}
......@@ -299,7 +297,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PSS"));
acpi_evaluation_failure_warn(pr->handle, "_PSS", status);
return -ENODEV;
}
......@@ -310,8 +308,8 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
goto end;
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d performance states\n",
pss->package.count));
acpi_handle_debug(pr->handle, "Found %d performance states\n",
pss->package.count);
pr->performance->state_count = pss->package.count;
pr->performance->states =
......@@ -330,12 +328,13 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
state.length = sizeof(struct acpi_processor_px);
state.pointer = px;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i));
acpi_handle_debug(pr->handle, "Extracting state %d\n", i);
status = acpi_extract_package(&(pss->package.elements[i]),
&format, &state);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Invalid _PSS data"));
acpi_handle_warn(pr->handle, "Invalid _PSS data: %s\n",
acpi_format_exception(status));
result = -EFAULT;
kfree(pr->performance->states);
goto end;
......@@ -343,14 +342,14 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
amd_fixup_frequency(px, i);
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
acpi_handle_debug(pr->handle,
"State [%d]: core_frequency[%d] power[%d] transition_latency[%d] bus_master_latency[%d] control[0x%x] status[0x%x]\n",
i,
(u32) px->core_frequency,
(u32) px->power,
(u32) px->transition_latency,
(u32) px->bus_master_latency,
(u32) px->control, (u32) px->status));
(u32) px->control, (u32) px->status);
/*
* Check that ACPI's u64 MHz will be valid as u32 KHz in cpufreq
......@@ -400,8 +399,8 @@ int acpi_processor_get_performance_info(struct acpi_processor *pr)
return -EINVAL;
if (!acpi_has_method(pr->handle, "_PCT")) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"ACPI-based processor performance control unavailable\n"));
acpi_handle_debug(pr->handle,
"ACPI-based processor performance control unavailable\n");
return -ENODEV;
}
......@@ -442,24 +441,23 @@ int acpi_processor_pstate_control(void)
if (!acpi_gbl_FADT.smi_command || !acpi_gbl_FADT.pstate_control)
return 0;
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Writing pstate_control [0x%x] to smi_command [0x%x]\n",
acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command));
pr_debug("Writing pstate_control [0x%x] to smi_command [0x%x]\n",
acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command);
status = acpi_os_write_port(acpi_gbl_FADT.smi_command,
(u32)acpi_gbl_FADT.pstate_control, 8);
if (ACPI_SUCCESS(status))
return 1;
ACPI_EXCEPTION((AE_INFO, status,
"Failed to write pstate_control [0x%x] to smi_command [0x%x]",
acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command));
pr_warn("Failed to write pstate_control [0x%x] to smi_command [0x%x]: %s\n",
acpi_gbl_FADT.pstate_control, acpi_gbl_FADT.smi_command,
acpi_format_exception(status));
return -EIO;
}
int acpi_processor_notify_smm(struct module *calling_module)
{
static int is_done = 0;
static int is_done;
int result;
if (!acpi_processor_cpufreq_init)
......@@ -485,7 +483,7 @@ int acpi_processor_notify_smm(struct module *calling_module)
result = acpi_processor_pstate_control();
if (!result) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No SMI port or pstate_control\n"));
pr_debug("No SMI port or pstate_control\n");
module_put(calling_module);
return 0;
}
......
......@@ -22,9 +22,6 @@
#define PREFIX "ACPI: "
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor_throttling");
/* ignore_tpc:
* 0 -> acpi processor driver doesn't ignore _TPC values
* 1 -> acpi processor driver ignores _TPC values
......@@ -196,10 +193,8 @@ static int acpi_processor_update_tsd_coord(void)
*/
void acpi_processor_throttling_init(void)
{
if (acpi_processor_update_tsd_coord()) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Assume no T-state coordination\n"));
}
if (acpi_processor_update_tsd_coord())
pr_debug("Assume no T-state coordination\n");
return;
}
......@@ -216,12 +211,13 @@ static int acpi_processor_throttling_notifier(unsigned long event, void *data)
cpu = p_tstate->cpu;
pr = per_cpu(processors, cpu);
if (!pr) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Invalid pr pointer\n"));
pr_debug("Invalid pr pointer\n");
return 0;
}
if (!pr->flags.throttling) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Throttling control is "
"unsupported on CPU %d\n", cpu));
acpi_handle_debug(pr->handle,
"Throttling control unsupported on CPU %d\n",
cpu);
return 0;
}
target_state = p_tstate->target_state;
......@@ -245,9 +241,9 @@ static int acpi_processor_throttling_notifier(unsigned long event, void *data)
target_state = p_throttling->state_count - 1;
}
p_tstate->target_state = target_state;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PreChange Event:"
"target T-state of CPU %d is T%d\n",
cpu, target_state));
acpi_handle_debug(pr->handle,
"PreChange Event: target T-state of CPU %d is T%d\n",
cpu, target_state);
break;
case THROTTLING_POSTCHANGE:
/*
......@@ -255,9 +251,9 @@ static int acpi_processor_throttling_notifier(unsigned long event, void *data)
* T-state flag of acpi_processor_throttling.
*/
p_throttling->state = target_state;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "PostChange Event:"
"CPU %d is switched to T%d\n",
cpu, target_state));
acpi_handle_debug(pr->handle,
"PostChange Event: CPU %d is switched to T%d\n",
cpu, target_state);
break;
default:
printk(KERN_WARNING
......@@ -284,9 +280,9 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc);
if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC"));
}
if (status != AE_NOT_FOUND)
acpi_evaluation_failure_warn(pr->handle, "_TPC", status);
return -ENODEV;
}
......@@ -417,9 +413,9 @@ static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
status = acpi_evaluate_object(pr->handle, "_PTC", NULL, &buffer);
if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTC"));
}
if (status != AE_NOT_FOUND)
acpi_evaluation_failure_warn(pr->handle, "_PTC", status);
return -ENODEV;
}
......@@ -502,9 +498,9 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
status = acpi_evaluate_object(pr->handle, "_TSS", NULL, &buffer);
if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSS"));
}
if (status != AE_NOT_FOUND)
acpi_evaluation_failure_warn(pr->handle, "_TSS", status);
return -ENODEV;
}
......@@ -515,8 +511,8 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
goto end;
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d throttling states\n",
tss->package.count));
acpi_handle_debug(pr->handle, "Found %d throttling states\n",
tss->package.count);
pr->throttling.state_count = tss->package.count;
pr->throttling.states_tss =
......@@ -537,12 +533,13 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
state.length = sizeof(struct acpi_processor_tx_tss);
state.pointer = tx;
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i));
acpi_handle_debug(pr->handle, "Extracting state %d\n", i);
status = acpi_extract_package(&(tss->package.elements[i]),
&format, &state);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Invalid _TSS data"));
acpi_handle_warn(pr->handle, "Invalid _TSS data: %s\n",
acpi_format_exception(status));
result = -EFAULT;
kfree(pr->throttling.states_tss);
goto end;
......@@ -582,9 +579,9 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr)
status = acpi_evaluate_object(pr->handle, "_TSD", NULL, &buffer);
if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TSD"));
}
if (status != AE_NOT_FOUND)
acpi_evaluation_failure_warn(pr->handle, "_TSD", status);
return -ENODEV;
}
......@@ -698,9 +695,9 @@ static int acpi_processor_get_throttling_fadt(struct acpi_processor *pr)
local_irq_enable();
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
acpi_handle_debug(pr->handle,
"Throttling state is T%d (%d%% throttling applied)\n",
state, pr->throttling.states[state].performance));
state, pr->throttling.states[state].performance);
return 0;
}
......@@ -875,8 +872,8 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr)
if (ret >= 0) {
state = acpi_get_throttling_state(pr, value);
if (state == -1) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Invalid throttling state, reset\n"));
acpi_handle_debug(pr->handle,
"Invalid throttling state, reset\n");
state = 0;
ret = __acpi_processor_set_throttling(pr, state, true,
true);
......@@ -921,10 +918,10 @@ static int acpi_processor_get_fadt_info(struct acpi_processor *pr)
int i, step;
if (!pr->throttling.address) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling register\n"));
acpi_handle_debug(pr->handle, "No throttling register\n");
return -EINVAL;
} else if (!pr->throttling.duty_width) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No throttling states\n"));
acpi_handle_debug(pr->handle, "No throttling states\n");
return -EINVAL;
}
/* TBD: Support duty_cycle values that span bit 4. */
......@@ -1015,10 +1012,10 @@ static int acpi_processor_set_throttling_fadt(struct acpi_processor *pr,
local_irq_enable();
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
acpi_handle_debug(pr->handle,
"Throttling state set to T%d (%d%%)\n", state,
(pr->throttling.states[state].performance ? pr->
throttling.states[state].performance / 10 : 0)));
throttling.states[state].performance / 10 : 0));
return 0;
}
......@@ -1129,8 +1126,8 @@ static int __acpi_processor_set_throttling(struct acpi_processor *pr,
* error message and continue.
*/
if (!match_pr) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Invalid Pointer for CPU %d\n", i));
acpi_handle_debug(pr->handle,
"Invalid Pointer for CPU %d\n", i);
continue;
}
/*
......@@ -1138,9 +1135,8 @@ static int __acpi_processor_set_throttling(struct acpi_processor *pr,
* we will report the error message and continue.
*/
if (!match_pr->flags.throttling) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Throttling Control is unsupported "
"on CPU %d\n", i));
acpi_handle_debug(pr->handle,
"Throttling Control unsupported on CPU %d\n", i);
continue;
}
......@@ -1177,11 +1173,11 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
int result = 0;
struct acpi_processor_throttling *pthrottling;
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
acpi_handle_debug(pr->handle,
"pblk_address[0x%08x] duty_offset[%d] duty_width[%d]\n",
pr->throttling.address,
pr->throttling.duty_offset,
pr->throttling.duty_width));
pr->throttling.duty_width);
/*
* Evaluate _PTC, _TSS and _TPC
......@@ -1221,13 +1217,13 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
* used this part.
*/
if (errata.piix4.throttle) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Throttling not supported on PIIX4 A- or B-step\n"));
acpi_handle_debug(pr->handle,
"Throttling not supported on PIIX4 A- or B-step\n");
return 0;
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d throttling states\n",
pr->throttling.state_count));
acpi_handle_debug(pr->handle, "Found %d throttling states\n",
pr->throttling.state_count);
pr->flags.throttling = 1;
......@@ -1242,9 +1238,9 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
goto end;
if (pr->throttling.state) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
acpi_handle_debug(pr->handle,
"Disabling throttling (was T%d)\n",
pr->throttling.state));
pr->throttling.state);
result = acpi_processor_set_throttling(pr, 0, false);
if (result)
goto end;
......
......@@ -596,7 +596,7 @@ static int __acpi_dev_get_resources(struct acpi_device *adev,
* @preproc_data: Pointer passed to the caller's preprocessing routine.
*
* Evaluate the _CRS method for the given device node and process its output by
* (1) executing the @preproc() rountine provided by the caller, passing the
* (1) executing the @preproc() routine provided by the caller, passing the
* resource pointer and @preproc_data to it as arguments, for each ACPI resource
* returned and (2) converting all of the returned ACPI resources into struct
* resource objects if possible. If the return value of @preproc() in step (1)
......
This diff is collapsed.
......@@ -8,7 +8,6 @@ extern struct list_head acpi_wakeup_device_list;
extern struct mutex acpi_device_lock;
extern void acpi_resume_power_resources(void);
extern void acpi_turn_off_unused_power_resources(void);
static inline acpi_status acpi_set_waking_vector(u32 wakeup_address)
{
......
......@@ -12,9 +12,6 @@
#include "internal.h"
#define _COMPONENT ACPI_SYSTEM_COMPONENT
ACPI_MODULE_NAME("sysfs");
#ifdef CONFIG_ACPI_DEBUG
/*
* ACPI debug sysfs I/F, including:
......@@ -51,14 +48,6 @@ static const struct acpi_dlayer acpi_debug_layers[] = {
ACPI_DEBUG_INIT(ACPI_CA_DISASSEMBLER),
ACPI_DEBUG_INIT(ACPI_COMPILER),
ACPI_DEBUG_INIT(ACPI_TOOLS),
ACPI_DEBUG_INIT(ACPI_SBS_COMPONENT),
ACPI_DEBUG_INIT(ACPI_FAN_COMPONENT),
ACPI_DEBUG_INIT(ACPI_PCI_COMPONENT),
ACPI_DEBUG_INIT(ACPI_CONTAINER_COMPONENT),
ACPI_DEBUG_INIT(ACPI_SYSTEM_COMPONENT),
ACPI_DEBUG_INIT(ACPI_MEMORY_DEVICE_COMPONENT),
ACPI_DEBUG_INIT(ACPI_PROCESSOR_COMPONENT),
};
static const struct acpi_dlevel acpi_debug_levels[] = {
......@@ -652,8 +641,7 @@ static int get_status(u32 index, acpi_event_status *ret,
if (index < num_gpes) {
status = acpi_get_gpe_device(index, handle);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, AE_NOT_FOUND,
"Invalid GPE 0x%x", index));
pr_warn("Invalid GPE 0x%x", index);
return -ENXIO;
}
status = acpi_get_gpe_status(*handle, index, ret);
......
......@@ -511,6 +511,20 @@ __acpi_handle_debug(struct _ddebug *descriptor, acpi_handle handle,
EXPORT_SYMBOL(__acpi_handle_debug);
#endif
/**
* acpi_evaluation_failure_warn - Log evaluation failure warning.
* @handle: Parent object handle.
* @name: Name of the object whose evaluation has failed.
* @status: Status value returned by the failing object evaluation.
*/
void acpi_evaluation_failure_warn(acpi_handle handle, const char *name,
acpi_status status)
{
acpi_handle_warn(handle, "%s evaluation failed: %s\n", name,
acpi_format_exception(status));
}
EXPORT_SYMBOL_GPL(acpi_evaluation_failure_warn);
/**
* acpi_has_method: Check whether @handle has a method named @name
* @handle: ACPI device handle
......@@ -797,7 +811,7 @@ static int acpi_dev_match_cb(struct device *dev, const void *data)
* Note that if the device is pluggable, it may since have disappeared.
*
* Note that unlike acpi_dev_found() this function checks the status
* of the device. So for devices which are present in the dsdt, but
* of the device. So for devices which are present in the DSDT, but
* which are disabled (their _STA callback returns 0) this function
* will return false.
*
......@@ -824,7 +838,7 @@ EXPORT_SYMBOL(acpi_dev_present);
/**
* acpi_dev_get_next_match_dev - Return the next match of ACPI device
* @adev: Pointer to the previous acpi_device matching this @hid, @uid and @hrv
* @adev: Pointer to the previous ACPI device matching this @hid, @uid and @hrv
* @hid: Hardware ID of the device.
* @uid: Unique ID of the device, pass NULL to not check _UID
* @hrv: Hardware Revision of the device, pass -1 to not check _HRV
......@@ -832,7 +846,11 @@ EXPORT_SYMBOL(acpi_dev_present);
* Return the next match of ACPI device if another matching device was present
* at the moment of invocation, or NULL otherwise.
*
* The caller is responsible to call put_device() on the returned device.
* FIXME: The function does not tolerate the sudden disappearance of @adev, e.g.
* in the case of a hotplug event. That said, the caller should ensure that
* this will never happen.
*
* The caller is responsible for invoking acpi_dev_put() on the returned device.
*
* See additional information in acpi_dev_present() as well.
*/
......@@ -861,7 +879,7 @@ EXPORT_SYMBOL(acpi_dev_get_next_match_dev);
* Return the first match of ACPI device if a matching device was present
* at the moment of invocation, or NULL otherwise.
*
* The caller is responsible to call put_device() on the returned device.
* The caller is responsible for invoking acpi_dev_put() on the returned device.
*
* See additional information in acpi_dev_present() as well.
*/
......@@ -872,6 +890,17 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
}
EXPORT_SYMBOL(acpi_dev_get_first_match_dev);
/**
* acpi_reduced_hardware - Return if this is an ACPI-reduced-hw machine
*
* Return true when running on an ACPI-reduced-hw machine, false otherwise.
*/
bool acpi_reduced_hardware(void)
{
return acpi_gbl_reduced_hardware;
}
EXPORT_SYMBOL_GPL(acpi_reduced_hardware);
/*
* acpi_backlight= handling, this is done here rather then in video_detect.c
* because __setup cannot be used in modules.
......
......@@ -385,6 +385,30 @@ static const struct dmi_system_id video_detect_dmi_table[] = {
DMI_MATCH(DMI_BOARD_NAME, "BA51_MV"),
},
},
{
.callback = video_detect_force_native,
.ident = "ASUSTeK COMPUTER INC. GA401",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "GA401"),
},
},
{
.callback = video_detect_force_native,
.ident = "ASUSTeK COMPUTER INC. GA502",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "GA502"),
},
},
{
.callback = video_detect_force_native,
.ident = "ASUSTeK COMPUTER INC. GA503",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
DMI_MATCH(DMI_PRODUCT_NAME, "GA503"),
},
},
/*
* Desktops which falsely report a backlight and which our heuristics
......
......@@ -20,7 +20,6 @@
#include <linux/acpi.h>
#define ACPI_POWER_METER_NAME "power_meter"
ACPI_MODULE_NAME(ACPI_POWER_METER_NAME);
#define ACPI_POWER_METER_DEVICE_NAME "Power Meter"
#define ACPI_POWER_METER_CLASS "pwr_meter_resource"
......@@ -114,7 +113,8 @@ static int update_avg_interval(struct acpi_power_meter_resource *resource)
status = acpi_evaluate_integer(resource->acpi_dev->handle, "_GAI",
NULL, &data);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _GAI"));
acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_GAI",
status);
return -ENODEV;
}
......@@ -166,7 +166,8 @@ static ssize_t set_avg_interval(struct device *dev,
mutex_unlock(&resource->lock);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PAI"));
acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PAI",
status);
return -EINVAL;
}
......@@ -186,7 +187,8 @@ static int update_cap(struct acpi_power_meter_resource *resource)
status = acpi_evaluate_integer(resource->acpi_dev->handle, "_GHL",
NULL, &data);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _GHL"));
acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_GHL",
status);
return -ENODEV;
}
......@@ -237,7 +239,8 @@ static ssize_t set_cap(struct device *dev, struct device_attribute *devattr,
mutex_unlock(&resource->lock);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _SHL"));
acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_SHL",
status);
return -EINVAL;
}
......@@ -270,7 +273,8 @@ static int set_acpi_trip(struct acpi_power_meter_resource *resource)
status = acpi_evaluate_integer(resource->acpi_dev->handle, "_PTP",
&args, &data);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PTP"));
acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PTP",
status);
return -EINVAL;
}
......@@ -322,7 +326,8 @@ static int update_meter(struct acpi_power_meter_resource *resource)
status = acpi_evaluate_integer(resource->acpi_dev->handle, "_PMM",
NULL, &data);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PMM"));
acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PMM",
status);
return -ENODEV;
}
......@@ -549,7 +554,8 @@ static int read_domain_devices(struct acpi_power_meter_resource *resource)
status = acpi_evaluate_object(resource->acpi_dev->handle, "_PMD", NULL,
&buffer);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PMD"));
acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PMD",
status);
return -ENODEV;
}
......@@ -745,7 +751,8 @@ static int read_capabilities(struct acpi_power_meter_resource *resource)
status = acpi_evaluate_object(resource->acpi_dev->handle, "_PMC", NULL,
&buffer);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _PMC"));
acpi_evaluation_failure_warn(resource->acpi_dev->handle, "_PMC",
status);
return -ENODEV;
}
......@@ -765,7 +772,9 @@ static int read_capabilities(struct acpi_power_meter_resource *resource)
status = acpi_extract_package(pss, &format, &state);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Invalid data"));
dev_err(&resource->acpi_dev->dev, ACPI_POWER_METER_NAME
"_PMC package parsing failed: %s\n",
acpi_format_exception(status));
res = -EFAULT;
goto end;
}
......
......@@ -29,8 +29,6 @@
#define ACPI_ALS_DEVICE_NAME "acpi-als"
#define ACPI_ALS_NOTIFY_ILLUMINANCE 0x80
ACPI_MODULE_NAME("acpi-als");
/*
* So far, there's only one channel in here, but the specification for
* ACPI0008 says there can be more to what the block can report. Like
......@@ -93,7 +91,7 @@ static int acpi_als_read_value(struct acpi_als *als, char *prop, s32 *val)
&temp_val);
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status, "Error reading ALS %s", prop));
acpi_evaluation_failure_warn(als->device->handle, prop, status);
return -EIO;
}
......
......@@ -362,7 +362,7 @@
*
* A less-safe version of the macros is provided for optional use if the
* compiler uses excessive CPU stack (for example, this may happen in the
* debug case if code optimzation is disabled.)
* debug case if code optimization is disabled.)
*/
/* Exit trace helper macro */
......
......@@ -78,6 +78,7 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const guid_t *guid, u64 rev,
bool acpi_dev_found(const char *hid);
bool acpi_dev_present(const char *hid, const char *uid, s64 hrv);
bool acpi_reduced_hardware(void);
#ifdef CONFIG_ACPI
......@@ -689,11 +690,30 @@ acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const cha
struct acpi_device *
acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv);
/**
* for_each_acpi_dev_match - iterate over ACPI devices that matching the criteria
* @adev: pointer to the matching ACPI device, NULL at the end of the loop
* @hid: Hardware ID of the device.
* @uid: Unique ID of the device, pass NULL to not check _UID
* @hrv: Hardware Revision of the device, pass -1 to not check _HRV
*
* The caller is responsible for invoking acpi_dev_put() on the returned device.
*
* FIXME: Due to above requirement there is a window that may invalidate @adev
* and next iteration will use a dangling pointer, e.g. in the case of a
* hotplug event. That said, the caller should ensure that this will never
* happen.
*/
#define for_each_acpi_dev_match(adev, hid, uid, hrv) \
for (adev = acpi_dev_get_first_match_dev(hid, uid, hrv); \
adev; \
adev = acpi_dev_get_next_match_dev(adev, hid, uid, hrv))
static inline struct acpi_device *acpi_dev_get(struct acpi_device *adev)
{
return adev ? to_acpi_device(get_device(&adev->dev)) : NULL;
}
static inline void acpi_dev_put(struct acpi_device *adev)
{
put_device(&adev->dev);
......
......@@ -11,18 +11,6 @@
#define ACPI_MAX_STRING 80
/*
* Please update drivers/acpi/debug.c and Documentation/firmware-guide/acpi/debug.rst
* if you add to this list.
*/
#define ACPI_SBS_COMPONENT 0x00100000
#define ACPI_FAN_COMPONENT 0x00200000
#define ACPI_PCI_COMPONENT 0x00400000
#define ACPI_CONTAINER_COMPONENT 0x01000000
#define ACPI_SYSTEM_COMPONENT 0x02000000
#define ACPI_MEMORY_DEVICE_COMPONENT 0x08000000
#define ACPI_PROCESSOR_COMPONENT 0x20000000
/*
* _HID definitions
* HIDs must conform to ACPI spec(6.1.4)
......
......@@ -12,7 +12,7 @@
/* Current ACPICA subsystem version in YYYYMMDD format */
#define ACPI_CA_VERSION 0x20210105
#define ACPI_CA_VERSION 0x20210331
#include <acpi/acconfig.h>
#include <acpi/actypes.h>
......
......@@ -381,7 +381,7 @@ struct acpi_resource_gpio {
#define ACPI_IO_RESTRICT_OUTPUT 2
#define ACPI_IO_RESTRICT_NONE_PRESERVE 3
/* Common structure for I2C, SPI, and UART serial descriptors */
/* Common structure for I2C, SPI, UART, CSI2 serial descriptors */
#define ACPI_RESOURCE_SERIAL_COMMON \
u8 revision_id; \
......@@ -403,6 +403,7 @@ ACPI_RESOURCE_SERIAL_COMMON};
#define ACPI_RESOURCE_SERIAL_TYPE_I2C 1
#define ACPI_RESOURCE_SERIAL_TYPE_SPI 2
#define ACPI_RESOURCE_SERIAL_TYPE_UART 3
#define ACPI_RESOURCE_SERIAL_TYPE_CSI2 4
/* Values for slave_mode field above */
......@@ -505,6 +506,11 @@ struct acpi_resource_uart_serialbus {
#define ACPI_UART_CLEAR_TO_SEND (1<<6)
#define ACPI_UART_REQUEST_TO_SEND (1<<7)
struct acpi_resource_csi2_serialbus {
ACPI_RESOURCE_SERIAL_COMMON u8 local_port_instance;
u8 phy_type;
};
struct acpi_resource_pin_function {
u8 revision_id;
u8 pin_config;
......@@ -634,6 +640,7 @@ union acpi_resource_data {
struct acpi_resource_i2c_serialbus i2c_serial_bus;
struct acpi_resource_spi_serialbus spi_serial_bus;
struct acpi_resource_uart_serialbus uart_serial_bus;
struct acpi_resource_csi2_serialbus csi2_serial_bus;
struct acpi_resource_common_serialbus common_serial_bus;
struct acpi_resource_pin_function pin_function;
struct acpi_resource_pin_config pin_config;
......
......@@ -28,6 +28,7 @@
#define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */
#define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */
#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
#define ACPI_SIG_CEDT "CEDT" /* CXL Early Discovery Table */
#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
#define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */
#define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */
......@@ -301,6 +302,49 @@ struct acpi_table_boot {
u8 reserved[3];
};
/*******************************************************************************
*
* CEDT - CXL Early Discovery Table
* Version 1
*
* Conforms to the "CXL Early Discovery Table" (CXL 2.0)
*
******************************************************************************/
struct acpi_table_cedt {
struct acpi_table_header header; /* Common ACPI table header */
};
/* CEDT subtable header (Performance Record Structure) */
struct acpi_cedt_header {
u8 type;
u8 reserved;
u16 length;
};
/* Values for Type field above */
enum acpi_cedt_type {
ACPI_CEDT_TYPE_CHBS = 0,
ACPI_CEDT_TYPE_RESERVED = 1
};
/*
* CEDT subtables
*/
/* 0: CXL Host Bridge Structure */
struct acpi_cedt_chbs {
struct acpi_cedt_header header;
u32 uid;
u32 cxl_version;
u32 reserved;
u64 base;
u64 length;
};
/*******************************************************************************
*
* CPEP - Corrected Platform Error Polling table (ACPI 4.0)
......@@ -1445,7 +1489,8 @@ struct acpi_hmat_locality {
struct acpi_hmat_structure header;
u8 flags;
u8 data_type;
u16 reserved1;
u8 min_transfer_size;
u8 reserved1;
u32 number_of_initiator_Pds;
u32 number_of_target_Pds;
u32 reserved2;
......@@ -1454,15 +1499,18 @@ struct acpi_hmat_locality {
/* Masks for Flags field above */
#define ACPI_HMAT_MEMORY_HIERARCHY (0x0F)
#define ACPI_HMAT_MEMORY_HIERARCHY (0x0F) /* Bits 0-3 */
/* Values for Memory Hierarchy flag */
/* Values for Memory Hierarchy flags */
#define ACPI_HMAT_MEMORY 0
#define ACPI_HMAT_LAST_LEVEL_CACHE 1
#define ACPI_HMAT_1ST_LEVEL_CACHE 2
#define ACPI_HMAT_2ND_LEVEL_CACHE 3
#define ACPI_HMAT_3RD_LEVEL_CACHE 4
#define ACPI_HMAT_MINIMUM_XFER_SIZE 0x10 /* Bit 4: ACPI 6.4 */
#define ACPI_HMAT_NON_SEQUENTIAL_XFERS 0x20 /* Bit 5: ACPI 6.4 */
/* Values for data_type field above */
......
This diff is collapsed.
......@@ -33,6 +33,7 @@
#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
#define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */
#define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */
#define ACPI_SIG_VIOT "VIOT" /* Virtual I/O Translation Table */
#define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */
#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
......@@ -285,7 +286,8 @@ struct acpi_srat_generic_affinity {
/* Flags for struct acpi_srat_generic_affinity */
#define ACPI_SRAT_GENERIC_AFFINITY_ENABLED (1) /* 00: Use affinity structure */
#define ACPI_SRAT_GENERIC_AFFINITY_ENABLED (1) /* 00: Use affinity structure */
#define ACPI_SRAT_ARCHITECTURAL_TRANSACTIONS (1<<1) /* ACPI 6.4 */
/*******************************************************************************
*
......@@ -483,6 +485,72 @@ struct acpi_table_uefi {
u16 data_offset; /* Offset of remaining data in table */
};
/*******************************************************************************
*
* VIOT - Virtual I/O Translation Table
* Version 1
*
******************************************************************************/
struct acpi_table_viot {
struct acpi_table_header header; /* Common ACPI table header */
u16 node_count;
u16 node_offset;
u8 reserved[8];
};
/* VIOT subtable header */
struct acpi_viot_header {
u8 type;
u8 reserved;
u16 length;
};
/* Values for Type field above */
enum acpi_viot_node_type {
ACPI_VIOT_NODE_PCI_RANGE = 0x01,
ACPI_VIOT_NODE_MMIO = 0x02,
ACPI_VIOT_NODE_VIRTIO_IOMMU_PCI = 0x03,
ACPI_VIOT_NODE_VIRTIO_IOMMU_MMIO = 0x04,
ACPI_VIOT_RESERVED = 0x05
};
/* VIOT subtables */
struct acpi_viot_pci_range {
struct acpi_viot_header header;
u32 endpoint_start;
u16 segment_start;
u16 segment_end;
u16 bdf_start;
u16 bdf_end;
u16 output_node;
u8 reserved[6];
};
struct acpi_viot_mmio {
struct acpi_viot_header header;
u32 endpoint;
u64 base_address;
u16 output_node;
u8 reserved[6];
};
struct acpi_viot_virtio_iommu_pci {
struct acpi_viot_header header;
u16 segment;
u16 bdf;
u8 reserved[8];
};
struct acpi_viot_virtio_iommu_mmio {
struct acpi_viot_header header;
u8 reserved[4];
u64 base_address;
};
/*******************************************************************************
*
* WAET - Windows ACPI Emulated devices Table
......
......@@ -68,5 +68,6 @@
#define UUID_DEVICE_GRAPHS "ab02a46b-74c7-45a2-bd68-f7d344ef2153"
#define UUID_HIERARCHICAL_DATA_EXTENSION "dbb8e3e6-5886-4ba6-8795-1319f52a966b"
#define UUID_CORESIGHT_GRAPH "3ecbc8b6-1d0e-4fb3-8107-e627f805c6cd"
#define UUID_USB4_CAPABILITIES "23a0d13a-26ab-486c-9c5f-0ffa525a575a"
#endif /* __ACUUID_H__ */
......@@ -11,6 +11,7 @@
#define _CPPC_ACPI_H
#include <linux/acpi.h>
#include <linux/cpufreq.h>
#include <linux/types.h>
#include <acpi/pcc.h>
......@@ -132,6 +133,7 @@ struct cppc_cpudata {
cpumask_var_t shared_cpu_map;
};
#ifdef CONFIG_ACPI_CPPC_LIB
extern int cppc_get_desired_perf(int cpunum, u64 *desired_perf);
extern int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs);
extern int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls);
......@@ -142,5 +144,43 @@ extern unsigned int cppc_get_transition_latency(int cpu);
extern bool cpc_ffh_supported(void);
extern int cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val);
extern int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val);
#else /* !CONFIG_ACPI_CPPC_LIB */
static inline int cppc_get_desired_perf(int cpunum, u64 *desired_perf)
{
return -ENOTSUPP;
}
static inline int cppc_get_perf_ctrs(int cpu, struct cppc_perf_fb_ctrs *perf_fb_ctrs)
{
return -ENOTSUPP;
}
static inline int cppc_set_perf(int cpu, struct cppc_perf_ctrls *perf_ctrls)
{
return -ENOTSUPP;
}
static inline int cppc_get_perf_caps(int cpu, struct cppc_perf_caps *caps)
{
return -ENOTSUPP;
}
static inline bool acpi_cpc_valid(void)
{
return false;
}
static inline unsigned int cppc_get_transition_latency(int cpu)
{
return CPUFREQ_ETERNAL;
}
static inline bool cpc_ffh_supported(void)
{
return false;
}
static inline int cpc_read_ffh(int cpunum, struct cpc_reg *reg, u64 *val)
{
return -ENOTSUPP;
}
static inline int cpc_write_ffh(int cpunum, struct cpc_reg *reg, u64 val)
{
return -ENOTSUPP;
}
#endif /* !CONFIG_ACPI_CPPC_LIB */
#endif /* _CPPC_ACPI_H*/
......@@ -61,7 +61,7 @@ typedef __builtin_va_list va_list;
#endif
/*
* Explictly mark intentional explicit fallthrough to silence
* Explicitly mark intentional explicit fallthrough to silence
* -Wimplicit-fallthrough in GCC 7.1+.
*/
......
......@@ -748,6 +748,11 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
return NULL;
}
static inline bool acpi_reduced_hardware(void)
{
return false;
}
static inline void acpi_dev_put(struct acpi_device *adev) {}
static inline bool is_acpi_node(const struct fwnode_handle *fwnode)
......@@ -1034,9 +1039,14 @@ static inline void acpi_ec_set_gpe_wake_mask(u8 action) {}
__printf(3, 4)
void acpi_handle_printk(const char *level, acpi_handle handle,
const char *fmt, ...);
void acpi_evaluation_failure_warn(acpi_handle handle, const char *name,
acpi_status status);
#else /* !CONFIG_ACPI */
static inline __printf(3, 4) void
acpi_handle_printk(const char *level, void *handle, const char *fmt, ...) {}
static inline void acpi_evaluation_failure_warn(acpi_handle handle,
const char *name,
acpi_status status) {}
#endif /* !CONFIG_ACPI */
#if defined(CONFIG_ACPI) && defined(CONFIG_DYNAMIC_DEBUG)
......
......@@ -332,7 +332,7 @@ static inline void irqresource_disabled(struct resource *res, u32 irq)
{
res->start = irq;
res->end = irq;
res->flags = IORESOURCE_IRQ | IORESOURCE_DISABLED | IORESOURCE_UNSET;
res->flags |= IORESOURCE_IRQ | IORESOURCE_DISABLED | IORESOURCE_UNSET;
}
extern struct address_space *iomem_get_mapping(void);
......
// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
/******************************************************************************
*
* Module Name: cfsize - Common get file size function
* Module Name: cmfsize - Common get file size function
*
* Copyright (C) 2000 - 2021, Intel Corp.
*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment