Commit 118d6e98 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ACPI updates from Rafael Wysocki:
 "These update the ACPICA code in the kernel to upstream revision
  20200430, fix several reference counting errors related to ACPI
  tables, add _Exx / _Lxx support to the GED driver, add a new
  acpi_evaluate_reg() helper, add new DPTF battery participant driver
  and extend the DPFT power participant driver, improve the handling of
  memory failures in the APEI code, add a blacklist entry to the
  backlight driver, update the PMIC driver and the processor idle
  driver, fix two kobject reference count leaks, and make a few janitory
  changes.

  Specifics:

   - Update the ACPICA code in the kernel to upstream revision 20200430:

      - Move acpi_gbl_next_cmd_num definition (Erik Kaneda).

      - Ignore AE_ALREADY_EXISTS status in the disassembler when parsing
        create operators (Erik Kaneda).

      - Add status checks to the dispatcher (Erik Kaneda).

      - Fix required parameters for _NIG and _NIH (Erik Kaneda).

      - Make acpi_protocol_lengths static (Yue Haibing).

   - Fix ACPI table reference counting errors in several places, mostly
     in error code paths (Hanjun Guo).

   - Extend the Generic Event Device (GED) driver to support _Exx and
     _Lxx handler methods (Ard Biesheuvel).

   - Add new acpi_evaluate_reg() helper and modify the ACPI PCI hotplug
     code to use it (Hans de Goede).

   - Add new DPTF battery participant driver and make the DPFT power
     participant driver create more sysfs device attributes (Srinivas
     Pandruvada).

   - Improve the handling of memory failures in APEI (James Morse).

   - Add new blacklist entry for Acer TravelMate 5735Z to the backlight
     driver (Paul Menzel).

   - Add i2c address for thermal control to the PMIC driver (Mauro
     Carvalho Chehab).

   - Allow the ACPI processor idle driver to work on platforms with only
     one ACPI C-state present (Zhang Rui).

   - Fix kobject reference count leaks in error code paths in two places
     (Qiushi Wu).

   - Delete unused proc filename macros and make some symbols static
     (Pascal Terjan, Zheng Zengkai, Zou Wei)"

* tag 'acpi-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (32 commits)
  ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe()
  ACPI: sysfs: Fix reference count leak in acpi_sysfs_add_hotplug_profile()
  ACPI: GED: use correct trigger type field in _Exx / _Lxx handling
  ACPI: DPTF: Add battery participant driver
  ACPI: DPTF: Additional sysfs attributes for power participant driver
  ACPI: video: Use native backlight on Acer TravelMate 5735Z
  arm64: acpi: Make apei_claim_sea() synchronise with APEI's irq work
  ACPI: APEI: Kick the memory_failure() queue for synchronous errors
  mm/memory-failure: Add memory_failure_queue_kick()
  ACPI / PMIC: Add i2c address for thermal control
  ACPI: GED: add support for _Exx / _Lxx handler methods
  ACPI: Delete unused proc filename macros
  ACPI: hotplug: PCI: Use the new acpi_evaluate_reg() helper
  ACPI: utils: Add acpi_evaluate_reg() helper
  ACPI: debug: Make two functions static
  ACPI: sleep: Put the FACS table after using it
  ACPI: scan: Put SPCR and STAO table after using it
  ACPI: EC: Put the ACPI table after using it
  ACPI: APEI: Put the HEST table for error path
  ACPI: APEI: Put the error record serialization table for error path
  ...
parents 355ba37d 48ccdedd
Loading
Loading
Loading
Loading
+58 −4
Original line number Diff line number Diff line
@@ -27,10 +27,12 @@ KernelVersion: v4.10
Contact:	linux-acpi@vger.kernel.org
Description:
		(RO) Display the platform power source
		bits[3:0] Current power source
			0x00 = DC
			0x01 = AC
			0x02 = USB
			0x03 = Wireless Charger
		bits[7:4] Power source sequence number

What:		/sys/bus/platform/devices/INT3407:00/dptf_power/battery_steady_power
Date:		Jul, 2016
@@ -38,3 +40,55 @@ KernelVersion: v4.10
Contact:	linux-acpi@vger.kernel.org
Description:
		(RO) The maximum sustained power for battery in milliwatts.

What:		/sys/bus/platform/devices/INT3407:00/dptf_power/rest_of_platform_power_mw
Date:		June, 2020
KernelVersion:	v5.8
Contact:	linux-acpi@vger.kernel.org
Description:
		(RO) Shows the rest (outside of SoC) of worst-case platform power.

What:		/sys/bus/platform/devices/INT3407:00/dptf_power/prochot_confirm
Date:		June, 2020
KernelVersion:	v5.8
Contact:	linux-acpi@vger.kernel.org
Description:
		(WO) Confirm embedded controller about a prochot notification.

What:		/sys/bus/platform/devices/INT3532:00/dptf_battery/max_platform_power_mw
Date:		June, 2020
KernelVersion:	v5.8
Contact:	linux-acpi@vger.kernel.org
Description:
		(RO) The maximum platform power that can be supported by the battery in milli watts.

What:		/sys/bus/platform/devices/INT3532:00/dptf_battery/max_steady_state_power_mw
Date:		June, 2020
KernelVersion:	v5.8
Contact:	linux-acpi@vger.kernel.org
Description:
		(RO) The maximum sustained power for battery in milli watts.

What:		/sys/bus/platform/devices/INT3532:00/dptf_battery/high_freq_impedance_mohm
Date:		June, 2020
KernelVersion:	v5.8
Contact:	linux-acpi@vger.kernel.org
Description:
		(RO) The high frequency impedance value that can be obtained from battery
		fuel gauge in milli Ohms.

What:		/sys/bus/platform/devices/INT3532:00/dptf_battery/no_load_voltage_mv
Date:		June, 2020
KernelVersion:	v5.8
Contact:	linux-acpi@vger.kernel.org
Description:
		(RO) The no-load voltage that can be obtained from battery fuel gauge in
		milli volts.

What:		/sys/bus/platform/devices/INT3532:00/dptf_battery/current_discharge_capbility_ma
Date:		June, 2020
KernelVersion:	v5.8
Contact:	linux-acpi@vger.kernel.org
Description:
		(RO) The battery discharge current capability obtained from battery fuel gauge in
		milli Amps.
+25 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/irqdomain.h>
#include <linux/irq_work.h>
#include <linux/memblock.h>
#include <linux/of_fdt.h>
#include <linux/smp.h>
@@ -269,6 +270,7 @@ pgprot_t __acpi_get_mem_attribute(phys_addr_t addr)
int apei_claim_sea(struct pt_regs *regs)
{
	int err = -ENOENT;
	bool return_to_irqs_enabled;
	unsigned long current_flags;

	if (!IS_ENABLED(CONFIG_ACPI_APEI_GHES))
@@ -276,6 +278,12 @@ int apei_claim_sea(struct pt_regs *regs)

	current_flags = local_daif_save_flags();

	/* current_flags isn't useful here as daif doesn't tell us about pNMI */
	return_to_irqs_enabled = !irqs_disabled_flags(arch_local_save_flags());

	if (regs)
		return_to_irqs_enabled = interrupts_enabled(regs);

	/*
	 * SEA can interrupt SError, mask it and describe this as an NMI so
	 * that APEI defers the handling.
@@ -284,6 +292,23 @@ int apei_claim_sea(struct pt_regs *regs)
	nmi_enter();
	err = ghes_notify_sea();
	nmi_exit();

	/*
	 * APEI NMI-like notifications are deferred to irq_work. Unless
	 * we interrupted irqs-masked code, we can do that now.
	 */
	if (!err) {
		if (return_to_irqs_enabled) {
			local_daif_restore(DAIF_PROCCTX_NOIRQ);
			__irq_enter();
			irq_work_run();
			__irq_exit();
		} else {
			pr_warn_ratelimited("APEI work queued but not completed");
			err = -EINPROGRESS;
		}
	}

	local_daif_restore(current_flags);

	return err;
+7 −5
Original line number Diff line number Diff line
@@ -635,11 +635,13 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)

	inf = esr_to_fault_info(esr);

	if (user_mode(regs) && apei_claim_sea(regs) == 0) {
		/*
	 * Return value ignored as we rely on signal merging.
	 * Future patches will make this more robust.
		 * APEI claimed this as a firmware-first notification.
		 * Some processing deferred to task_work before ret_to_user().
		 */
	apei_claim_sea(regs);
		return 0;
	}

	if (esr & ESR_ELx_FnV)
		siaddr = NULL;
+2 −2
Original line number Diff line number Diff line
@@ -745,7 +745,7 @@ static const struct acpi_debugger_ops acpi_aml_debugger = {
	.notify_command_complete = acpi_aml_notify_command_complete,
};

int __init acpi_aml_init(void)
static int __init acpi_aml_init(void)
{
	int ret;

@@ -771,7 +771,7 @@ int __init acpi_aml_init(void)
	return 0;
}

void __exit acpi_aml_exit(void)
static void __exit acpi_aml_exit(void)
{
	if (acpi_aml_initialized) {
		acpi_unregister_debugger(&acpi_aml_debugger);
+2 −1
Original line number Diff line number Diff line
@@ -151,10 +151,11 @@ void acpi_init_lpit(void)
	struct acpi_table_lpit *lpit;

	status = acpi_get_table(ACPI_SIG_LPIT, 0, (struct acpi_table_header **)&lpit);

	if (ACPI_FAILURE(status))
		return;

	lpit_process((u64)lpit + sizeof(*lpit),
		     (u64)lpit + lpit->header.length);

	acpi_put_table((struct acpi_table_header *)lpit);
}
Loading