xref: /titanic_52/usr/src/uts/intel/io/acpica/events/evrgnini.c (revision c1ecd8b9404ee0d96d93f02e82c441b9bb149a3d)
1 /******************************************************************************
2  *
3  * Module Name: evrgnini- ACPI AddressSpace (OpRegion) init
4  *              $Revision: 1.85 $
5  *
6  *****************************************************************************/
7 
8 /******************************************************************************
9  *
10  * 1. Copyright Notice
11  *
12  * Some or all of this work - Copyright (c) 1999 - 2006, Intel Corp.
13  * All rights reserved.
14  *
15  * 2. License
16  *
17  * 2.1. This is your license from Intel Corp. under its intellectual property
18  * rights.  You may have additional license terms from the party that provided
19  * you this software, covering your right to use that party's intellectual
20  * property rights.
21  *
22  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23  * copy of the source code appearing in this file ("Covered Code") an
24  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25  * base code distributed originally by Intel ("Original Intel Code") to copy,
26  * make derivatives, distribute, use and display any portion of the Covered
27  * Code in any form, with the right to sublicense such rights; and
28  *
29  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30  * license (with the right to sublicense), under only those claims of Intel
31  * patents that are infringed by the Original Intel Code, to make, use, sell,
32  * offer to sell, and import the Covered Code and derivative works thereof
33  * solely to the minimum extent necessary to exercise the above copyright
34  * license, and in no event shall the patent license extend to any additions
35  * to or modifications of the Original Intel Code.  No other license or right
36  * is granted directly or by implication, estoppel or otherwise;
37  *
38  * The above copyright and patent license is granted only if the following
39  * conditions are met:
40  *
41  * 3. Conditions
42  *
43  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44  * Redistribution of source code of any substantial portion of the Covered
45  * Code or modification with rights to further distribute source must include
46  * the above Copyright Notice, the above License, this list of Conditions,
47  * and the following Disclaimer and Export Compliance provision.  In addition,
48  * Licensee must cause all Covered Code to which Licensee contributes to
49  * contain a file documenting the changes Licensee made to create that Covered
50  * Code and the date of any change.  Licensee must include in that file the
51  * documentation of any changes made by any predecessor Licensee.  Licensee
52  * must include a prominent statement that the modification is derived,
53  * directly or indirectly, from Original Intel Code.
54  *
55  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56  * Redistribution of source code of any substantial portion of the Covered
57  * Code or modification without rights to further distribute source must
58  * include the following Disclaimer and Export Compliance provision in the
59  * documentation and/or other materials provided with distribution.  In
60  * addition, Licensee may not authorize further sublicense of source of any
61  * portion of the Covered Code, and must include terms to the effect that the
62  * license from Licensee to its licensee is limited to the intellectual
63  * property embodied in the software Licensee provides to its licensee, and
64  * not to intellectual property embodied in modifications its licensee may
65  * make.
66  *
67  * 3.3. Redistribution of Executable. Redistribution in executable form of any
68  * substantial portion of the Covered Code or modification must reproduce the
69  * above Copyright Notice, and the following Disclaimer and Export Compliance
70  * provision in the documentation and/or other materials provided with the
71  * distribution.
72  *
73  * 3.4. Intel retains all right, title, and interest in and to the Original
74  * Intel Code.
75  *
76  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77  * Intel shall be used in advertising or otherwise to promote the sale, use or
78  * other dealings in products derived from or relating to the Covered Code
79  * without prior written authorization from Intel.
80  *
81  * 4. Disclaimer and Export Compliance
82  *
83  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84  * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
86  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
87  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
88  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89  * PARTICULAR PURPOSE.
90  *
91  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
97  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98  * LIMITED REMEDY.
99  *
100  * 4.3. Licensee shall not export, either directly or indirectly, any of this
101  * software or system incorporating such software without first obtaining any
102  * required license or other approval from the U. S. Department of Commerce or
103  * any other agency or department of the United States Government.  In the
104  * event Licensee exports any such software from the United States or
105  * re-exports any such software from a foreign destination, Licensee shall
106  * ensure that the distribution and export/re-export of the software is in
107  * compliance with all laws, regulations, orders, or other restrictions of the
108  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109  * any of its subsidiaries will export/re-export any technical data, process,
110  * software, or service, directly or indirectly, to any country for which the
111  * United States government or any agency thereof requires an export license,
112  * other governmental approval, or letter of assurance, without first obtaining
113  * such license, approval or letter.
114  *
115  *****************************************************************************/
116 
117 
118 #define __EVRGNINI_C__
119 
120 #include "acpi.h"
121 #include "acevents.h"
122 #include "acnamesp.h"
123 
124 #define _COMPONENT          ACPI_EVENTS
125         ACPI_MODULE_NAME    ("evrgnini")
126 
127 
128 /*******************************************************************************
129  *
130  * FUNCTION:    AcpiEvSystemMemoryRegionSetup
131  *
132  * PARAMETERS:  Handle              - Region we are interested in
133  *              Function            - Start or stop
134  *              HandlerContext      - Address space handler context
135  *              RegionContext       - Region specific context
136  *
137  * RETURN:      Status
138  *
139  * DESCRIPTION: Setup a SystemMemory operation region
140  *
141  ******************************************************************************/
142 
143 ACPI_STATUS
144 AcpiEvSystemMemoryRegionSetup (
145     ACPI_HANDLE             Handle,
146     UINT32                  Function,
147     void                    *HandlerContext,
148     void                    **RegionContext)
149 {
150     ACPI_OPERAND_OBJECT     *RegionDesc = (ACPI_OPERAND_OBJECT *) Handle;
151     ACPI_MEM_SPACE_CONTEXT  *LocalRegionContext;
152 
153 
154     ACPI_FUNCTION_TRACE (EvSystemMemoryRegionSetup);
155 
156 
157     if (Function == ACPI_REGION_DEACTIVATE)
158     {
159         if (*RegionContext)
160         {
161             LocalRegionContext = (ACPI_MEM_SPACE_CONTEXT *) *RegionContext;
162 
163             /* Delete a cached mapping if present */
164 
165             if (LocalRegionContext->MappedLength)
166             {
167                 AcpiOsUnmapMemory (LocalRegionContext->MappedLogicalAddress,
168                     LocalRegionContext->MappedLength);
169             }
170             ACPI_FREE (LocalRegionContext);
171             *RegionContext = NULL;
172         }
173         return_ACPI_STATUS (AE_OK);
174     }
175 
176     /* Create a new context */
177 
178     LocalRegionContext = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_MEM_SPACE_CONTEXT));
179     if (!(LocalRegionContext))
180     {
181         return_ACPI_STATUS (AE_NO_MEMORY);
182     }
183 
184     /* Save the region length and address for use in the handler */
185 
186     LocalRegionContext->Length  = RegionDesc->Region.Length;
187     LocalRegionContext->Address = RegionDesc->Region.Address;
188 
189     *RegionContext = LocalRegionContext;
190     return_ACPI_STATUS (AE_OK);
191 }
192 
193 
194 /*******************************************************************************
195  *
196  * FUNCTION:    AcpiEvIoSpaceRegionSetup
197  *
198  * PARAMETERS:  Handle              - Region we are interested in
199  *              Function            - Start or stop
200  *              HandlerContext      - Address space handler context
201  *              RegionContext       - Region specific context
202  *
203  * RETURN:      Status
204  *
205  * DESCRIPTION: Setup a IO operation region
206  *
207  ******************************************************************************/
208 
209 ACPI_STATUS
210 AcpiEvIoSpaceRegionSetup (
211     ACPI_HANDLE             Handle,
212     UINT32                  Function,
213     void                    *HandlerContext,
214     void                    **RegionContext)
215 {
216     ACPI_FUNCTION_TRACE (EvIoSpaceRegionSetup);
217 
218 
219     if (Function == ACPI_REGION_DEACTIVATE)
220     {
221         *RegionContext = NULL;
222     }
223     else
224     {
225         *RegionContext = HandlerContext;
226     }
227 
228     return_ACPI_STATUS (AE_OK);
229 }
230 
231 
232 /*******************************************************************************
233  *
234  * FUNCTION:    AcpiEvPciConfigRegionSetup
235  *
236  * PARAMETERS:  Handle              - Region we are interested in
237  *              Function            - Start or stop
238  *              HandlerContext      - Address space handler context
239  *              RegionContext       - Region specific context
240  *
241  * RETURN:      Status
242  *
243  * DESCRIPTION: Setup a PCI_Config operation region
244  *
245  * MUTEX:       Assumes namespace is not locked
246  *
247  ******************************************************************************/
248 
249 ACPI_STATUS
250 AcpiEvPciConfigRegionSetup (
251     ACPI_HANDLE             Handle,
252     UINT32                  Function,
253     void                    *HandlerContext,
254     void                    **RegionContext)
255 {
256     ACPI_STATUS             Status = AE_OK;
257     ACPI_INTEGER            PciValue;
258     ACPI_PCI_ID             *PciId = *RegionContext;
259     ACPI_OPERAND_OBJECT     *HandlerObj;
260     ACPI_NAMESPACE_NODE     *ParentNode;
261     ACPI_NAMESPACE_NODE     *PciRootNode;
262     ACPI_OPERAND_OBJECT     *RegionObj = (ACPI_OPERAND_OBJECT  *) Handle;
263     ACPI_DEVICE_ID          ObjectHID;
264 
265 
266     ACPI_FUNCTION_TRACE (EvPciConfigRegionSetup);
267 
268 
269     HandlerObj = RegionObj->Region.Handler;
270     if (!HandlerObj)
271     {
272         /*
273          * No installed handler. This shouldn't happen because the dispatch
274          * routine checks before we get here, but we check again just in case.
275          */
276         ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
277             "Attempting to init a region %p, with no handler\n", RegionObj));
278         return_ACPI_STATUS (AE_NOT_EXIST);
279     }
280 
281     *RegionContext = NULL;
282     if (Function == ACPI_REGION_DEACTIVATE)
283     {
284         if (PciId)
285         {
286             ACPI_FREE (PciId);
287         }
288         return_ACPI_STATUS (Status);
289     }
290 
291     ParentNode = AcpiNsGetParentNode (RegionObj->Region.Node);
292 
293     /*
294      * Get the _SEG and _BBN values from the device upon which the handler
295      * is installed.
296      *
297      * We need to get the _SEG and _BBN objects relative to the PCI BUS device.
298      * This is the device the handler has been registered to handle.
299      */
300 
301     /*
302      * If the AddressSpace.Node is still pointing to the root, we need
303      * to scan upward for a PCI Root bridge and re-associate the OpRegion
304      * handlers with that device.
305      */
306     if (HandlerObj->AddressSpace.Node == AcpiGbl_RootNode)
307     {
308         /* Start search from the parent object */
309 
310         PciRootNode = ParentNode;
311         while (PciRootNode != AcpiGbl_RootNode)
312         {
313             Status = AcpiUtExecute_HID (PciRootNode, &ObjectHID);
314             if (ACPI_SUCCESS (Status))
315             {
316                 /*
317                  * Got a valid _HID string, check if this is a PCI root.
318                  * New for ACPI 3.0: check for a PCI Express root also.
319                  */
320                 if (!(ACPI_STRNCMP (ObjectHID.Value, PCI_ROOT_HID_STRING,
321                                     sizeof (PCI_ROOT_HID_STRING))           ||
322                     !(ACPI_STRNCMP (ObjectHID.Value, PCI_EXPRESS_ROOT_HID_STRING,
323                                     sizeof (PCI_EXPRESS_ROOT_HID_STRING)))))
324                 {
325                     /* Install a handler for this PCI root bridge */
326 
327                     Status = AcpiInstallAddressSpaceHandler ((ACPI_HANDLE) PciRootNode,
328                                         ACPI_ADR_SPACE_PCI_CONFIG,
329                                         ACPI_DEFAULT_HANDLER, NULL, NULL);
330                     if (ACPI_FAILURE (Status))
331                     {
332                         if (Status == AE_SAME_HANDLER)
333                         {
334                             /*
335                              * It is OK if the handler is already installed on the root
336                              * bridge.  Still need to return a context object for the
337                              * new PCI_Config operation region, however.
338                              */
339                             Status = AE_OK;
340                         }
341                         else
342                         {
343                             ACPI_EXCEPTION ((AE_INFO, Status,
344                                 "Could not install PciConfig handler for Root Bridge %4.4s",
345                                 AcpiUtGetNodeName (PciRootNode)));
346                         }
347                     }
348                     break;
349                 }
350             }
351 
352             PciRootNode = AcpiNsGetParentNode (PciRootNode);
353         }
354 
355         /* PCI root bridge not found, use namespace root node */
356     }
357     else
358     {
359         PciRootNode = HandlerObj->AddressSpace.Node;
360     }
361 
362     /*
363      * If this region is now initialized, we are done.
364      * (InstallAddressSpaceHandler could have initialized it)
365      */
366     if (RegionObj->Region.Flags & AOPOBJ_SETUP_COMPLETE)
367     {
368         return_ACPI_STATUS (AE_OK);
369     }
370 
371     /* Region is still not initialized. Create a new context */
372 
373     PciId = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_PCI_ID));
374     if (!PciId)
375     {
376         return_ACPI_STATUS (AE_NO_MEMORY);
377     }
378 
379     /*
380      * For PCI_Config space access, we need the segment, bus,
381      * device and function numbers.  Acquire them here.
382      */
383 
384     /*
385      * Get the PCI device and function numbers from the _ADR object
386      * contained in the parent's scope.
387      */
388     Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR, ParentNode, &PciValue);
389 
390     /*
391      * The default is zero, and since the allocation above zeroed
392      * the data, just do nothing on failure.
393      */
394     if (ACPI_SUCCESS (Status))
395     {
396         PciId->Device   = ACPI_HIWORD (ACPI_LODWORD (PciValue));
397         PciId->Function = ACPI_LOWORD (ACPI_LODWORD (PciValue));
398     }
399 
400     /* The PCI segment number comes from the _SEG method */
401 
402     Status = AcpiUtEvaluateNumericObject (METHOD_NAME__SEG, PciRootNode, &PciValue);
403     if (ACPI_SUCCESS (Status))
404     {
405         PciId->Segment = ACPI_LOWORD (PciValue);
406     }
407 
408     /* The PCI bus number comes from the _BBN method */
409 
410     Status = AcpiUtEvaluateNumericObject (METHOD_NAME__BBN, PciRootNode, &PciValue);
411     if (ACPI_SUCCESS (Status))
412     {
413         PciId->Bus = ACPI_LOWORD (PciValue);
414     }
415 
416     /* Complete this device's PciId */
417 
418     AcpiOsDerivePciId (PciRootNode, RegionObj->Region.Node, &PciId);
419 
420     *RegionContext = PciId;
421     return_ACPI_STATUS (AE_OK);
422 }
423 
424 
425 /*******************************************************************************
426  *
427  * FUNCTION:    AcpiEvPciBarRegionSetup
428  *
429  * PARAMETERS:  Handle              - Region we are interested in
430  *              Function            - Start or stop
431  *              HandlerContext      - Address space handler context
432  *              RegionContext       - Region specific context
433  *
434  * RETURN:      Status
435  *
436  * DESCRIPTION: Setup a PciBAR operation region
437  *
438  * MUTEX:       Assumes namespace is not locked
439  *
440  ******************************************************************************/
441 
442 ACPI_STATUS
443 AcpiEvPciBarRegionSetup (
444     ACPI_HANDLE             Handle,
445     UINT32                  Function,
446     void                    *HandlerContext,
447     void                    **RegionContext)
448 {
449     ACPI_FUNCTION_TRACE (EvPciBarRegionSetup);
450 
451 
452     return_ACPI_STATUS (AE_OK);
453 }
454 
455 
456 /*******************************************************************************
457  *
458  * FUNCTION:    AcpiEvCmosRegionSetup
459  *
460  * PARAMETERS:  Handle              - Region we are interested in
461  *              Function            - Start or stop
462  *              HandlerContext      - Address space handler context
463  *              RegionContext       - Region specific context
464  *
465  * RETURN:      Status
466  *
467  * DESCRIPTION: Setup a CMOS operation region
468  *
469  * MUTEX:       Assumes namespace is not locked
470  *
471  ******************************************************************************/
472 
473 ACPI_STATUS
474 AcpiEvCmosRegionSetup (
475     ACPI_HANDLE             Handle,
476     UINT32                  Function,
477     void                    *HandlerContext,
478     void                    **RegionContext)
479 {
480     ACPI_FUNCTION_TRACE (EvCmosRegionSetup);
481 
482 
483     return_ACPI_STATUS (AE_OK);
484 }
485 
486 
487 /*******************************************************************************
488  *
489  * FUNCTION:    AcpiEvDefaultRegionSetup
490  *
491  * PARAMETERS:  Handle              - Region we are interested in
492  *              Function            - Start or stop
493  *              HandlerContext      - Address space handler context
494  *              RegionContext       - Region specific context
495  *
496  * RETURN:      Status
497  *
498  * DESCRIPTION: Default region initialization
499  *
500  ******************************************************************************/
501 
502 ACPI_STATUS
503 AcpiEvDefaultRegionSetup (
504     ACPI_HANDLE             Handle,
505     UINT32                  Function,
506     void                    *HandlerContext,
507     void                    **RegionContext)
508 {
509     ACPI_FUNCTION_TRACE (EvDefaultRegionSetup);
510 
511 
512     if (Function == ACPI_REGION_DEACTIVATE)
513     {
514         *RegionContext = NULL;
515     }
516     else
517     {
518         *RegionContext = HandlerContext;
519     }
520 
521     return_ACPI_STATUS (AE_OK);
522 }
523 
524 
525 /*******************************************************************************
526  *
527  * FUNCTION:    AcpiEvInitializeRegion
528  *
529  * PARAMETERS:  RegionObj       - Region we are initializing
530  *              AcpiNsLocked    - Is namespace locked?
531  *
532  * RETURN:      Status
533  *
534  * DESCRIPTION: Initializes the region, finds any _REG methods and saves them
535  *              for execution at a later time
536  *
537  *              Get the appropriate address space handler for a newly
538  *              created region.
539  *
540  *              This also performs address space specific initialization.  For
541  *              example, PCI regions must have an _ADR object that contains
542  *              a PCI address in the scope of the definition.  This address is
543  *              required to perform an access to PCI config space.
544  *
545  * MUTEX:       Interpreter should be unlocked, because we may run the _REG
546  *              method for this region.
547  *
548  ******************************************************************************/
549 
550 ACPI_STATUS
551 AcpiEvInitializeRegion (
552     ACPI_OPERAND_OBJECT     *RegionObj,
553     BOOLEAN                 AcpiNsLocked)
554 {
555     ACPI_OPERAND_OBJECT     *HandlerObj;
556     ACPI_OPERAND_OBJECT     *ObjDesc;
557     ACPI_ADR_SPACE_TYPE     SpaceId;
558     ACPI_NAMESPACE_NODE     *Node;
559     ACPI_STATUS             Status;
560     ACPI_NAMESPACE_NODE     *MethodNode;
561     ACPI_NAME               *RegNamePtr = (ACPI_NAME *) METHOD_NAME__REG;
562     ACPI_OPERAND_OBJECT     *RegionObj2;
563 
564 
565     ACPI_FUNCTION_TRACE_U32 (EvInitializeRegion, AcpiNsLocked);
566 
567 
568     if (!RegionObj)
569     {
570         return_ACPI_STATUS (AE_BAD_PARAMETER);
571     }
572 
573     if (RegionObj->Common.Flags & AOPOBJ_OBJECT_INITIALIZED)
574     {
575         return_ACPI_STATUS (AE_OK);
576     }
577 
578     RegionObj2 = AcpiNsGetSecondaryObject (RegionObj);
579     if (!RegionObj2)
580     {
581         return_ACPI_STATUS (AE_NOT_EXIST);
582     }
583 
584     Node = AcpiNsGetParentNode (RegionObj->Region.Node);
585     SpaceId = RegionObj->Region.SpaceId;
586 
587     /* Setup defaults */
588 
589     RegionObj->Region.Handler = NULL;
590     RegionObj2->Extra.Method_REG = NULL;
591     RegionObj->Common.Flags &= ~(AOPOBJ_SETUP_COMPLETE);
592     RegionObj->Common.Flags |= AOPOBJ_OBJECT_INITIALIZED;
593 
594     /* Find any "_REG" method associated with this region definition */
595 
596     Status = AcpiNsSearchOneScope (
597                 *RegNamePtr, Node, ACPI_TYPE_METHOD, &MethodNode);
598     if (ACPI_SUCCESS (Status))
599     {
600         /*
601          * The _REG method is optional and there can be only one per region
602          * definition.  This will be executed when the handler is attached
603          * or removed
604          */
605         RegionObj2->Extra.Method_REG = MethodNode;
606     }
607 
608     /*
609      * The following loop depends upon the root Node having no parent
610      * ie: AcpiGbl_RootNode->ParentEntry being set to NULL
611      */
612     while (Node)
613     {
614         /* Check to see if a handler exists */
615 
616         HandlerObj = NULL;
617         ObjDesc = AcpiNsGetAttachedObject (Node);
618         if (ObjDesc)
619         {
620             /* Can only be a handler if the object exists */
621 
622             switch (Node->Type)
623             {
624             case ACPI_TYPE_DEVICE:
625 
626                 HandlerObj = ObjDesc->Device.Handler;
627                 break;
628 
629             case ACPI_TYPE_PROCESSOR:
630 
631                 HandlerObj = ObjDesc->Processor.Handler;
632                 break;
633 
634             case ACPI_TYPE_THERMAL:
635 
636                 HandlerObj = ObjDesc->ThermalZone.Handler;
637                 break;
638 
639             default:
640                 /* Ignore other objects */
641                 break;
642             }
643 
644             while (HandlerObj)
645             {
646                 /* Is this handler of the correct type? */
647 
648                 if (HandlerObj->AddressSpace.SpaceId == SpaceId)
649                 {
650                     /* Found correct handler */
651 
652                     ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
653                         "Found handler %p for region %p in obj %p\n",
654                         HandlerObj, RegionObj, ObjDesc));
655 
656                     Status = AcpiEvAttachRegion (HandlerObj, RegionObj,
657                                 AcpiNsLocked);
658 
659                     /*
660                      * Tell all users that this region is usable by running the _REG
661                      * method
662                      */
663                     if (AcpiNsLocked)
664                     {
665                         Status = AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
666                         if (ACPI_FAILURE (Status))
667                         {
668                             return_ACPI_STATUS (Status);
669                         }
670                     }
671 
672                     Status = AcpiEvExecuteRegMethod (RegionObj, 1);
673 
674                     if (AcpiNsLocked)
675                     {
676                         Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
677                         if (ACPI_FAILURE (Status))
678                         {
679                             return_ACPI_STATUS (Status);
680                         }
681                     }
682 
683                     return_ACPI_STATUS (AE_OK);
684                 }
685 
686                 /* Try next handler in the list */
687 
688                 HandlerObj = HandlerObj->AddressSpace.Next;
689             }
690         }
691 
692         /*
693          * This node does not have the handler we need;
694          * Pop up one level
695          */
696         Node = AcpiNsGetParentNode (Node);
697     }
698 
699     /* If we get here, there is no handler for this region */
700 
701     ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
702         "No handler for RegionType %s(%X) (RegionObj %p)\n",
703         AcpiUtGetRegionName (SpaceId), SpaceId, RegionObj));
704 
705     return_ACPI_STATUS (AE_NOT_EXIST);
706 }
707 
708