aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi
AgeCommit message (Collapse)AuthorFilesLines
2023-10-24ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias()Christophe JAILLET1-4/+6
snprintf() does not return negative values on error. To know if the buffer was too small, the returned value needs to be compared with the length of the passed buffer. If it is greater or equal, the output has been truncated, so add checks for the truncation to create_pnp_modalias() and create_of_modalias(). Also make them return -ENOMEM in that case, as they already do that elsewhere. Moreover, the remaining size of the buffer used by snprintf() needs to be updated after the first write to avoid out-of-bounds access as already done correctly in create_pnp_modalias(), but not in create_of_modalias(), so change the latter accordingly. Fixes: 8765c5ba1949 ("ACPI / scan: Rework modalias creation when "compatible" is present") Signed-off-by: Christophe JAILLET <[email protected]> [ rjw: Merge two patches into one, combine changelogs, add subject ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-24ACPI: acpi_pad: Rename ACPI device from device to adevMichal Wilczynski1-10/+11
Since transformation from ACPI driver to platform driver there are two devices on which the driver operates - ACPI device and platform device. For the sake of reader this calls for the distinction in their naming, to avoid confusion. Rename device to adev, as corresponding platform device is called pdev. Signed-off-by: Michal Wilczynski <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-24ACPI: acpi_pad: Use dev groups for sysfsMichal Wilczynski1-33/+9
Change the way sysfs files are created. Use dev_groups, as it's a better approach - it allows to declare attributes, and the core code would take care of the lifecycle of those objects. Suggested-by: Andy Shevchenko <[email protected]> Signed-off-by: Michal Wilczynski <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-24ACPI: acpi_pad: Replace acpi_driver with platform_driverMichal Wilczynski1-11/+14
The acpi_pad driver uses struct acpi_driver to register itself while it would be more logically consistent to use struct platform_driver for this purpose, because the corresponding platform device is present and the role of struct acpi_device is to amend the other bus types. ACPI devices are not meant to be used as proper representation of hardware entities, but to collect information on those hardware entities provided by the platform firmware. Use struct platform_driver for registering the acpi_pad driver. Suggested-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Michal Wilczynski <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-24ACPI: APEI: Use ERST timeout for slow devicesJeshua Smith1-4/+37
Slow devices such as flash may not meet the default 1ms timeout value, so use the ERST max execution time value that they provide as the timeout if it is larger. Signed-off-by: Jeshua Smith <[email protected]> Reviewed-by: Tony Luck <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-24arm64, irqchip/gic-v3, ACPI: Move MADT GICC enabled check into a helperJames Morse1-1/+1
ACPI, irqchip and the architecture code all inspect the MADT enabled bit for a GICC entry in the MADT. The addition of an 'online capable' bit means all these sites need updating. Move the current checks behind a helper to make future updates easier. Signed-off-by: James Morse <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Gavin Shan <[email protected]> Signed-off-by: "Russell King (Oracle)" <[email protected]> Acked-by: "Rafael J. Wysocki" <[email protected]> Reviewed-by: Sudeep Holla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
2023-10-24ACPI: scan: Rename acpi_scan_device_not_present() to be about enumerationJames Morse1-4/+4
acpi_scan_device_not_present() is called when a device in the hierarchy is not available for enumeration. Historically enumeration was only based on whether the device was present. To add support for only enumerating devices that are both present and enabled, this helper should be renamed. It was only ever about enumeration, rename it acpi_scan_device_not_enumerated(). No change in behaviour is intended. Signed-off-by: James Morse <[email protected]> Reviewed-by: Gavin Shan <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Miguel Luis <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-22ACPI: NFIT: Install Notify() handler before getting NFIT tableXiang Chen1-11/+11
If there is no NFIT at startup, it will return 0 immediately in function acpi_nfit_add() and will not install Notify() handler. If hotplugging a nvdimm device later, it will not be identified as there is no Notify() handler. Install the handler before getting NFI table in function acpi_nfit_add() to avoid above issue. Fixes: dcca12ab62a2 ("ACPI: NFIT: Install Notify() handler directly") Signed-off-by: Xiang Chen <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-20ACPI: sysfs: use acpi_device_uid() for fetching _UIDRaag Jadav1-3/+3
Convert manual _UID references to use the standard ACPI helper. Signed-off-by: Raag Jadav <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-20ACPI: scan: Use the acpi_device_is_present() helper in more placesJames Morse1-2/+2
acpi_device_is_present() checks the present or functional bits from the cached copy of _STA. A few places open-code this check. Use the helper instead to improve readability. Signed-off-by: James Morse <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Gavin Shan <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Miguel Luis <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-20Merge branch 'acpi-irq'Rafael J. Wysocki1-1/+6
Merge ACPI IRQ management fix for 6.6-rc7 (Sunil V L). * acpi-irq: ACPI: irq: Fix incorrect return value in acpi_register_gsi()
2023-10-18ACPI: bus: Move acpi_arm_init() to the place of after acpi_ghes_init()Hanjun Guo1-1/+1
acpi_agdi_init() in acpi_arm_init() will register a SDEI event, so it needs the SDEI subsystem to be initialized (which is done in acpi_ghes_init()) before the AGDI driver probing. In commit fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init()"), the acpi_agdi_init() was called before acpi_ghes_init() and it causes following failure: | [ 0.515864] sdei: Failed to create event 1073741825: -5 | [ 0.515866] agdi agdi.0: Failed to register for SDEI event 1073741825 | [ 0.515867] agdi: probe of agdi.0 failed with error -5 | ... | [ 0.516022] sdei: SDEIv1.0 (0x0) detected in firmware. Fix it by moving acpi_arm_init() to the place of after acpi_ghes_init(). Fixes: fcea0ccf4fd7 ("ACPI: bus: Consolidate all arm specific initialisation into acpi_arm_init()") Reported-by: D Scott Phillips <[email protected]> Signed-off-by: Hanjun Guo <[email protected]> Reviewed-by: Sudeep Holla <[email protected]> Tested-by: D Scott Phillips <[email protected]> Cc: 6.5+ <[email protected]> # 6.5+ Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-18ACPI: irq: Fix incorrect return value in acpi_register_gsi()Sunil V L1-1/+6
acpi_register_gsi() should return a negative value in case of failure. Currently, it returns the return value from irq_create_fwspec_mapping(). However, irq_create_fwspec_mapping() returns 0 for failure. Fix the issue by returning -EINVAL if irq_create_fwspec_mapping() returns zero. Fixes: d44fa3d46079 ("ACPI: Add support for ResourceSource/IRQ domain mapping") Cc: 4.11+ <[email protected]> # 4.11+ Signed-off-by: Sunil V L <[email protected]> [ rjw: Rename a new local variable ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-17amba: bus: balance firmware node reference countingAndy Shevchenko1-1/+1
Currently the ACPI code doesn't bump the reference count of the firmware node, while OF counter part does. Not that it's a problem right now, since ACPI doesn't really use the reference counting for firmware nodes, it still makes sense to make code robust against any changes done there. For this, - switch ACPI case to use device_set_node() to be unified with OF - move reference counting to amba_device_add() - switch to use firmware nodes instead of OF ones In the result we will have reference counting done in the same module for all callers independently on the nature of firmware node behind. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Rob Herring <[email protected]>
2023-10-17ACPI: AC: Rename ACPI device from device to adevMichal Wilczynski1-13/+13
Since transformation from ACPI driver to platform driver there are two devices on which the driver operates - ACPI device and platform device. For the sake of reader this calls for the distinction in their naming, to avoid confusion. Rename device to adev, as corresponding platform device is called pdev. Signed-off-by: Michal Wilczynski <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-16acpi, hmat: calculate abstract distance with HMATHuang Ying1-2/+63
A memory tiering abstract distance calculation algorithm based on ACPI HMAT is implemented. The basic idea is as follows. The performance attributes of system default DRAM nodes are recorded as the base line. Whose abstract distance is MEMTIER_ADISTANCE_DRAM. Then, the ratio of the abstract distance of a memory node (target) to MEMTIER_ADISTANCE_DRAM is scaled based on the ratio of the performance attributes of the node to that of the default DRAM nodes. The functions to record the read/write latency/bandwidth of the default DRAM nodes and calculate abstract distance according to read/write latency/bandwidth ratio will be used by CXL CDAT (Coherent Device Attribute Table) and other memory device drivers. So, they are put in memory-tiers.c. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: "Huang, Ying" <[email protected]> Tested-by: Bharata B Rao <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Reviewed-by: Alistair Popple <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Wei Xu <[email protected]> Cc: Dan Williams <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Jonathan Cameron <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Yang Shi <[email protected]> Cc: Rafael J Wysocki <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-10-16acpi, hmat: refactor hmat_register_target_initiators()Huang Ying1-51/+30
Previously, in hmat_register_target_initiators(), the performance attributes are calculated and the corresponding sysfs links and files are created too. Which is called during memory onlining. But now, to calculate the abstract distance of a memory target before memory onlining, we need to calculate the performance attributes for a memory target without creating sysfs links and files. To do that, hmat_register_target_initiators() is refactored to make it possible to calculate performance attributes separately. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: "Huang, Ying" <[email protected]> Reviewed-by: Alistair Popple <[email protected]> Tested-by: Alistair Popple <[email protected]> Tested-by: Bharata B Rao <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Wei Xu <[email protected]> Cc: Dan Williams <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Davidlohr Bueso <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Jonathan Cameron <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Yang Shi <[email protected]> Cc: Rafael J Wysocki <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-10-15Merge tag 'smp-urgent-2023-10-15' of ↵Linus Torvalds1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull CPU hotplug fix from Ingo Molnar: "Fix a Longsoon build warning by harmonizing the arch_[un]register_cpu() prototypes between architectures" * tag 'smp-urgent-2023-10-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: cpu-hotplug: Provide prototypes for arch CPU registration
2023-10-13ACPI: AC: Replace acpi_driver with platform_driverMichal Wilczynski1-25/+27
The AC driver uses struct acpi_driver to register itself while it would be more logically consistent to use struct platform_driver for this purpose, because the corresponding platform device is present and the role of struct acpi_device is to amend the other bus types. ACPI devices are not meant to be used as proper representation of hardware entities, but to collect information on those hardware entities provided by the platform firmware. Use struct platform_driver for registering the AC driver. Suggested-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Michal Wilczynski <[email protected]> [ rjw: Changelog edits, acpi_ac_notify() modifications fixup ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-13ACPI: AC: Use string_choices API instead of ternary operatorMichal Wilczynski1-2/+3
Use modern string_choices API instead of manually determining the output using ternary operator. Suggested-by: Andy Shevchenko <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Michal Wilczynski <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-13ACPI: AC: Remove redundant checksMichal Wilczynski1-23/+4
Remove unnecessary checks against NULL for pointers that can't be NULL when the checks are done. Signed-off-by: Michal Wilczynski <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-13Merge branches 'acpi-ec' and 'acpi-resource'Rafael J. Wysocki2-6/+31
Merge ACPI EC driver and ACPI resources handlig changes for 6.6-rc6: - Add EC GPE fixup quirk for HP Pavilion Gaming 15-dk1xxx (Hans de Goede). - Add ACPI IRQ override quirks for TongFang GM6BGEQ, GM6BG5Q and GM6BG0Q, and for ASUS ExpertBook B1402CBA (ans de Goede). * acpi-ec: ACPI: EC: Add quirk for the HP Pavilion Gaming 15-dk1xxx * acpi-resource: ACPI: resource: Add TongFang GM6BGEQ, GM6BG5Q and GM6BG0Q to irq1_edge_low_force_override[] ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CBA
2023-10-11cpu-hotplug: Provide prototypes for arch CPU registrationRussell King (Oracle)1-0/+1
Provide common prototypes for arch_register_cpu() and arch_unregister_cpu(). These are called by acpi_processor.c, with weak versions, so the prototype for this is already set. It is generally not necessary for function prototypes to be conditional on preprocessor macros. Some architectures (e.g. Loongarch) are missing the prototype for this, and rather than add it to Loongarch's asm/cpu.h, do the job once for everyone. Since this covers everyone, remove the now unnecessary prototypes in asm/cpu.h, and therefore remove the 'static' from one of ia64's arch_register_cpu() definitions. [ tglx: Bring back the ia64 part and remove the ACPI prototypes ] Signed-off-by: Russell King (Oracle) <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2023-10-09ACPI: resource: Add TongFang GM6BGEQ, GM6BG5Q and GM6BG0Q to ↵Hans de Goede1-6/+13
irq1_edge_low_force_override[] The TongFang GM6BGEQ, GM6BG5Q and GM6BG0Q are 3 GPU variants of a TongFang barebone design which is sold under various brand names. The ACPI IRQ override for the keyboard IRQ must be used on these AMD Zen laptops in order for the IRQ to work. Adjust the pcspecialist_laptop[] DMI match table for this: 1. Drop the sys-vendor match from the existing PCSpecialist Elimina Pro 16 entry for the GM6BGEQ (RTX3050 GPU) model so that it will also match the laptop when sold by other vendors such as hyperbook.pl. 2. Add board-name matches for the GM6BG5Q (RTX4050) and GM6B0Q (RTX4060) models. Note the .ident values of the dmi_system_id structs are left unset since these are not used. Suggested-by: August Wikerfors <[email protected]> Reported-by: Francesco <[email protected]> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217394 Link: https://laptopparts4less.frl/index.php?route=product/search&filter_name=GM6BG Link: https://hyperbook.pl/en/content/14-hyperbook-drivers Link: https://linux-hardware.org/?probe=bfa70344e3 Link: https://bbs.archlinuxcn.org/viewtopic.php?id=13313 Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-06acpi,mm: fix typo sibiling -> siblingLi Zhijian1-1/+1
First found this typo as reviewing memory tier code. Fix it by sed like: $ sed -i 's/sibiling/sibling/g' $(git grep -l sibiling) so the acpi one will be corrected as well. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Li Zhijian <[email protected]> Cc: Aneesh Kumar K.V <[email protected]> Cc: Huang, Ying <[email protected]> Cc: Len Brown <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
2023-10-06ACPI: bus: Add context argument to acpi_dev_install_notify_handler()Rafael J. Wysocki7-8/+8
Add void *context arrgument to the list of arguments of acpi_dev_install_notify_handler() and modify it to pass that argument as context to acpi_install_notify_handler() instead of its first argument which is problematic in general (for example, if platform drivers used it, they would rather get struct platform_device pointers or pointers to their private data from the context arguments of their notify handlers). Make all of the current callers of acpi_dev_install_notify_handler() take this change into account so as to avoid altering the general functionality. Co-developed-by: Michal Wilczynski <[email protected]> Signed-off-by: Michal Wilczynski <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-06Merge tag 'arm64-fixes' of ↵Linus Torvalds1-2/+1
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux Pull arm64 fixes from Will Deacon: "A typo fix for a PMU driver, a workround for a side-channel erratum on Cortex-A520 and a fix for the local timer save/restore when using ACPI with Qualcomm's custom CPUs: - Workaround for Cortex-A520 erratum #2966298 - Fix typo in Arm CMN PMU driver that breaks counter overflow handling - Fix timer handling across idle for Qualcomm custom CPUs" * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux: cpuidle, ACPI: Evaluate LPI arch_flags for broadcast timer arm64: errata: Add Cortex-A520 speculative unprivileged load workaround arm64: Add Cortex-A520 CPU part definition perf/arm-cmn: Fix the unhandled overflow status of counter 4 to 7
2023-10-05ACPI: thermal: Use thermal_zone_for_each_trip() for updating tripsRafael J. Wysocki1-41/+37
Rearrange the code handling notifications from the platform firmware regarding trip point updates to carry out one loop over trip points instead of two of them by using thermal_zone_for_each_trip() for that, which is more straightforward than using a combination of thermal_zone_device_exec() and for_each_thermal_trip(), each with its own callback function. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Daniel Lezcano <[email protected]>
2023-10-05ACPI: thermal: Combine passive and active trip update functionsRafael J. Wysocki1-18/+17
Combine acpi_thermal_update_passive_trip() and acpi_thermal_update_active_trip() into one common function called acpi_thermal_update_trip(), so as to reduce code duplication and prepare the code in question for subsequent changes. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Daniel Lezcano <[email protected]>
2023-10-05ACPI: thermal: Move get_active_temp()Rafael J. Wysocki1-23/+23
Put the get_active_temp() function next to the analogous get_passive_temp() one to allow subsequent changes to be easier to follow. No functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Daniel Lezcano <[email protected]>
2023-10-04cpuidle, ACPI: Evaluate LPI arch_flags for broadcast timerOza Pawandeep1-2/+1
Arm® Functional Fixed Hardware Specification defines LPI states, which provide an architectural context loss flags field that can be used to describe the context that might be lost when an LPI state is entered. - Core context Lost - General purpose registers. - Floating point and SIMD registers. - System registers, include the System register based - generic timer for the core. - Debug register in the core power domain. - PMU registers in the core power domain. - Trace register in the core power domain. - Trace context loss - GICR - GICD Qualcomm's custom CPUs preserves the architectural state, including keeping the power domain for local timers active. when core is power gated, the local timers are sufficient to wake the core up without needing broadcast timer. The patch fixes the evaluation of cpuidle arch_flags, and moves only to broadcast timer if core context lost is defined in ACPI LPI. Fixes: a36a7fecfe60 ("ACPI / processor_idle: Add support for Low Power Idle(LPI) states") Reviewed-by: Sudeep Holla <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Signed-off-by: Oza Pawandeep <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
2023-10-03ACPI: PRM: Annotate struct prm_module_info with __counted_byKees Cook1-1/+1
Prepare for the coming implementation by GCC and Clang of the __counted_by attribute. Flexible array members annotated with __counted_by can have their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS (for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family functions). As found with Coccinelle[1], add __counted_by for struct prm_module_info. Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci # [1] Signed-off-by: Kees Cook <[email protected]> Reviewed-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: FPDT: properly handle invalid FPDT subtablesVasily Khoruzhick1-8/+37
Buggy BIOSes may have invalid FPDT subtables, e.g. on my hardware: S3PT subtable: 7F20FE30: 53 33 50 54 24 00 00 00-00 00 00 00 00 00 18 01 *S3PT$...........* 7F20FE40: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 *................* 7F20FE50: 00 00 00 00 Here the first record has zero length. FBPT subtable: 7F20FE50: 46 42 50 54-3C 00 00 00 46 42 50 54 *....FBPT<...FBPT* 7F20FE60: 02 00 30 02 00 00 00 00-00 00 00 00 00 00 00 00 *..0.............* 7F20FE70: 2A A6 BC 6E 0B 00 00 00-1A 44 41 70 0B 00 00 00 **..n.....DAp....* 7F20FE80: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 *................* And here FBPT table has FBPT signature repeated instead of the first record. Current code will be looping indefinitely due to zero length records, so break out of the loop if record length is zero. While we are here, add proper handling for fpdt_process_subtable() failures. Fixes: d1eb86e59be0 ("ACPI: tables: introduce support for FPDT table") Cc: All applicable <[email protected]> Signed-off-by: Vasily Khoruzhick <[email protected]> [ rjw: Comment edit, added empty code lines ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: utils: Remove redundant braces around individual statementJonathan Bergh1-2/+1
Remove braces that are not required for a one-line statement which follows a control statement. Signed-off-by: Jonathan Bergh <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: utils: Fix up white space in a few placesJonathan Bergh1-2/+2
Fix up the following formatting issues flagged by checkpatch: * Remove indentation before goto label * Remove whitespace ahead of a comma in parameter list Signed-off-by: Jonathan Bergh <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: thermal: Fix up function header formatting in two placesJonathan Bergh1-4/+11
Fix up the following formatting issues: * braces following function declarations should be on a new line * empty line should be present between function declarations Signed-off-by: Jonathan Bergh <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: video: Add acpi_backlight=vendor quirk for Toshiba Portégé R100Ondrej Zary1-0/+26
Toshiba Portégé R100 has both acpi_video and toshiba_acpi vendor backlight driver working. But none of them gets activated as it has a VGA with no kernel driver (Trident CyberBlade XP4m32). The DMI strings are very generic ("Portable PC") so add a custom callback function to check for Trident CyberBlade XP4m32 PCI device before enabling the vendor backlight driver (better than acpi_video as it has more brightness steps). Fixes: 5aa9d943e9b6 ("ACPI: video: Don't enable fallback path for creating ACPI backlight by default") Signed-off-by: Ondrej Zary <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: OSL: Add empty lines after local variable declarationsJonathan Bergh1-0/+4
Fix up four places where there is no empty line after declarations of local variables in a function (as per the kernel coding style). Signed-off-by: Jonathan Bergh <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: OSL: Remove redundant parentheses in return statementsJonathan Bergh1-3/+3
Fix up three return statements including redundant perens around the return value. Signed-off-by: Jonathan Bergh <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: OSL: Fix up white space in parameter listsJonathan Bergh1-8/+8
Fix up declarations of pointer arguments where a space is present before the argument name, which does not agree with the kernel coding style. Signed-off-by: Jonathan Bergh <[email protected]> [ rjw: Subject and changelog edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: property: Document the _DSD data buffer GUIDAndy Shevchenko1-0/+1
As the rest of the GUIDs document one for _DSD data buffer so it will be eaisier to search for on internet or documentation. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: property: Allow _DSD buffer data only for byte accessorsAndy Shevchenko1-9/+10
In accordance with ACPI specificication and _DSD data buffer representation the data there is an array of bytes. Hence, accessing it with something longer will create a sparse data which is against of how device property APIs work in general and also not defined in the ACPI specification (see [1]). Fix the code to emit an error if non-byte accessor is used to retrieve _DSD buffer data. Fixes: 369af6bf2c28 ("ACPI: property: Read buffer properties as integers") Link: https://uefi.org/specs/ACPI/6.5/19_ASL_Reference.html#buffer-declare-buffer-object # [1] Signed-off-by: Andy Shevchenko <[email protected]> [ rjw: Add missing braces ] Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: x86: s2idle: Switch to use acpi_evaluate_dsm_typed()Andy Shevchenko1-3/+2
The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant. Signed-off-by: Andy Shevchenko <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: PCI: Switch to use acpi_evaluate_dsm_typed()Andy Shevchenko1-3/+3
The acpi_evaluate_dsm_typed() provides a way to check the type of the object evaluated by _DSM call. Use it instead of open coded variant. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-03ACPI: LPSS: drop BayTrail and Lynxpoint pinctrl HIDsRaag Jadav1-8/+3
Platform devices are now created by ACPI core on device enumeration on acpi_bus_scan() -> acpi_bus_attach() path after commit 48459340b92b ("ACPI / scan: use platform bus type by default for _HID enumeration"). No need to create them from LPSS unless we explicitly need to set acpi_lpss_pm_domain for them. Signed-off-by: Raag Jadav <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-10-02Merge tag 'libnvdimm-fixes-6.6-rc5' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm fix from Dave Jiang: - Fix incorrect calculation of idt size in NFIT * tag 'libnvdimm-fixes-6.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: ACPI: NFIT: Fix incorrect calculation of idt size
2023-10-02Merge back new ACPI backlight material for v6.7.Rafael J. Wysocki1-8/+50
2023-09-29ACPI: thermal: Drop list of device ACPI handles from struct acpi_thermalRafael J. Wysocki1-1/+0
Notice that the list of device ACPI handles in struct acpi_thermal is not used and drop it. No functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Daniel Lezcano <[email protected]>
2023-09-29ACPI: utils: Dynamically determine acpi_handle_list sizeRafael J. Wysocki4-12/+88
Address a long-standing "TBD" comment in the ACPI headers regarding the number of handles in struct acpi_handle_list. The number 10, which along with the comment dates back to 2.4.23, seems like it may have been arbitrarily chosen and isn't sufficient in all cases [1]. Finally change the code to dynamically determine the size of the handles table in struct acpi_handle_list and allocate it accordingly. Update the users of to struct acpi_handle_list to take the additional dynamic allocation into account. Link: https://lore.kernel.org/linux-acpi/[email protected] # [1] Co-developed-by: Vicki Pfau <[email protected]> Signed-off-by: Vicki Pfau <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2023-09-28ACPI: thermal: Rename structure fields holding temperature in deci-KelvinRafael J. Wysocki1-23/+23
Rename structure fields holding temperature values in deci-Kelvin so as to avoid temperature units confusion. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Daniel Lezcano <[email protected]>