aboutsummaryrefslogtreecommitdiffstats
path: root/include/acpi (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-06-15Merge branch 'acpica-fixes'Rafael J. Wysocki1-0/+14
* acpica-fixes: ACPICA: Tables: Mechanism to handle late stage acpi_get_table() imbalance Revert "ACPICA: Disassembler: Enhance resource descriptor detection"
2017-06-15ACPI / PM: Ignore spurious SCI wakeups from suspend-to-idleRafael J. Wysocki1-1/+5
The ACPI SCI (System Control Interrupt) is set up as a wakeup IRQ during suspend-to-idle transitions and, consequently, any events signaled through it wake up the system from that state. However, on some systems some of the events signaled via the ACPI SCI while suspended to idle should not cause the system to wake up. In fact, quite often they should just be discarded. Arguably, systems should not resume entirely on such events, but in order to decide which events really should cause the system to resume and which are spurious, it is necessary to resume up to the point when ACPI SCIs are actually handled and processed, which is after executing dpm_resume_noirq() in the system resume path. For this reasons, add a loop around freeze_enter() in which the platforms can process events signaled via multiplexed IRQ lines like the ACPI SCI and add suspend-to-idle hooks that can be used for this purpose to struct platform_freeze_ops. In the ACPI case, the ->wake hook is used for checking if the SCI has triggered while suspended and deferring the interrupt-induced system wakeup until the events signaled through it are actually processed sufficiently to decide whether or not the system should resume. In turn, the ->sync hook allows all of the relevant event queues to be flushed so as to prevent events from being missed due to race conditions. In addition to that, some ACPI code processing wakeup events needs to be modified to use the "hard" version of wakeup triggers, so that it will cause a system resume to happen on device-induced wakeup events even if the "soft" mechanism to prevent the system from suspending is not enabled. However, to preserve the existing behavior with respect to suspend-to-RAM, this only is done in the suspend-to-idle case and only if an SCI has occurred while suspended. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-15ACPI / PM: Run wakeup notify handlers synchronouslyRafael J. Wysocki1-2/+2
The work functions provided by the users of acpi_add_pm_notifier() should be run synchronously before re-enabling the wakeup GPE in case they are used to clear the status and/or disable the wakeup signaling at the source. Otherwise, which is the case currently in the PCI bus type code, the same wakeup event may be signaled for multiple times while the execution of the work function in response to it has already been queued up. Fortunately, acpi_add_pm_notifier() is only used by PCI and by ACPI device PM code internally, so the change is relatively straightforward to make. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
2017-06-12ACPICA: OSL: Add support to exclude stdarg.hLv Zheng2-0/+12
ACPICA commit e2df7455a9a4301b03668e4c9c02c7a564cc841c Some hosts may choose not to include stdarg.h, implementing a configurability in acgcc.h, allowing OSen like Solaris to exclude stdarg.h. This patch also fixes acintel.h accordingly without providing builtin support as Intel compiler is similar as GCC. Reported by Dana Myers, fixed by Lv Zheng. Link: https://github.com/acpica/acpica/commit/e2df7455 Reported-by: Dana Myers <dana.myers@oracle.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: ACPI 6.2: Add support for PinGroupConfig() resourceMika Westerberg1-1/+15
ACPICA commit 08b83591c0db751769d61fa889f4f50f575aeffb PinGroupConfig() is analogous to PinGroupFunction() but instead of mode (muxing), it is used to apply specific fine-grained configuration to a set of referenced pins. The format of this new resource is: PinGroupConfig (Shared/Exclusive, PinConfigType, PinConfigValue, ResourceSource, ResourceSourceIndex, ResourceSourceLabel, ResourceUsage, DescriptorName, VendorData) The PinConfigType/PinConfigValue are the same used by PinConfig() resource. Here also the combination of ResourceSource and ResourceSourceLabel is used to specify the PinGroup() this resource refers to. Link: https://github.com/acpica/acpica/commit/08b83591 Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: ACPI 6.2: Add support for PinGroupFunction() resourceMika Westerberg1-1/+14
ACPICA commit bd9a745749eac7137cd23085e6bdeb322de14ea2 PinGroupFunction() is a new resource introduced with ACPI 6.2. It is used with PinGroup() to configure specific mode for a set of pins exposed by a GPIO controller. The format of the resource is: PinGroupFunction (Shared/Exclusive, FunctionNumber, ResourceSource, ResourceSourceIndex, ResourceSourceLabel, ResourceUsage, DescriptorName, VendorData) The resource_source and ResourceSourceLabel fields are used to specify the PinGroup() resource referenced by PinGroupFunction(). Device (GPIO) { Name (_CRS, ResourceTemplate () { PinGroup ("group1") {2, 3} PinGroup ("group2") {4, 5} ... }) } Device (I2C) { Name (_CRS, ResourceTemplate () { PinGroupFunction (Exclusive, 6, "^GPIO", 0, "mygroup2") }) } In the above example the PinGroupFunction() references the second PinGroup() resource (using label "mygroup2" and configures pins 4 and 5 into mode 6. Link: https://github.com/acpica/acpica/commit/bd9a7457 Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: ACPI 6.2: Add support for PinGroup() resourceMika Westerberg1-1/+18
ACPICA commit 7d928e3174fb19d7dc0066b03c30bea07c001563 ACPI 6.2 introduced a new resource that is used to declare set of pins belonging to a GPIO controller. This resource is referenced by new PinGroupFunction() and PinGroupConfig() resources using ResourceSource and ResourceLabel fields. The PinGroup() resource looks like this: PinGroup (ResourceLabel, ResourceUsage, DescriptorName, VendorData) {Pin List} This resource should be listed in _CRS under the GPIO/pincontroller device providing these pins. Link: https://github.com/acpica/acpica/commit/7d928e31 Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: ACPI 6.2: Add support for PinConfig() resourceMika Westerberg1-1/+33
ACPICA commit a06fdba686cefccd5dd5b93b52fa0f1e3f984906 ACPI 6.2 introduced a new resource that is used to specify fine-grained configuration of a pin or set of pins used by a device. The ASL syntax of this new resource looks like: PinConfig (Shared/Exclusive, PinConfigType, PinConfigValue, ResourceSource, ResourceSourceIndex, ResourceUsage, DescriptorName, Vendordata) {Pin List} PinConfigType is an integer with following accepted values: 0x00 (Default) - No configuration is applied to the pin 0x01 (Bias Pull-up) - Pin is pulled up using certain size resistor 0x02 (Bias Pull-down) - Pin is pulled down using certain size resistor 0x03 (Bias Default) - Set to default biasing 0x04 (Bias Disable) - All bias settings will be disabled 0x05 (Bias High Impedance) - Configure the pin as hi_z 0x06 (Bias Bus Hold) - Configure the pin in a weak latch state where it drives the last value on a tristate bus 0x07 (Drive Open Drain) - Configure the pin into open drain state 0x08 (Drive Open Source) - Configure the pin into open source state 0x09 (Drive Push Pull) - Configure the pin into push-pull state 0x0a (Drive Strength) - How much the pin can supply current 0x0b (Slew Rate) - Configure slew rate of the pin 0x0c (Input Debounce) - Enable input debouncer for the pin 0x0d (Input Schmitt Trigger) - Enable schmitt trigger for the pin 0x0e - 0x7f - Reserved 0x80 - 0xff - Vendor defined types The PinConfigValue depends on the type and is expressed as units suitable for that type (for example bias uses Ohms). Link: https://github.com/acpica/acpica/commit/a06fdba6 Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: ACPI 6.2: Add support for PinFunction() resourceMika Westerberg1-1/+15
ACPICA commit 6bbc6357f7061f1243601adde0ea45f7a89274e0 ACPI 6.2 introduced a new resource that is used to describe how certain pins are muxed for a device. The ASL syntax of this new resource looks like below: PinFunction(Shared, PinConfig, FunctionNumber, ResourceSource, ResourceSourceIndex, ResourceUsage, DescriptorName, VendorData) {Pin List} Which is pretty similar to GpioIo()/GpioInt() resources. Teach ACPICA about this new resource. Link: https://github.com/acpica/acpica/commit/6bbc6357 Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Add support for new PCCT subtablesDavid E. Box1-5/+72
ACPICA commit e7b817e3c405a4fb9ae9ee7ae4992b8c1f20d284 Extended PCC Subspaces (types 3 and 4) Link: https://github.com/acpica/acpica/commit/e7b817e3 Signed-off-by: David E. Box <david.e.box@linux.intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Add header support for TPM2 table changesBob Moore1-3/+34
ACPICA commit b922ecaf9053dae3b8933664e951ed1ee8f86f07 Update to new version of the TCG/ACPI spec. Does not include table compiler or disassembler support. Link: https://github.com/acpica/acpica/commit/b922ecaf Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Add support for new SRAT subtableBob Moore1-1/+11
ACPICA commit 5bc67f63918da249bfe279ee461d152bb3e6f55b GIC ITS Affinity (ACPI 6.2) Link: https://github.com/acpica/acpica/commit/5bc67f63 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Add support for new HEST subtableBob Moore1-3/+18
ACPICA commit a1f1056c9e44fd3de8cad3bde89cda5cbb2df466 IA-32 Deferred Machine Check (ACPI 6.2) Link: https://github.com/acpica/acpica/commit/a1f1056c Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Add new flags to HEST subtablesBob Moore1-0/+1
ACPICA commit c2c3807adb8a67e6462b731dc64be35d8b8317f8 Add GHES_ASSIST flag for ACPI 6.2 Add missing GLOBAL flag for AER structures Link: https://github.com/acpica/acpica/commit/c2c3807a Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Tables: Add PPTT table definitionsLv Zheng1-0/+80
ACPICA commit c27465d07fd008ba71c1f687b2715267701bc8ad This patch adds PPTT (Processor Properties Topology Table, defined in ACPI spec 6.2) support in ACPICA core, including table definitions expressed in C structures and macros. Lv Zheng. Link: https://github.com/acpica/acpica/commit/c27465d0 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Add new notify value for HEST tableBob Moore1-1/+2
ACPICA commit 35e06462f3186e1e6e9cb4fe97dfb43d4b3718a2 "Software Delegated Exception" - ACPI 6.2 Link: https://github.com/acpica/acpica/commit/35e06462 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Tables: Fix defined values for MADT PCAT_COMPAT flagJanosch Hildebrand1-2/+2
ACPICA commit c0292548a43bdc5d83d5be2953b663e60b6f12b4 Link: https://github.com/acpica/acpica/issues/224 Link: https://github.com/acpica/acpica/commit/c0292548 Signed-off-by: Janosch Hildebrand <jnosh+git@jnosh.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Update Status field for BGRT tableBob Moore1-0/+5
ACPICA commit dbc6a3d5ff22df730cc81802af0422bb64b19347 Orientation flags added. ACPI 6.2 Link: https://github.com/acpica/acpica/commit/dbc6a3d5 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Added two new UUID valuesBob Moore1-0/+5
ACPICA commit a0168a7aca421d195e1c2b609279fa4a967dd3ac Processor Properties. ACPI 6.2 Link: https://github.com/acpica/acpica/commit/a0168a7a Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Add new notify value for memory attributes updateBob Moore1-1/+2
ACPICA commit d37e878292bc9c7835b74e90d1c4c79e96ce6652 New notify value for memory attributes update for ACPI 6.2. Link: https://github.com/acpica/acpica/commit/d37e8782 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Tables: Add HMAT table definitionsLv Zheng1-0/+117
ACPICA commit 3dae756631c8c2baddfa19f43a379aee42b28312 This patch adds unified HMAT table structure definitions so that ACPICA users can develop HMAT related OS features based on the ACPICA standard structures. Lv Zheng. Link: https://github.com/acpica/acpica/commit/3dae7566 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Tables: Add WSMT supportLv Zheng1-0/+22
ACPICA commit 4f12387029c6a561e7792f53caf2e7f1f0ab2bbe This patch adds WSMT support, the table can be found at Line [#1]. The support includes table structure definitions (ACPICA tables) and assembly/disassembly (iasl) support. Lv Zheng. Link: https://github.com/acpica/acpica/commit/4f123870 Link: https://msdn.microsoft.com/windows/hardware/drivers/bringup/acpi-system-description-tables#wsmt [1] Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-12ACPICA: Tables: Mechanism to handle late stage acpi_get_table() imbalanceLv Zheng1-0/+14
Considering this case: 1. A program opens a sysfs table file 65535 times, it can increase validation_count and first increment cause the table to be mapped: validation_count = 65535 2. AML execution causes "Load" to be executed on the same table, this time it cannot increase validation_count, so validation_count remains: validation_count = 65535 3. The program closes sysfs table file 65535 times, it can decrease validation_count and the last decrement cause the table to be unmapped: validation_count = 0 4. AML code still accessing the loaded table, kernel crash can be observed. To prevent that from happening, add a validation_count threashold. When it is reached, the validation_count can no longer be incremented/decremented to invalidate the table descriptor (means preventing table unmappings) Note that code added in acpi_tb_put_table() is actually a no-op but changes the warning message into a "warn once" one. Lv Zheng. Signed-off-by: Lv Zheng <lv.zheng@intel.com> [ rjw: Changelog, comments ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-07ACPI: Switch to use generic guid_t in acpi_evaluate_dsm()Andy Shevchenko1-5/+6
acpi_evaluate_dsm() and friends take a pointer to a raw buffer of 16 bytes. Instead we convert them to use guid_t type. At the same time we convert current users. acpi_str_to_uuid() becomes useless after the conversion and it's safe to get rid of it. Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Cc: Borislav Petkov <bp@suse.de> Acked-by: Dan Williams <dan.j.williams@intel.com> Cc: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Jani Nikula <jani.nikula@intel.com> Cc: Ben Skeggs <bskeggs@redhat.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Acked-by: Joerg Roedel <jroedel@suse.de> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Yisen Zhuang <yisen.zhuang@huawei.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com> Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> Acked-by: Mark Brown <broonie@kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
2017-05-10Merge tag 'acpi-extra-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pmLinus Torvalds4-1/+21
Pull more ACPI updates from Rafael Wysocki: "These update the ACPICA code in the kernel to upstream revision 20170303 which adds a few minor fixes and improvements, update ACPI SoC drivers with new device IDs, platform-related information and similar, fix the register information in the xpower PMIC driver, introduce a concept of "always present" devices to the ACPI device enumeration code and use it to fix a problem with one platform, and fix a system resume issue related to power resources. Specifics: - Update the ACPICA code in the kernel to upstream revision 20170303 which includes: * Minor fixes and improvements in the core code (Bob Moore, Seunghun Han). * Debugger fixes (Colin Ian King, Lv Zheng). * Compiler/disassembler improvements (Bob Moore, David Box, Lv Zheng). * Build-related update (Lv Zheng). - Add new device IDs and platform-related information to the ACPI drivers for Intel (LPSS) and AMD (APD) SoCs (Hanjun Guo, Hans de Goede). - Make it possible to quirk ACPI-enumerated devices as "always present" on platforms where they are incorrectly reported as not present by the AML and add the INT0002 device ID to the list of "always present" devices (Hans de Goede). - Fix the register information in the xpower PMIC driver and add comments to map the registers to symbols used by AML to it (Hans de Goede). - Move the code turning off unused ACPI power resources during system resume to a point after all devices have been resumed to avoid issues with power resources that do not behave as expected (Hans de Goede)" * tag 'acpi-extra-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (22 commits) ACPI / power: Delay turning off unused power resources after suspend ACPI / PMIC: xpower: Fix power_table addresses ACPI / LPSS: Call pwm_add_table() for Bay Trail PWM device ACPICA: Update version to 20170303 ACPICA: iasl: add ASL conversion tool ACPICA: Local cache support: Allow small cache objects ACPICA: Disassembler: Do not unconditionally remove temporary names ACPICA: iasl: Fix IORT SMMU GSI disassembling ACPICA: Cleanup AML opcode definitions, no functional change ACPICA: Debugger: Add interpreter blocking mark for single-step mode ACPICA: debugger: fix memory leak on Pathname ACPICA: Update for automatic repair code for objects returned by evaluate_object ACPICA: Namespace: fix operand cache leak ACPICA: Fix several incorrect invocations of ACPICA return macro ACPICA: Fix a module for excessive debug output ACPICA: Update some function headers, no funtional change ACPICA: Disassembler: Enhance resource descriptor detection i2c: designware: Add ACPI HID for Hisilicon Hip07/08 I2C controller ACPI / APD: Add clock frequency for Hisilicon Hip07/08 I2C controller ACPI / bus: Add INT0002 to list of always-present devices ...
2017-05-09Merge tag 'iommu-updates-v4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommuLinus Torvalds1-1/+1
Pull IOMMU updates from Joerg Roedel: - code optimizations for the Intel VT-d driver - ability to switch off a previously enabled Intel IOMMU - support for 'struct iommu_device' for OMAP, Rockchip and Mediatek IOMMUs - header optimizations for IOMMU core code headers and a few fixes that became necessary in other parts of the kernel because of that - ACPI/IORT updates and fixes - Exynos IOMMU optimizations - updates for the IOMMU dma-api code to bring it closer to use per-cpu iova caches - new command-line option to set default domain type allocated by the iommu core code - another command line option to allow the Intel IOMMU switched off in a tboot environment - ARM/SMMU: TLB sync optimisations for SMMUv2, Support for using an IDENTITY domain in conjunction with DMA ops, Support for SMR masking, Support for 16-bit ASIDs (was previously broken) - various other small fixes and improvements * tag 'iommu-updates-v4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (63 commits) soc/qbman: Move dma-mapping.h include to qman_priv.h soc/qbman: Fix implicit header dependency now causing build fails iommu: Remove trace-events include from iommu.h iommu: Remove pci.h include from trace/events/iommu.h arm: dma-mapping: Don't override dma_ops in arch_setup_dma_ops() ACPI/IORT: Fix CONFIG_IOMMU_API dependency iommu/vt-d: Don't print the failure message when booting non-kdump kernel iommu: Move report_iommu_fault() to iommu.c iommu: Include device.h in iommu.h x86, iommu/vt-d: Add an option to disable Intel IOMMU force on iommu/arm-smmu: Return IOVA in iova_to_phys when SMMU is bypassed iommu/arm-smmu: Correct sid to mask iommu/amd: Fix incorrect error handling in amd_iommu_bind_pasid() iommu: Make iommu_bus_notifier return NOTIFY_DONE rather than error code omap3isp: Remove iommu_group related code iommu/omap: Add iommu-group support iommu/omap: Make use of 'struct iommu_device' iommu/omap: Store iommu_dev pointer in arch_data iommu/omap: Move data structures to omap-iommu.h iommu/omap: Drop legacy-style device support ...
2017-05-09Merge branches 'acpi-soc', 'acpi-bus', 'acpi-pmic' and 'acpi-power'Rafael J. Wysocki1-0/+9
* acpi-soc: ACPI / LPSS: Call pwm_add_table() for Bay Trail PWM device i2c: designware: Add ACPI HID for Hisilicon Hip07/08 I2C controller ACPI / APD: Add clock frequency for Hisilicon Hip07/08 I2C controller * acpi-bus: ACPI / bus: Add INT0002 to list of always-present devices ACPI / bus: Introduce a list of ids for "always present" devices * acpi-pmic: ACPI / PMIC: xpower: Fix power_table addresses * acpi-power: ACPI / power: Delay turning off unused power resources after suspend
2017-05-09Merge branch 'acpica'Rafael J. Wysocki3-1/+12
* acpica: ACPICA: Update version to 20170303 ACPICA: iasl: add ASL conversion tool ACPICA: Local cache support: Allow small cache objects ACPICA: Disassembler: Do not unconditionally remove temporary names ACPICA: iasl: Fix IORT SMMU GSI disassembling ACPICA: Cleanup AML opcode definitions, no functional change ACPICA: Debugger: Add interpreter blocking mark for single-step mode ACPICA: debugger: fix memory leak on Pathname ACPICA: Update for automatic repair code for objects returned by evaluate_object ACPICA: Namespace: fix operand cache leak ACPICA: Fix several incorrect invocations of ACPICA return macro ACPICA: Fix a module for excessive debug output ACPICA: Update some function headers, no funtional change ACPICA: Disassembler: Enhance resource descriptor detection ACPICA: Add non-linux host build support
2017-05-03Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-securityLinus Torvalds1-0/+1
Pull security subsystem updates from James Morris: "Highlights: IMA: - provide ">" and "<" operators for fowner/uid/euid rules KEYS: - add a system blacklist keyring - add KEYCTL_RESTRICT_KEYRING, exposes keyring link restriction functionality to userland via keyctl() LSM: - harden LSM API with __ro_after_init - add prlmit security hook, implement for SELinux - revive security_task_alloc hook TPM: - implement contextual TPM command 'spaces'" * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: (98 commits) tpm: Fix reference count to main device tpm_tis: convert to using locality callbacks tpm: fix handling of the TPM 2.0 event logs tpm_crb: remove a cruft constant keys: select CONFIG_CRYPTO when selecting DH / KDF apparmor: Make path_max parameter readonly apparmor: fix parameters so that the permission test is bypassed at boot apparmor: fix invalid reference to index variable of iterator line 836 apparmor: use SHASH_DESC_ON_STACK security/apparmor/lsm.c: set debug messages apparmor: fix boolreturn.cocci warnings Smack: Use GFP_KERNEL for smk_netlbl_mls(). smack: fix double free in smack_parse_opts_str() KEYS: add SP800-56A KDF support for DH KEYS: Keyring asymmetric key restrict method with chaining KEYS: Restrict asymmetric key linkage using a specific keychain KEYS: Add a lookup_restriction function for the asymmetric key type KEYS: Add KEYCTL_RESTRICT_KEYRING KEYS: Consistent ordering for __key_link_begin and restrict check KEYS: Add an optional lookup_restriction hook to key_type ...
2017-05-01Merge tag 'devprop-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pmLinus Torvalds1-0/+1
Pull generic device properties framework updates from Rafael Wysocki: "These add support for the ports and endpoints concepts, based on the existing DT support for them, to the generic device properties framework and update the ACPI _DSD properties code to recognize ports and endpoints accordingly. Specifics: - Extend the ACPI _DSD properties code and the generic device properties framework to support the concept of remote endponts (Mika Westerberg, Sakari Ailus). - Document the support for ports and endpoints in _DSD properties and extend the generic device properties framework to make it more suitable for the handling of ports and endpoints (Sakari Ailus)" * tag 'devprop-4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: device property: Read strings using string array reading functions device property: fwnode_property_read_string_array() returns nr of strings device property: Fix reading pset strings using array access functions device property: fwnode_property_read_string_array() may return -EILSEQ ACPI / DSD: Document references, ports and endpoints device property: Add fwnode_get_next_parent() device property: Add support for fwnode endpoints device property: Make dev_fwnode() public of: Add of_fwnode_handle() to convert device nodes to fwnode_handle device property: Add fwnode_handle_get() device property: Add support for remote endpoints ACPI / property: Add support for remote endpoints device property: Add fwnode_get_named_child_node() ACPI / property: Add fwnode_get_next_child_node() device property: Add fwnode_get_parent() ACPI / property: Add possiblity to retrieve parent firmware node
2017-04-28Merge branches 'acpi-power', 'acpi-blacklist', 'acpi-video' and 'acpi-doc'Rafael J. Wysocki1-0/+1
* acpi-power: 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-blacklist: ACPI / blacklist: add _REV quirk for Dell Inspiron 7537 * acpi-video: ACPI / video: add comments about subtle cases ACPI / video: get rid of magic numbers and use enum instead * acpi-doc: ACPI / doc: linuxized-acpica.txt: fix typos
2017-04-28ACPICA: Update version to 20170303Bob Moore1-1/+1
ACPICA commit db13f9ffbdf16c0b4fb92d051c14c7b96f379f3f ACPICA commit c55bb526ac9233fe4abc5ea923e136354ce7779c Version 20170224. Version 20170303. Link: https://github.com/acpica/acpica/commit/db13f9ff Link: https://github.com/acpica/acpica/commit/c55bb526 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-04-28ACPICA: iasl: add ASL conversion toolBob Moore2-0/+2
ACPICA commit c04d310039d3e0ed1cb62876fe7e596fbc75ab01 ACPICA commit a65c1df7e6b4bad8e37df822018c40c6c446add9 The key feature of this utility is that the original comments within the input ASL files are preserved during the conversion process, and included within the converted ASL+ file -- thus creating a transparent conversion of existing ASL files to ASL+ (ASL 2.0) This patch is an automatic generation of the ASL converter commit, Linux kernel isn't affected by the functionality provided in this commit, but requires the linuxized changes to support future ACPICA release automation. Link: https://github.com/acpica/acpica/commit/c04d3100 Link: https://github.com/acpica/acpica/commit/a65c1df7 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Jung-uk Kim <jkim@FreeBSD.org> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-04-27ACPICA: iasl: Fix IORT SMMU GSI disassemblingLv Zheng1-0/+9
ACPICA commit 637b88de24a78c20478728d9d66632b06fcaa5bf If the IORT template is compiled and then iort.aml binary disassembled to iort.dsl, SMMUv1 node lists incorrect offset for SMMU_Nsg_cfg_irpt Interrupt: [0ECh 0236 8] SMMU_Nsg_irpt Interrupt : 0000000000000000 [0ECh 0236 8] SMMU_Nsg_cfg_irpt Interrupt : 0000000000000000 This is because iasl hasn't implemented SMMU GSI decoding yet. This patch fixes this issue by preparing structures for decoding IORT SMMU GSI. ACPICA BZ 1340, reported by Alexei Fedorov, fixed by Lv Zheng. Link: https://github.com/acpica/acpica/commit/637b88de Link: https://bugs.acpica.org/show_bug.cgi?id=1340 Reported-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-04-27ACPI / bus: Introduce a list of ids for "always present" devicesHans de Goede1-0/+9
Several Bay / Cherry Trail devices (all of which ship with Windows 10) hide the LPSS PWM controller in ACPI, typically the _STA method looks like this: Method (_STA, 0, NotSerialized) // _STA: Status { If (OSID == One) { Return (Zero) } Return (0x0F) } Where OSID is some dark magic seen in all Cherry Trail ACPI tables making the machine behave differently depending on which OS it *thinks* it is booting, this gets set in a number of ways which we cannot control, on some newer machines it simple hardcoded to "One" aka win10. This causes the PWM controller to get hidden, which means Linux cannot control the backlight level on cht based tablets / laptops. Since loading the driver for this does no harm (the only in kernel user of it is the i915 driver, which will only uses it when it needs it), this commit makes acpi_bus_get_status() always set status to ACPI_STA_DEFAULT for the LPSS PWM device, fixing the lack of backlight control. Signed-off-by: Hans de Goede <hdegoede@redhat.com> [ rjw: Rename the new file to utils.c ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-04-25tpm_crb: remove a cruft constantJarkko Sakkinen1-2/+0
Remove a useless constant that slipped through me when I did the code review. This commit fixes the issue. Cc: Jiandi An <anjiandi@codeaurora.org> Fixes: 69c558de63c7 ("tpm/tpm_crb: Enable TPM CRB interface for ARM64") Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
2017-04-20drivers: acpi: Handle IOMMU lookup failure with deferred probing or errorSricharan R1-1/+1
This is an equivalent to the DT's handling of the iommu master's probe with deferred probing when the corrsponding iommu is not probed yet. The lack of a registered IOMMU can be caused by the lack of a driver for the IOMMU, the IOMMU device probe not having been performed yet, having been deferred, or having failed. The first case occurs when the firmware describes the bus master and IOMMU topology correctly but no device driver exists for the IOMMU yet or the device driver has not been compiled in. Return NULL, the caller will configure the device without an IOMMU. The second and third cases are handled by deferring the probe of the bus master device which will eventually get reprobed after the IOMMU. The last case is currently handled by deferring the probe of the bus master device as well. A mechanism to either configure the bus master device without an IOMMU or to fail the bus master device probe depending on whether the IOMMU is optional or mandatory would be a good enhancement. Tested-by: Hanjun Guo <hanjun.guo@linaro.org> Reviewed-by: Robin Murphy <robin.murphy@arm.com> [Lorenzo: Added fixes for dma_coherent_mask overflow, acpi_dma_configure called multiple times for same device] Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Signed-off-by: Sricharan R <sricharan@codeaurora.org> Signed-off-by: Joerg Roedel <jroedel@suse.de>
2017-04-19ACPI / utils: Add new acpi_dev_present helperHans de Goede1-0/+1
acpi_dev_found just iterates over all ACPI-ids and sees if one matches. This means that it will return true for devices which are in the DSDT but disabled (their _STA method returns 0). For some drivers it is useful to be able to check if a certain HID is not only present in the namespace, but also actually present as in acpi_device_is_present() will return true for the device. For example because if a certain device is present then the driver will want to use an extcon or IIO ADC channel provided by that device. This commit adds a new acpi_dev_present helper which drivers can use to this end. Like acpi_dev_found, acpi_dev_present take a HID as argument, but it also has 2 extra optional arguments to only check for an ACPI device with a specific UID and/or HRV value. This makes it more generic and allows it to replace custom code doing similar checks in several places. Arguably acpi_dev_present is what acpi_dev_found should have been, but there are too many users to just change acpi_dev_found without the risk of breaking something. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Lukas Wunner <lukas@wunner.de> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-04-18ACPI / CPPC: add sysfs entries for CPPC perf capabilitiesPrakash, Prashanth1-1/+1
Computed delivered performance using CPPC feedback counters are in the CPPC abstract scale, whereas cppc_cpufreq driver operates in KHz scale. Exposing the CPPC performance capabilities (highest,lowest, nominal, lowest non-linear) will allow userspace to figure out the conversion factor from CPPC abstract scale to KHz. Also rename ctr_wrap_time to wraparound_time so that show_cppc_data() macro will work with it. Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-04-18ACPI / CPPC: Read lowest nonlinear perf in cppc_get_perf_caps()Prakash, Prashanth1-0/+1
Read lowest non linear perf in cppc_get_perf_caps so that it can be exposed via sysfs to the usespace. Lowest non linear perf is the lowest performance level at which nonlinear power savings are achieved. Signed-off-by: Prashanth Prakash <pprakash@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-04-03ACPICA: Update TPM2 ACPI tableJiandi An1-0/+3
TCG ACPI Specification Family "1.2" and "2.0" Version 1.2 Revision 8 introduces new start method for ARM SMC. - Add new start method (type 11) for ARM SMC - Add start method specific parameters offset for ARM SMC start method Signed-off-by: Jiandi An <anjiandi@codeaurora.org> Tested-by: Shanker Donthineni <shankerd@codeaurora.org> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> (on x86/PTT) Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
2017-03-29ACPI / property: Add possiblity to retrieve parent firmware nodeMika Westerberg1-0/+1
Sometimes it is useful to be able to navigate firmware node hierarchy upwards toward parent nodes. ACPI device nodes are pretty much already supported because ACPICA provides acpi_get_parent(). ACPI data nodes, however, are all below the same parent ACPI device. Their hierarchy is created by "linking" each other using references in the value field. Add parent pointer to the parent data node while we create them so it is easy to navigate the hierarchy backwards. We use this parent pointer in a new function acpi_node_get_parent() that is able to extract parent of both ACPI firmware node types. Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-02-20Merge branches 'acpi-bus', 'acpi-sleep' and 'acpi-processor'Rafael J. Wysocki1-0/+2
* acpi-bus: spi: acpi: Initialize modalias from of_compatible i2c: acpi: Initialize info.type from of_compatible ACPI / bus: Introduce acpi_of_modalias() equiv of of_modalias_node() * acpi-sleep: ACPI: save NVS memory for Lenovo G50-45 * acpi-processor: x86/ACPI: keep x86_cpu_to_acpiid mapping valid on CPU hotplug
2017-02-09ACPICA: Update version to 20170119Bob Moore1-1/+1
ACPICA commit 711a8c19d3c646fdc069c38912d9037c7fa5e718 Version 20170119. Link: https://github.com/acpica/acpica/commit/711a8c19 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-02-09ACPICA: Source tree: Update copyright notices to 2017Bob Moore21-21/+21
ACPICA commit 16577e5265923f4999b4d2c0addb2343b18135e1 Affects all files. Link: https://github.com/acpica/acpica/commit/16577e52 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-02-09ACPICA: Linuxize: Restore and fix Intel compiler buildLv Zheng2-1/+88
ACPICA commit b59347d0b8b676cb555fe8da5cad08fcd4eeb0d3 The following commit cleans up compiler specific inclusions: Commit: 9fa1cebdbfff3db8953cebca8ee327d75edefc40 Subject: ACPICA: OSL: Cleanup the inclusion order of the compiler-specific headers But breaks one thing due to the following old issue: Buidling Linux kernel with Intel compiler originally depends on acgcc.h not acintel.h. So after making Intel compiler build working in ACPICA upstream by correctly using acintel.h, it becomes unable to build Linux kernel using Intel compiler as there is no acintel.h in the kernel source tree. This patch releases acintel.h to Linux kernel and fixes its inclusion in acenv.h. Fixes: 9fa1cebdbfff (ACPICA: OSL: Cleanup the inclusion order of the compiler-specific headers) Link: https://github.com/acpica/acpica/commit/b59347d0 Cc: 4.9+ <stable@vger.kernel.org> # 4.9+ Tested-by: Stepan M Mishura <stepan.m.mishura@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-02-07ACPI / bus: Introduce acpi_of_modalias() equiv of of_modalias_node()Dan O'Donovan1-0/+2
When using devicetree stuff like i2c_client.name or spi_device.modalias is initialized to the first DT compatible id with the vendor prefix stripped. Since some drivers rely on this try to replicate it when using ACPI with DT ids. Signed-off-by: Dan O'Donovan <dan@emutex.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Reviewed-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-01-05ACPICA: Update version to 20161222Bob Moore1-1/+1
ACPICA commit 0d5a056877c2e37e0bfce8d262cec339dc8d55fd ACPICA commit 5bea13a9e1eb2a0da99600d181afbc5fa075a9eb Version 20161222 Link: https://github.com/acpica/acpica/commit/0d5a0568 Link: https://github.com/acpica/acpica/commit/5bea13a9 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-01-02ACPICA: EFI: Add efihello demo applicationLv Zheng1-1/+2
ACPICA commit 3fcc59f4755607dd066ac8ef869f0aa95e871b84 This patch adds a demo EFI application for stdin/stdout testing. This utility can be used to narrow down root causes of porting issues. Linux is not affected by this patch. Link: https://github.com/acpica/acpica/commit/3fcc59f4 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-01-02ACPICA: MSVC: Fix MSVC6 build issuesLv Zheng1-1/+1
ACPICA commit fa0680030a2969e1085563da633713e1c321637c Build environment has changed because of new improvements: 1. New files are split 2. New inclusion order This patch updates MSVC project files accordingly. Linux is not affected by this patch. Link: https://github.com/acpica/acpica/commit/fa068003 Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>