]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Subject: [PATCH] ACPICA: Fix Scope() op in module level code
authorBob Moore <robert.moore@intel.com>
Sat, 23 Oct 2010 05:36:40 +0000 (01:36 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Sun, 17 Apr 2011 20:16:09 +0000 (16:16 -0400)
commit 8df3fc981dc12d9fdcaef4100a2193b605024d7a upstream.

Some Panasonic Toughbooks create nodes in module level code.
Module level code is the executable AML code outside of control method,
for example, below AML code creates a node \_SB.PCI0.GFX0.DD02.CUBL

        If (\_OSI ("Windows 2006"))
        {
            Scope (\_SB.PCI0.GFX0.DD02)
            {
                Name (CUBL, Ones)
                ...
            }
        }

Scope() op does not actually create a new object, it refers to an
existing object(\_SB.PCI0.GFX0.DD02 in above example). However, for
Scope(), we want to indeed open a new scope, so the child nodes(CUBL in
above example) can be created correctly under it.

https://bugzilla.kernel.org/show_bug.cgi?id=19462

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/acpi/acpica/dswexec.c

index 6b76c486d7840b7a3e7b7ea1303c72f4a0275885..30839babf69febf0fc7387b523df1621862b6bdc 100644 (file)
@@ -300,10 +300,25 @@ acpi_ds_exec_begin_op(struct acpi_walk_state *walk_state,
                         * we must enter this object into the namespace.  The created
                         * object is temporary and will be deleted upon completion of
                         * the execution of this method.
+                        *
+                        * Note 10/2010: Except for the Scope() op. This opcode does
+                        * not actually create a new object, it refers to an existing
+                        * object. However, for Scope(), we want to indeed open a
+                        * new scope.
                         */
-                       status = acpi_ds_load2_begin_op(walk_state, NULL);
+                       if (op->common.aml_opcode != AML_SCOPE_OP) {
+                               status =
+                                   acpi_ds_load2_begin_op(walk_state, NULL);
+                       } else {
+                               status =
+                                   acpi_ds_scope_stack_push(op->named.node,
+                                                            op->named.node->
+                                                            type, walk_state);
+                               if (ACPI_FAILURE(status)) {
+                                       return_ACPI_STATUS(status);
+                               }
+                       }
                }
-
                break;
 
        case AML_CLASS_EXECUTE: