linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPICA: Fix Scope() op in module level code
@ 2010-10-22  8:27 Lin Ming
  2010-10-22 22:43 ` Moore, Robert
  2010-10-23  5:37 ` Len Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Lin Ming @ 2010-10-22  8:27 UTC (permalink / raw)
  To: lenb; +Cc: Moore, Robert, linux-acpi, tony, john.floyd

Len, 

Would you please include this patch in 2.6.37 merge?

Thanks,
Lin Ming
---

From: Bob Moore <robert.moore@intel.com>

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>
---
 drivers/acpi/acpica/dswexec.c |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/dswexec.c b/drivers/acpi/acpica/dswexec.c
index d555b37..6b0b5d0 100644
--- a/drivers/acpi/acpica/dswexec.c
+++ b/drivers/acpi/acpica/dswexec.c
@@ -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:



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* RE: [PATCH] ACPICA: Fix Scope() op in module level code
  2010-10-22  8:27 [PATCH] ACPICA: Fix Scope() op in module level code Lin Ming
@ 2010-10-22 22:43 ` Moore, Robert
  2010-10-25  0:29   ` Lin Ming
  2010-10-23  5:37 ` Len Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Moore, Robert @ 2010-10-22 22:43 UTC (permalink / raw)
  To: Lin, Ming M, lenb
  Cc: linux-acpi, tony@awtrey.com, john.floyd@environment.nsw.gov.au

However, the fix really affects any control method that attempts to use the Scope() operator, correct?



>-----Original Message-----
>From: Lin, Ming M
>Sent: Friday, October 22, 2010 1:27 AM
>To: lenb
>Cc: Moore, Robert; linux-acpi; tony@awtrey.com;
>john.floyd@environment.nsw.gov.au
>Subject: [PATCH] ACPICA: Fix Scope() op in module level code
>
>Len,
>
>Would you please include this patch in 2.6.37 merge?
>
>Thanks,
>Lin Ming
>---
>
>From: Bob Moore <robert.moore@intel.com>
>
>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>
>---
> drivers/acpi/acpica/dswexec.c |   19 +++++++++++++++++--
> 1 files changed, 17 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/acpi/acpica/dswexec.c b/drivers/acpi/acpica/dswexec.c
>index d555b37..6b0b5d0 100644
>--- a/drivers/acpi/acpica/dswexec.c
>+++ b/drivers/acpi/acpica/dswexec.c
>@@ -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:
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ACPICA: Fix Scope() op in module level code
  2010-10-22  8:27 [PATCH] ACPICA: Fix Scope() op in module level code Lin Ming
  2010-10-22 22:43 ` Moore, Robert
@ 2010-10-23  5:37 ` Len Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Len Brown @ 2010-10-23  5:37 UTC (permalink / raw)
  To: Lin Ming; +Cc: Moore, Robert, linux-acpi, tony, john.floyd

applied to acpica branch

thanks,
Len Brown, Intel Open Source Technology Center


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] ACPICA: Fix Scope() op in module level code
  2010-10-22 22:43 ` Moore, Robert
@ 2010-10-25  0:29   ` Lin Ming
  0 siblings, 0 replies; 4+ messages in thread
From: Lin Ming @ 2010-10-25  0:29 UTC (permalink / raw)
  To: Moore, Robert
  Cc: lenb, linux-acpi, tony@awtrey.com,
	john.floyd@environment.nsw.gov.au

On Sat, 2010-10-23 at 06:43 +0800, Moore, Robert wrote:
> However, the fix really affects any control method that attempts to use the Scope() operator, correct?

Correct, how about below changelog?

[PATCH] ACPICA: Fix Scope() op in control method

Some Panasonic Toughbooks create nodes in module level code.
Module level code is the executable AML code outside of control method,
but we implemented it as 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>


> 
> >-----Original Message-----
> >From: Lin, Ming M
> >Sent: Friday, October 22, 2010 1:27 AM
> >To: lenb
> >Cc: Moore, Robert; linux-acpi; tony@awtrey.com;
> >john.floyd@environment.nsw.gov.au
> >Subject: [PATCH] ACPICA: Fix Scope() op in module level code
> >
> >Len,
> >
> >Would you please include this patch in 2.6.37 merge?
> >
> >Thanks,
> >Lin Ming
> >---
> >
> >From: Bob Moore <robert.moore@intel.com>
> >
> >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>
> >---
> > drivers/acpi/acpica/dswexec.c |   19 +++++++++++++++++--
> > 1 files changed, 17 insertions(+), 2 deletions(-)
> >
> >diff --git a/drivers/acpi/acpica/dswexec.c b/drivers/acpi/acpica/dswexec.c
> >index d555b37..6b0b5d0 100644
> >--- a/drivers/acpi/acpica/dswexec.c
> >+++ b/drivers/acpi/acpica/dswexec.c
> >@@ -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:
> >
> 



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-25  0:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-22  8:27 [PATCH] ACPICA: Fix Scope() op in module level code Lin Ming
2010-10-22 22:43 ` Moore, Robert
2010-10-25  0:29   ` Lin Ming
2010-10-23  5:37 ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).