]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/acpi/acpica/exfldio.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[mv-sheeva.git] / drivers / acpi / acpica / exfldio.c
index 99cee61e655d7ddae24b2e73061a119244826e80..d7b3b418fb45739e82efdc20a6a2477270511842 100644 (file)
@@ -113,13 +113,20 @@ acpi_ex_setup_region(union acpi_operand_object *obj_desc,
                }
        }
 
+       /* Exit if Address/Length have been disallowed by the host OS */
+
+       if (rgn_desc->common.flags & AOPOBJ_INVALID) {
+               return_ACPI_STATUS(AE_AML_ILLEGAL_ADDRESS);
+       }
+
        /*
-        * Exit now for SMBus address space, it has a non-linear address space
+        * Exit now for SMBus or IPMI address space, it has a non-linear address space
         * and the request cannot be directly validated
         */
-       if (rgn_desc->region.space_id == ACPI_ADR_SPACE_SMBUS) {
+       if (rgn_desc->region.space_id == ACPI_ADR_SPACE_SMBUS ||
+           rgn_desc->region.space_id == ACPI_ADR_SPACE_IPMI) {
 
-               /* SMBus has a non-linear address space */
+               /* SMBus or IPMI has a non-linear address space */
 
                return_ACPI_STATUS(AE_OK);
        }
@@ -222,7 +229,7 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
 {
        acpi_status status;
        union acpi_operand_object *rgn_desc;
-       acpi_physical_address address;
+       u32 region_offset;
 
        ACPI_FUNCTION_TRACE(ex_access_region);
 
@@ -243,7 +250,7 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
         * 3) The current offset into the field
         */
        rgn_desc = obj_desc->common_field.region_obj;
-       address = rgn_desc->region.address +
+       region_offset =
            obj_desc->common_field.base_byte_offset + field_datum_byte_offset;
 
        if ((function & ACPI_IO_MASK) == ACPI_READ) {
@@ -260,16 +267,18 @@ acpi_ex_access_region(union acpi_operand_object *obj_desc,
                              obj_desc->common_field.access_byte_width,
                              obj_desc->common_field.base_byte_offset,
                              field_datum_byte_offset, ACPI_CAST_PTR(void,
-                                                                    address)));
+                                                                    (rgn_desc->
+                                                                     region.
+                                                                     address +
+                                                                     region_offset))));
 
        /* Invoke the appropriate address_space/op_region handler */
 
-       status = acpi_ev_address_space_dispatch(rgn_desc, function,
-                                               address,
-                                               ACPI_MUL_8(obj_desc->
-                                                          common_field.
-                                                          access_byte_width),
-                                               value);
+       status =
+           acpi_ev_address_space_dispatch(rgn_desc, function, region_offset,
+                                          ACPI_MUL_8(obj_desc->common_field.
+                                                     access_byte_width),
+                                          value);
 
        if (ACPI_FAILURE(status)) {
                if (status == AE_NOT_IMPLEMENTED) {