Skip to content

Commit

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

Pull ACPI updates from Rafael Wysocki:
 "These are some device enumeration code changes, updates of the AC and
  battery drivers to help them avoid attaching to devices that cannot be
  handled by them, new operation region driver for the Intel CHT Whiskey
  Cove PMIC, new sysfs entries for CPPC performance capabilities, a new
  _REV quirk blacklist entry and a couple of assorted minor fixes and
  cleanups.

  Specifics:

   - Update the core device enumeration code to make it more internally
     consistent and robust and drop the force_remove sysfs attribute
     that could be used to tell it to ignore errors on device
     hot-removal which was dangerous in general and no real and still
     relevant use cases for it could be found (Rafael Wysocki, Michal
     Hocko).

   - Make the core device enumeration code use _PXM to associate
     platform devices created by it with specific NUMA nodes (Shanker
     Donthineni).

   - Extend the CPPC library by adding more sysfs entries for
     performance capabilities to it and making it use the lowest
     nonlinear performance parameter (Prashanth Prakash).

   - Make the CPU online more consistent with CPU initialization in the
     ACPI processor driver (Prashanth Prakash).

   - Update the AC and battery drivers to help them avoid attaching to
     devices that cannot be handled by them and update the
     axp288_charger power supply driver to work correctly on ACPI
     systems without the INT3496 device (Hans de Goede).

   - Add an ACPI operation region driver for the Intel CHT Whiskey Cove
     PMIC and update the xpower operation region driver to work without
     IIO which isn't really necessary for it to work (Hans de Goede).

   - Add a new entry for Dell Inspiron 7537 to the _REV quirk blacklist
     (Kai Heng Feng).

   - Make the code in the ACPI video driver easier to follow by adding
     symbols and comments to it (Dmitry Frank).

   - Update ACPI documentation and drop a function that has no users
     from the tables-handling code (Cao jin, Baoquan He)"

* tag 'acpi-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / PMIC: Stop xpower OPRegion handler relying on IIO
  ACPI / PMIC: Add opregion driver for Intel CHT Whiskey Cove PMIC
  ACPI / scan: Avoid enumerating devices more than once
  ACPI / scan: Apply default enumeration to devices with ACPI drivers
  power: supply: axp288_charger: Only wait for INT3496 device if present
  ACPI / AC: Add a blacklist with PMIC ACPI HIDs with a native charger driver
  ACPI / battery: Add a blacklist with PMIC ACPI HIDs with a native battery driver
  ACPI / battery: Fix acpi_battery_exit on acpi_battery_init_async errors
  ACPI / utils: Add new acpi_dev_present helper
  ACPI / video: add comments about subtle cases
  ACPI / video: get rid of magic numbers and use enum instead
  ACPI / doc: linuxized-acpica.txt: fix typos
  ACPI / blacklist: add _REV quirk for Dell Inspiron 7537
  ACPI / tables: Drop acpi_parse_entries() which is not used
  ACPI / CPPC: add sysfs entries for CPPC perf capabilities
  ACPI / CPPC: Read lowest nonlinear perf in cppc_get_perf_caps()
  ACPI / platform: Update platform device NUMA node based on _PXM method
  ACPI / Processor: Drop setup_max_cpus check from acpi_processor_add()
  ACPI / scan: Drop support for force_remove
  • Loading branch information
torvalds committed May 1, 2017
2 parents 0e285e9 + 52e70c8 commit 08be881
Show file tree
Hide file tree
Showing 23 changed files with 617 additions and 176 deletions.
8 changes: 8 additions & 0 deletions Documentation/ABI/obsolete/sysfs-firmware-acpi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
What: /sys/firmware/acpi/hotplug/force_remove
Date: Mar 2017
Contact: Rafael J. Wysocki <[email protected]>
Description:
Since the force_remove is inherently broken and dangerous to
use for some hotplugable resources like memory (because ignoring
the offline failure might lead to memory corruption and crashes)
enabling this knob is not safe and thus unsupported.
10 changes: 0 additions & 10 deletions Documentation/ABI/testing/sysfs-firmware-acpi
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ Description:
or 0 (unset). Attempts to write any other values to it will
cause -EINVAL to be returned.

What: /sys/firmware/acpi/hotplug/force_remove
Date: May 2013
Contact: Rafael J. Wysocki <[email protected]>
Description:
The number in this file (0 or 1) determines whether (1) or not
(0) the ACPI subsystem will allow devices to be hot-removed even
if they cannot be put offline gracefully (from the kernel's
viewpoint). That number can be changed by writing a boolean
value to this file.

What: /sys/firmware/acpi/interrupts/
Date: February 2008
Contact: Len Brown <[email protected]>
Expand Down
10 changes: 5 additions & 5 deletions Documentation/acpi/linuxized-acpica.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ upstream.
The homepage of ACPICA project is: www.acpica.org, it is maintained and
supported by Intel Corporation.

The following figure depicts the Linux ACPI subystem where the ACPICA
The following figure depicts the Linux ACPI subsystem where the ACPICA
adaptation is included:

+---------------------------------------------------------+
Expand Down Expand Up @@ -110,7 +110,7 @@ upstream.
Linux patches. The patches generated by this process are referred to as
"linuxized ACPICA patches". The release process is carried out on a local
copy the ACPICA git repository. Each commit in the monthly release is
converted into a linuxized ACPICA patch. Together, they form the montly
converted into a linuxized ACPICA patch. Together, they form the monthly
ACPICA release patchset for the Linux ACPI community. This process is
illustrated in the following figure:

Expand Down Expand Up @@ -165,7 +165,7 @@ upstream.
<http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git>.

Before the linuxized ACPICA patches are sent to the Linux ACPI community
for review, there is a quality ensurance build test process to reduce
for review, there is a quality assurance build test process to reduce
porting issues. Currently this build process only takes care of the
following kernel configuration options:
CONFIG_ACPI/CONFIG_ACPI_DEBUG/CONFIG_ACPI_DEBUGGER
Expand Down Expand Up @@ -195,12 +195,12 @@ upstream.
release utilities (please refer to Section 4 below for the details).
3. Linux specific features - Sometimes it's impossible to use the
current ACPICA APIs to implement features required by the Linux kernel,
so Linux developers occasionaly have to change ACPICA code directly.
so Linux developers occasionally have to change ACPICA code directly.
Those changes may not be acceptable by ACPICA upstream and in such cases
they are left as committed ACPICA divergences unless the ACPICA side can
implement new mechanisms as replacements for them.
4. ACPICA release fixups - ACPICA only tests commits using a set of the
user space simulation utilies, thus the linuxized ACPICA patches may
user space simulation utilities, thus the linuxized ACPICA patches may
break the Linux kernel, leaving us build/boot failures. In order to
avoid breaking Linux bisection, fixes are applied directly to the
linuxized ACPICA patches during the release process. When the release
Expand Down
8 changes: 7 additions & 1 deletion drivers/acpi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ config CRC_PMIC_OPREGION

config XPOWER_PMIC_OPREGION
bool "ACPI operation region support for XPower AXP288 PMIC"
depends on AXP288_ADC = y
depends on MFD_AXP20X_I2C
help
This config adds ACPI operation region support for XPower AXP288 PMIC.

Expand All @@ -515,6 +515,12 @@ config BXT_WC_PMIC_OPREGION
help
This config adds ACPI operation region support for BXT WhiskeyCove PMIC.

config CHT_WC_PMIC_OPREGION
bool "ACPI operation region support for CHT Whiskey Cove PMIC"
depends on INTEL_SOC_PMIC_CHTWC
help
This config adds ACPI operation region support for CHT Whiskey Cove PMIC.

endif

config ACPI_CONFIGFS
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ obj-$(CONFIG_PMIC_OPREGION) += pmic/intel_pmic.o
obj-$(CONFIG_CRC_PMIC_OPREGION) += pmic/intel_pmic_crc.o
obj-$(CONFIG_XPOWER_PMIC_OPREGION) += pmic/intel_pmic_xpower.o
obj-$(CONFIG_BXT_WC_PMIC_OPREGION) += pmic/intel_pmic_bxtwc.o
obj-$(CONFIG_CHT_WC_PMIC_OPREGION) += pmic/intel_pmic_chtwc.o

obj-$(CONFIG_ACPI_CONFIGFS) += acpi_configfs.o

Expand Down
20 changes: 20 additions & 0 deletions drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,23 @@ static int acpi_ac_add(struct acpi_device *device);
static int acpi_ac_remove(struct acpi_device *device);
static void acpi_ac_notify(struct acpi_device *device, u32 event);

struct acpi_ac_bl {
const char *hid;
int hrv;
};

static const struct acpi_device_id ac_device_ids[] = {
{"ACPI0003", 0},
{"", 0},
};
MODULE_DEVICE_TABLE(acpi, ac_device_ids);

/* Lists of PMIC ACPI HIDs with an (often better) native charger driver */
static const struct acpi_ac_bl acpi_ac_blacklist[] = {
{ "INT33F4", -1 }, /* X-Powers AXP288 PMIC */
{ "INT34D3", 3 }, /* Intel Cherrytrail Whiskey Cove PMIC */
};

#ifdef CONFIG_PM_SLEEP
static int acpi_ac_resume(struct device *dev);
#endif
Expand Down Expand Up @@ -424,11 +435,20 @@ static int acpi_ac_remove(struct acpi_device *device)

static int __init acpi_ac_init(void)
{
unsigned int i;
int result;

if (acpi_disabled)
return -ENODEV;

for (i = 0; i < ARRAY_SIZE(acpi_ac_blacklist); i++)
if (acpi_dev_present(acpi_ac_blacklist[i].hid, "1",
acpi_ac_blacklist[i].hrv)) {
pr_info(PREFIX "AC: found native %s PMIC, not loading\n",
acpi_ac_blacklist[i].hid);
return -ENODEV;
}

#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_ac_dir = acpi_lock_ac_dir();
if (!acpi_ac_dir)
Expand Down
5 changes: 4 additions & 1 deletion drivers/acpi/acpi_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,14 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev,
if (IS_ERR(pdev))
dev_err(&adev->dev, "platform device creation failed: %ld\n",
PTR_ERR(pdev));
else
else {
set_dev_node(&pdev->dev, acpi_get_node(adev->handle));
dev_dbg(&adev->dev, "created platform device %s\n",
dev_name(&pdev->dev));
}

kfree(resources);

return pdev;
}
EXPORT_SYMBOL_GPL(acpi_create_platform_device);
5 changes: 0 additions & 5 deletions drivers/acpi/acpi_processor.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,6 @@ static int acpi_processor_add(struct acpi_device *device,
if (result) /* Processor is not physically present or unavailable */
return 0;

#ifdef CONFIG_SMP
if (pr->id >= setup_max_cpus && pr->id != 0)
return 0;
#endif

BUG_ON(pr->id >= nr_cpu_ids);

/*
Expand Down
Loading

0 comments on commit 08be881

Please sign in to comment.