Advice for in-kernel acpi patching
by Stefan Demharter
Hi all,
I have a laptop (acer 3820tg) with muxed intel + radeon graphic cards which has the following problem:
If I use the intel as primary card and switch the radeon card off an on, the mux wronlgy changes to the discrete card.
This is particularily bad if you want to enable dynamic-power-off for the radeon card.
I identifed the problem to be a specific STORE-call in the method PEGP._ON in the table SSDT1.
I also wrote a module which patches the SSDT1 table on the fly. The function which does the real patching is attached.
As of now I think it's a somewhat hacky solution which should be improved.
At first I have the following questions:
- Is there already an easy way to patch acpi methods within the linux kernel?
- Do you agree that solving such stuff within the kernel is the right way to go?
Any other advice would be appreciated, too.
Best Regards,
Stefan
PS: I don't think loading a user-patched SSDT1 table at kernel start is the right way to go because:
- It doesn't work out of the box for new linux installations on the aforementioned laptop.
- If you change the bios setting for the graphic cards from switchable to intel-only or radeon-only the patched SSDT1 table would be wrong.
8 years, 8 months
[PATCH 0/2] Fix DBG2 compilation template issue
by naresh.bhat@linaro.org
From: Naresh Bhat <naresh.bhat(a)linaro.org>
The patches try to fix the DBG2 table compilation issue
and also tries to add a template support for DBG2 tables.
Naresh Bhat (2):
iASL: Fix Table Info handler for DBG2
iASL: Add template support for dbg2
source/common/dmtable.c | 2 +-
source/compiler/dtcompiler.h | 1 +
source/compiler/dttemplate.h | 10 ++++++++++
3 files changed, 12 insertions(+), 1 deletion(-)
--
1.7.9.5
8 years, 8 months
Re: [Devel] ACPICA: Resource Mgr: Prevent infinite loops in resource walks
by Moore, Robert
We'll take a look.
Thanks,
Bob
> -----Original Message-----
> From: Dan Carpenter [mailto:[email protected]]
> Sent: Thursday, October 17, 2013 5:29 AM
> To: Moore, Robert
> Cc: linux-acpi(a)vger.kernel.org; devel(a)acpica.org
> Subject: re: ACPICA: Resource Mgr: Prevent infinite loops in resource
> walks
>
> Hello Bob Moore,
>
> The patch c13085e519e8: "ACPICA: Resource Mgr: Prevent infinite loops in
> resource walks" from Mar 8, 2013 is not beautiful. My static checker
> complains about the loop because:
> "drivers/acpi/acpica/rscalc.c:197 acpi_rs_get_aml_length()
> warn: 'resource' can't be NULL."
>
> drivers/acpi/acpica/rscalc.c
> 195 /* Traverse entire list of internal resource descriptors
> */
> 196
> 197 while (resource) {
> ^^^^^^^^
>
> My static checker is wrong because we use the -fno-strict-overflow to
> prevent GCC from optimizing this check away. But we are looping over a
> list of pointers until our pointer wraps to NULL. In other words we loop
> over all the 2**64 - 1 addresses until we wrap to NULL or we find
> something with an invalid type or something with ->length zero.
>
> I assume the last element in the list always has length zero? If so then
> we could replace "while (resource)" with "while (resource->length)"
>
> 198
> 199 /* Validate the descriptor type */
> 200
> 201 if (resource->type > ACPI_RESOURCE_TYPE_MAX) {
> 202
> return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
> 203 }
> 204
> 205 /* Sanity check the length. It must not be zero,
> or we loop forever */
> 206
> 207 if (!resource->length) {
> 208
> return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
> 209 }
> 210
> 211 /* Get the base size of the (external stream)
> resource descriptor */
> 212
>
> regards,
> dan carpenter
8 years, 8 months
ACPI Error: Namespace lookup failure, AE_NOT_FOUND
by Uwe Andersen
Hello,
I integrated ACPICA into a real time operatinng system called "RTOS32".
The "InitializeFullAcpi(void)" function runs without a problem.
If I call function AcpiEnterSleepStatePrep(5) to prepare a system switch off I get the error messages:
ACPI Error: [\_SB_.PCIO.LPCB.TPM_.PTS_] Namespace lookup failure, AE_NOT_FOUND(20130823/psargs-465)
ACPI Error: Method parse/execution failed [\PTS] (Node 7F01B470), AE_NOT_FOUND(20130823/psargs-625)
Is this a BIOS problem or did I something wrong with the ACPICA?
BTW, AcpiEnterSleepStatePrep(5) returns with "AE_OK" which it shouldn't, IMHO.
If I execute AcpiEnterSleepState(5) thereafter (because AcpiEnterSleepStatePrep did not returns an error) the ACPICA code crashes with a "privileged Instruction" exception. Which is probably not a surprise because AcpiEnterSleepStatePrep() already encountered a problem.
Regards,
Uwe
P.S.: I'm a ACPI newbie so please excuse if I contacted the wrong forum.
8 years, 8 months
ACPICA version 20130927 released
by Moore, Robert
27 September 2013. Summary of changes for version 20130927:
This release is available at https://acpica.org/downloads
1) ACPICA kernel-resident subsystem:
Fixed a problem with store operations to reference objects. This change fixes a problem where a Store operation to an ArgX object that contained a reference to a field object did not complete the automatic dereference and then write to the actual field object. Instead, the object type of the field object was inadvertently changed to match the type of the source operand. The new behavior will actually write to the field object (buffer field or field unit), thus matching the correct ACPI-defined behavior.
Implemented support to allow the host to redefine individual OSL prototypes. This change enables the host to redefine OSL prototypes found in the acpiosxf.h file. This allows the host to implement OSL interfaces with a macro or inlined function. Further, it allows the host to add any additional required modifiers such as __iomem, __init, __exit, etc., as necessary on a per-interface basis. Enables maximum flexibility for the OSL interfaces. Lv Zheng.
Hardcoded the access width for the FADT-defined reset register. The ACPI specification requires the reset register width to be 8 bits. ACPICA now hardcodes the width to 8 and ignores the FADT width value. This provides compatibility with other ACPI implementations that have allowed BIOS code with bad register width values to go unnoticed. Matthew Garett, Bob Moore, Lv Zheng.
Changed the position/use of the ACPI_PRINTF_LIKE macro. This macro is used in the OSL header (acpiosxf). The change modifies the position of this macro in each instance where it is used (AcpiDebugPrint, etc.) to avoid build issues if the OSL defines the implementation of the interface to be an inline stub function. Lv Zheng.
Deployed a new macro ACPI_EXPORT_SYMBOL_INIT for the main ACPICA initialization interfaces. This change adds a new macro for the main init and terminate external interfaces in order to support hosts that require additional or different processing for these functions. Changed from ACPI_EXPORT_SYMBOL to ACPI_EXPORT_SYMBOL_INIT for these functions. Lv Zheng, Bob Moore.
Cleaned up the memory allocation macros for configurability. In the common case, the ACPI_ALLOCATE and related macros now resolve directly to their respective AcpiOs* OSL interfaces. Two options:
1) The ACPI_ALLOCATE_ZEROED macro uses a simple local implementation by default, unless overridden by the USE_NATIVE_ALLOCATE_ZEROED define.
2) For AcpiExec (and for debugging), the macros can optionally be resolved to the local ACPICA interfaces that track each allocation (local tracking is used to immediately detect memory leaks).
Lv Zheng.
Simplified the configuration for ACPI_REDUCED_HARDWARE. Allows the kernel to predefine this macro to either TRUE or FALSE during the system build.
Replaced __FUNCTION_ with __func__ in the gcc-specific header.
Example Code and Data Size: These are the sizes for the OS-independent acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The debug version of the code includes the debug output trace mechanism and has a much larger code and data size.
Current Release:
Non-Debug Version: 95.8K Code, 27.0K Data, 122.8K Total
Debug Version: 185.2K Code, 77.2K Data, 262.4K Total
Previous Release:
Non-Debug Version: 96.7K Code, 27.1K Data, 123.9K Total
Debug Version: 184.4K Code, 76.8K Data, 261.2K Total
2) iASL Compiler/Disassembler and Tools:
iASL: Implemented wildcard support for the -e option. This simplifies use when there are many SSDTs that must be included to resolve external method declarations. ACPICA BZ 1041. Example:
iasl -e ssdt*.dat -d dsdt.dat
AcpiExec: Add history/line-editing for Unix/Linux systems. This change adds a portable module that implements full history and limited line editing for Unix and Linux systems. It does not use readline() due to portability issues. Instead it uses the POSIX termio interface to put the terminal in raw input mode so that the various special keys can be trapped (such as up/down-arrow for history support and left/right-arrow for line editing). Uses the existing debugger history mechanism. ACPICA BZ 1036.
AcpiXtract: Add support to handle (ignore) "empty" lines containing only one or more spaces. This provides compatible with early or different versions of the AcpiDump utility. ACPICA BZ 1044.
AcpiDump: Do not ignore tables that contain only an ACPI table header. Apparently, some BIOSs create SSDTs that contain an ACPI table header but no other data. This change adds support to dump these tables. Any tables shorter than the length of an ACPI table header remain in error (an error message is emitted). Reported by Yi Li.
Debugger: Echo actual command along with the "unknown command" message.
8 years, 9 months