Skip to content

Commit 46c1345

Browse files
committed
Merge tag 'acpi-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI updates from Rafael Wysocki: "The new features here are ACPI 6.1 support (and some previously missing bits of ACPI 6.0 support) in ACPICA and two new drivers, a driver for the ACPI Generic Event Device (GED) feature introduced by ACPI 6.1 and the INT3406 thermal driver for display thermal management. Also the value returned by the _HRV (hardware revision) ACPI object will be exported to user space via sysfs now. In addition to that, ACPI on ARM64 will not depend on EXPERT any more. The rest is mostly fixes and cleanups and some code reorganization. Specifics: - In-kernel ACPICA code update to the upstream release 20160422 adding support for ACPI 6.1 along with some previously missing bits of ACPI 6.0 support, making a fair amount of fixes and cleanups and reducing divergences between the upstream ACPICA and the in-kernel code (Bob Moore, Lv Zheng, Al Stone, Aleksey Makarov, Will Miles) - ACPI Generic Event Device (GED) support and a fix for it (Sinan Kaya, Paul Gortmaker) - INT3406 thermal driver for display thermal management and ACPI backlight support code reorganization related to it (Aaron Lu, Arnd Bergmann) - Support for exporting the value returned by the _HRV (hardware revision) ACPI object via sysfs (Betty Dall) - Removal of the EXPERT dependency for ACPI on ARM64 (Mark Brown) - Rework of the handling of ACPI _OSI mechanism allowing the _OSI("Darwin") support to be overridden from the kernel command line among other things (Lv Zheng, Chen Yu) - Rework of the ACPI tables override mechanism to prepare it for the introduction of overlays support going forward (Lv Zheng, Rafael Wysocki) - Fixes related to the ECDT support and module-level execution of AML (Lv Zheng) - ACPI PCI interrupts management update to make it work better on ARM64 mostly (Sinan Kaya) - ACPI SRAT handling update to make the code process all entires in the table order regardless of the entry type (Lukasz Anaczkowski) - EFI power off support for full-hardware ACPI platforms that don't support ACPI S5 (Chen Yu) - Fixes and cleanups related to the ACPI core's sysfs interface (Dan Carpenter, Betty Dall) - acpi_dev_present() API rework to reduce possible confusion related to it (Lukas Wunner) - Removal of CLK_IS_ROOT from two ACPI drivers (Stephen Boyd)" * tag 'acpi-4.7-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (82 commits) ACPI / video: mark acpi_video_get_levels() inline Thermal / ACPI / video: add INT3406 thermal driver ACPI / GED: make evged.c explicitly non-modular ACPI / tables: Fix DSDT override mechanism ACPI / sysfs: fix error code in get_status() ACPICA: Update version to 20160422 ACPICA: Move all ASCII utilities to a common file ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support for acpi_hw_write() ACPICA: ACPI 2.0, Hardware: Add access_width/bit_offset support in acpi_hw_read() ACPICA: Executer: Introduce a set of macros to handle bit width mask generation ACPICA: Hardware: Add optimized access bit width support ACPICA: Utilities: Add ACPI_IS_ALIGNED() macro ACPICA: Renamed some #defined flag constants for clarity ACPICA: ACPI 6.0, tools/iasl: Add support for new resource descriptors ACPICA: ACPI 6.0: Update _BIX support for new package element ACPICA: ACPI 6.1: Support for new PCCT subtable ACPICA: Refactor evaluate_object to reduce nesting ACPICA: Divergence: remove unwanted spaces for typedef ACPI,PCI,IRQ: remove SCI penalize function ACPI,PCI,IRQ: remove redundant code in acpi_irq_penalty_init() ..
2 parents d57d394 + fc72395 commit 46c1345

File tree

172 files changed

+3639
-2363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+3639
-2363
lines changed

Documentation/acpi/initrd_table_override.txt

Lines changed: 39 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Overriding ACPI tables via initrd
2-
=================================
1+
Upgrading ACPI tables via initrd
2+
================================
33

44
1) Introduction (What is this about)
55
2) What is this for
@@ -9,12 +9,14 @@ Overriding ACPI tables via initrd
99
1) What is this about
1010
---------------------
1111

12-
If the ACPI_INITRD_TABLE_OVERRIDE compile option is true, it is possible to
13-
override nearly any ACPI table provided by the BIOS with an instrumented,
14-
modified one.
12+
If the ACPI_TABLE_UPGRADE compile option is true, it is possible to
13+
upgrade the ACPI execution environment that is defined by the ACPI tables
14+
via upgrading the ACPI tables provided by the BIOS with an instrumented,
15+
modified, more recent version one, or installing brand new ACPI tables.
1516

16-
For a full list of ACPI tables that can be overridden, take a look at
17-
the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in drivers/acpi/osl.c
17+
For a full list of ACPI tables that can be upgraded/installed, take a look
18+
at the char *table_sigs[MAX_ACPI_SIGNATURE]; definition in
19+
drivers/acpi/tables.c.
1820
All ACPI tables iasl (Intel's ACPI compiler and disassembler) knows should
1921
be overridable, except:
2022
- ACPI_SIG_RSDP (has a signature of 6 bytes)
@@ -25,17 +27,20 @@ Both could get implemented as well.
2527
2) What is this for
2628
-------------------
2729

28-
Please keep in mind that this is a debug option.
29-
ACPI tables should not get overridden for productive use.
30-
If BIOS ACPI tables are overridden the kernel will get tainted with the
31-
TAINT_OVERRIDDEN_ACPI_TABLE flag.
32-
Complain to your platform/BIOS vendor if you find a bug which is so sever
33-
that a workaround is not accepted in the Linux kernel.
30+
Complain to your platform/BIOS vendor if you find a bug which is so severe
31+
that a workaround is not accepted in the Linux kernel. And this facility
32+
allows you to upgrade the buggy tables before your platform/BIOS vendor
33+
releases an upgraded BIOS binary.
3434

35-
Still, it can and should be enabled in any kernel, because:
36-
- There is no functional change with not instrumented initrds
37-
- It provides a powerful feature to easily debug and test ACPI BIOS table
38-
compatibility with the Linux kernel.
35+
This facility can be used by platform/BIOS vendors to provide a Linux
36+
compatible environment without modifying the underlying platform firmware.
37+
38+
This facility also provides a powerful feature to easily debug and test
39+
ACPI BIOS table compatibility with the Linux kernel by modifying old
40+
platform provided ACPI tables or inserting new ACPI tables.
41+
42+
It can and should be enabled in any kernel because there is no functional
43+
change with not instrumented initrds.
3944

4045

4146
3) How does it work
@@ -50,23 +55,31 @@ iasl -d *.dat
5055
# For example add this statement into a _PRT (PCI Routing Table) function
5156
# of the DSDT:
5257
Store("HELLO WORLD", debug)
58+
# And increase the OEM Revision. For example, before modification:
59+
DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000000)
60+
# After modification:
61+
DefinitionBlock ("DSDT.aml", "DSDT", 2, "INTEL ", "TEMPLATE", 0x00000001)
5362
iasl -sa dsdt.dsl
5463
# Add the raw ACPI tables to an uncompressed cpio archive.
55-
# They must be put into a /kernel/firmware/acpi directory inside the
56-
# cpio archive.
57-
# The uncompressed cpio archive must be the first.
58-
# Other, typically compressed cpio archives, must be
59-
# concatenated on top of the uncompressed one.
64+
# They must be put into a /kernel/firmware/acpi directory inside the cpio
65+
# archive. Note that if the table put here matches a platform table
66+
# (similar Table Signature, and similar OEMID, and similar OEM Table ID)
67+
# with a more recent OEM Revision, the platform table will be upgraded by
68+
# this table. If the table put here doesn't match a platform table
69+
# (dissimilar Table Signature, or dissimilar OEMID, or dissimilar OEM Table
70+
# ID), this table will be appended.
6071
mkdir -p kernel/firmware/acpi
6172
cp dsdt.aml kernel/firmware/acpi
62-
# A maximum of: #define ACPI_OVERRIDE_TABLES 10
63-
# tables are currently allowed (see osl.c):
73+
# A maximum of "NR_ACPI_INITRD_TABLES (64)" tables are currently allowed
74+
# (see osl.c):
6475
iasl -sa facp.dsl
6576
iasl -sa ssdt1.dsl
6677
cp facp.aml kernel/firmware/acpi
6778
cp ssdt1.aml kernel/firmware/acpi
68-
# Create the uncompressed cpio archive and concatenate the original initrd
69-
# on top:
79+
# The uncompressed cpio archive must be the first. Other, typically
80+
# compressed cpio archives, must be concatenated on top of the uncompressed
81+
# one. Following command creates the uncompressed cpio archive and
82+
# concatenates the original initrd on top:
7083
find kernel | cpio -H newc --create > /boot/instrumented_initrd
7184
cat /boot/initrd >>/boot/instrumented_initrd
7285
# reboot with increased acpi debug level, e.g. boot params:

Documentation/kernel-parameters.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
315315
acpi_osi=!* # remove all strings
316316
acpi_osi=! # disable all built-in OS vendor
317317
strings
318+
acpi_osi=!! # enable all built-in OS vendor
319+
strings
318320
acpi_osi= # disable all strings
319321

320322
'acpi_osi=!' can be used in combination with single or

arch/arm64/configs/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ CONFIG_PHY_RCAR_GEN3_USB2=y
264264
CONFIG_PHY_HI6220_USB=y
265265
CONFIG_PHY_XGENE=y
266266
CONFIG_ARM_SCPI_PROTOCOL=y
267+
CONFIG_ACPI=y
267268
CONFIG_EXT2_FS=y
268269
CONFIG_EXT3_FS=y
269270
CONFIG_FANOTIFY=y

arch/x86/kernel/acpi/boot.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,6 @@ static void __init acpi_sci_ioapic_setup(u8 bus_irq, u16 polarity, u16 trigger,
445445
polarity = acpi_sci_flags & ACPI_MADT_POLARITY_MASK;
446446

447447
mp_override_legacy_irq(bus_irq, polarity, trigger, gsi);
448-
acpi_penalize_sci_irq(bus_irq, trigger, polarity);
449448

450449
/*
451450
* stash over-ride to indicate we've been here

arch/x86/kernel/setup.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,13 +398,21 @@ static void __init reserve_initrd(void)
398398

399399
memblock_free(ramdisk_image, ramdisk_end - ramdisk_image);
400400
}
401+
402+
static void __init early_initrd_acpi_init(void)
403+
{
404+
early_acpi_table_init((void *)initrd_start, initrd_end - initrd_start);
405+
}
401406
#else
402407
static void __init early_reserve_initrd(void)
403408
{
404409
}
405410
static void __init reserve_initrd(void)
406411
{
407412
}
413+
static void __init early_initrd_acpi_init(void)
414+
{
415+
}
408416
#endif /* CONFIG_BLK_DEV_INITRD */
409417

410418
static void __init parse_setup_data(void)
@@ -1138,9 +1146,7 @@ void __init setup_arch(char **cmdline_p)
11381146

11391147
reserve_initrd();
11401148

1141-
#if defined(CONFIG_ACPI) && defined(CONFIG_BLK_DEV_INITRD)
1142-
acpi_initrd_override((void *)initrd_start, initrd_end - initrd_start);
1143-
#endif
1149+
early_initrd_acpi_init();
11441150

11451151
vsmp_init();
11461152

arch/x86/pci/acpi.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,6 @@ int __init pci_acpi_init(void)
396396
return -ENODEV;
397397

398398
printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
399-
acpi_irq_penalty_init();
400399
pcibios_enable_irq = acpi_pci_irq_enable;
401400
pcibios_disable_irq = acpi_pci_irq_disable;
402401
x86_init.pci.init_irq = x86_init_noop;

arch/x86/platform/efi/quirks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,5 +371,5 @@ bool efi_reboot_required(void)
371371

372372
bool efi_poweroff_required(void)
373373
{
374-
return !!acpi_gbl_reduced_hardware;
374+
return acpi_gbl_reduced_hardware || acpi_no_s5;
375375
}

drivers/acpi/Kconfig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
menuconfig ACPI
66
bool "ACPI (Advanced Configuration and Power Interface) Support"
77
depends on !IA64_HP_SIM
8-
depends on IA64 || X86 || (ARM64 && EXPERT)
8+
depends on IA64 || X86 || ARM64
99
depends on PCI
1010
select PNP
11-
default y
11+
default y if (IA64 || X86)
1212
help
1313
Advanced Configuration and Power Interface (ACPI) support for
1414
Linux requires an ACPI-compliant platform (hardware/firmware),
@@ -311,12 +311,12 @@ config ACPI_CUSTOM_DSDT
311311
bool
312312
default ACPI_CUSTOM_DSDT_FILE != ""
313313

314-
config ACPI_INITRD_TABLE_OVERRIDE
315-
bool "ACPI tables override via initrd"
314+
config ACPI_TABLE_UPGRADE
315+
bool "Allow upgrading ACPI tables via initrd"
316316
depends on BLK_DEV_INITRD && X86
317-
default n
317+
default y
318318
help
319-
This option provides functionality to override arbitrary ACPI tables
319+
This option provides functionality to upgrade arbitrary ACPI tables
320320
via initrd. No functional change if no ACPI tables are passed via
321321
initrd, therefore it's safe to say Y.
322322
See Documentation/acpi/initrd_table_override.txt for details

drivers/acpi/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ obj-$(CONFIG_ACPI) += acpi.o \
1818
acpica/
1919

2020
# All the builtin files are in the "acpi." module_param namespace.
21-
acpi-y += osl.o utils.o reboot.o
21+
acpi-y += osi.o osl.o utils.o reboot.o
2222
acpi-y += nvs.o
2323

2424
# Power management related files
@@ -47,6 +47,7 @@ acpi-$(CONFIG_ARM_AMBA) += acpi_amba.o
4747
acpi-y += int340x_thermal.o
4848
acpi-y += power.o
4949
acpi-y += event.o
50+
acpi-$(CONFIG_ACPI_REDUCED_HARDWARE_ONLY) += evged.o
5051
acpi-y += sysfs.o
5152
acpi-y += property.o
5253
acpi-$(CONFIG_X86) += acpi_cmos_rtc.o

drivers/acpi/acpi_amba.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ static void amba_register_dummy_clk(void)
3535
if (amba_dummy_clk)
3636
return;
3737

38-
amba_dummy_clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL,
39-
CLK_IS_ROOT, 0);
38+
amba_dummy_clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, 0, 0);
4039
clk_register_clkdev(amba_dummy_clk, "apb_pclk", NULL);
4140
}
4241

drivers/acpi/acpi_apd.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ static int acpi_apd_setup(struct apd_private_data *pdata)
6262
if (dev_desc->fixed_clk_rate) {
6363
clk = clk_register_fixed_rate(&pdata->adev->dev,
6464
dev_name(&pdata->adev->dev),
65-
NULL, CLK_IS_ROOT,
66-
dev_desc->fixed_clk_rate);
65+
NULL, 0, dev_desc->fixed_clk_rate);
6766
clk_register_clkdev(clk, NULL, dev_name(&pdata->adev->dev));
6867
pdata->clk = clk;
6968
}

drivers/acpi/acpi_video.c

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -191,19 +191,6 @@ struct acpi_video_device_cap {
191191
u8 _DDC:1; /* Return the EDID for this device */
192192
};
193193

194-
struct acpi_video_brightness_flags {
195-
u8 _BCL_no_ac_battery_levels:1; /* no AC/Battery levels in _BCL */
196-
u8 _BCL_reversed:1; /* _BCL package is in a reversed order */
197-
u8 _BQC_use_index:1; /* _BQC returns an index value */
198-
};
199-
200-
struct acpi_video_device_brightness {
201-
int curr;
202-
int count;
203-
int *levels;
204-
struct acpi_video_brightness_flags flags;
205-
};
206-
207194
struct acpi_video_device {
208195
unsigned long device_id;
209196
struct acpi_video_device_flags flags;
@@ -325,7 +312,7 @@ static const struct thermal_cooling_device_ops video_cooling_ops = {
325312
*/
326313

327314
static int
328-
acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
315+
acpi_video_device_lcd_query_levels(acpi_handle handle,
329316
union acpi_object **levels)
330317
{
331318
int status;
@@ -335,7 +322,7 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
335322

336323
*levels = NULL;
337324

338-
status = acpi_evaluate_object(device->dev->handle, "_BCL", NULL, &buffer);
325+
status = acpi_evaluate_object(handle, "_BCL", NULL, &buffer);
339326
if (!ACPI_SUCCESS(status))
340327
return status;
341328
obj = (union acpi_object *)buffer.pointer;
@@ -766,36 +753,28 @@ static int acpi_video_bqc_quirk(struct acpi_video_device *device,
766753
return 0;
767754
}
768755

769-
770-
/*
771-
* Arg:
772-
* device : video output device (LCD, CRT, ..)
773-
*
774-
* Return Value:
775-
* Maximum brightness level
776-
*
777-
* Allocate and initialize device->brightness.
778-
*/
779-
780-
static int
781-
acpi_video_init_brightness(struct acpi_video_device *device)
756+
int acpi_video_get_levels(struct acpi_device *device,
757+
struct acpi_video_device_brightness **dev_br)
782758
{
783759
union acpi_object *obj = NULL;
784760
int i, max_level = 0, count = 0, level_ac_battery = 0;
785-
unsigned long long level, level_old;
786761
union acpi_object *o;
787762
struct acpi_video_device_brightness *br = NULL;
788-
int result = -EINVAL;
763+
int result = 0;
789764
u32 value;
790765

791-
if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device, &obj))) {
766+
if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device->handle,
767+
&obj))) {
792768
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Could not query available "
793769
"LCD brightness level\n"));
770+
result = -ENODEV;
794771
goto out;
795772
}
796773

797-
if (obj->package.count < 2)
774+
if (obj->package.count < 2) {
775+
result = -EINVAL;
798776
goto out;
777+
}
799778

800779
br = kzalloc(sizeof(*br), GFP_KERNEL);
801780
if (!br) {
@@ -861,6 +840,38 @@ acpi_video_init_brightness(struct acpi_video_device *device)
861840
"Found unordered _BCL package"));
862841

863842
br->count = count;
843+
*dev_br = br;
844+
845+
out:
846+
kfree(obj);
847+
return result;
848+
out_free:
849+
kfree(br);
850+
goto out;
851+
}
852+
EXPORT_SYMBOL(acpi_video_get_levels);
853+
854+
/*
855+
* Arg:
856+
* device : video output device (LCD, CRT, ..)
857+
*
858+
* Return Value:
859+
* Maximum brightness level
860+
*
861+
* Allocate and initialize device->brightness.
862+
*/
863+
864+
static int
865+
acpi_video_init_brightness(struct acpi_video_device *device)
866+
{
867+
int i, max_level = 0;
868+
unsigned long long level, level_old;
869+
struct acpi_video_device_brightness *br = NULL;
870+
int result = -EINVAL;
871+
872+
result = acpi_video_get_levels(device->dev, &br);
873+
if (result)
874+
return result;
864875
device->brightness = br;
865876

866877
/* _BQC uses INDEX while _BCL uses VALUE in some laptops */
@@ -903,17 +914,13 @@ acpi_video_init_brightness(struct acpi_video_device *device)
903914
goto out_free_levels;
904915

905916
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
906-
"found %d brightness levels\n", count - 2));
907-
kfree(obj);
908-
return result;
917+
"found %d brightness levels\n", br->count - 2));
918+
return 0;
909919

910920
out_free_levels:
911921
kfree(br->levels);
912-
out_free:
913922
kfree(br);
914-
out:
915923
device->brightness = NULL;
916-
kfree(obj);
917924
return result;
918925
}
919926

drivers/acpi/acpica/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ acpi-y += \
4343
evxfregn.o
4444

4545
acpi-y += \
46+
exconcat.o \
4647
exconfig.o \
4748
exconvrt.o \
4849
excreate.o \
@@ -149,6 +150,7 @@ acpi-y += \
149150
acpi-y += \
150151
utaddress.o \
151152
utalloc.o \
153+
utascii.o \
152154
utbuffer.o \
153155
utcopy.o \
154156
utexcep.o \

0 commit comments

Comments
 (0)