1. 15 6月, 2016 1 次提交
  2. 02 6月, 2016 1 次提交
    • L
      ACPICA / Hardware: Fix old register check in acpi_hw_get_access_bit_width() · 7f9bef9d
      Lv Zheng 提交于
      The address check in acpi_hw_get_access_bit_width() should be byte width
      based, not bit width based. This patch fixes this mistake.
      
      For those who want to review acpi_hw_access_bit_width(), here is the
      concerns and the design details of the function:
      
      It is supposed that the GAS Address field should be aligned to the byte
      width indicated by the GAS AccessSize field. Similarly, for the old non
      GAS register, it is supposed that its Address should be aligned to its
      Length.
      
      For the "AccessSize = 0 (meaning ANY)" case, we try to return the maximum
      instruction width (64 for MMIO or 32 for PIO) or the user expected access
      bit width (64 for acpi_read()/acpi_write() or 32 for acpi_hw_read()/
      acpi_hw_write()) and it is supposed that the GAS Address field should
      always be aligned to the maximum expected access bit width (otherwise it
      can't be accessed using ANY access bit width).
      
      The problem is in acpi_tb_init_generic_address(), where the non GAS
      register's Length is converted into the GAS BitWidth field, its Address is
      converted into the GAS Address field, and the GAS AccessSize field is left
      0 but most of the registers actually cannot be accessed using "ANY"
      accesses.
      
      As a conclusion, when AccessSize = 0 (ANY), the Address should either be
      aligned to the BitWidth (wrong conversion) or aligned to 32 for PIO or 64
      for MMIO (real GAS). Since currently, max_bit_width is 32, then:
      1. BitWidth for the wrong conversion is 8,16,32; and
      2. The Address of the real GAS should always be aligned to 8,16,32.
      The address alignment check to exclude false matched real GAS is not
      necessary. Thus this patch fixes the issue by removing the address
      alignment check.
      
      On the other hand, we in fact could use a simpler check of
      "reg->bit_width < max_bit_width" to exclude the "BitWidth=64 PIO" case that
      may be issued from acpi_read()/acpi_write() in the future.
      
      Fixes: b314a172 (ACPICA: Hardware: Add optimized access bit width support)
      Reported-and-tested-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Acked-by: NMike Marshall <hubcap@omnibond.com>
      Suggested-by: NJan Beulich <jbeulich@suse.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      7f9bef9d
  3. 05 5月, 2016 12 次提交
  4. 05 4月, 2016 16 次提交
  5. 04 4月, 2016 1 次提交
  6. 11 3月, 2016 1 次提交
    • L
      ACPICA / Interpreter: Fix a regression triggered because of wrong Linux ECDT support · 5508df89
      Lv Zheng 提交于
      It is reported that the following commit triggers regressions:
       Linux commit: efaed9be
       ACPICA commit: 31178590dde82368fdb0f6b0e466b6c0add96c57
       Subject: ACPICA: Events: Enhance acpi_ev_execute_reg_method() to
                ensure no _REG evaluations can happen during OS early boot
                stages
      
      This is because that the ECDT support is not corrected in Linux, and Linux
      requires to execute _REG for ECDT (though this sounds so wrong), we need to
      ensure acpi_gbl_namespace_initialized is set before ECDT probing in order
      for _REG to be executed. Since we have to move
      "acpi_gbl_namespace_initialized = TRUE" to the initialization step
      happening before ECDT probing, acpi_load_tables() is the best candidate for
      now. Thus this patch fixes the regression by doing so.
      
      But if the ECDT support is fixed, Linux will not execute _REG for ECDT, and
      ECDT probing will happen before acpi_load_tables(). At that time, we still
      want to ensure acpi_gbl_namespace_initialized is set after executing
      acpi_ns_initialize_objects() (under the condition of
      acpi_gbl_group_module_level_code = FALSE), this patch also moves
      acpi_ns_initialize_objects() to acpi_load_tables() accordingly.
      
      Since acpi_ns_initialize_objects() doesn't seem to be skippable, this
      patch also removes ACPI_NO_OBJECT_INIT for the one invoked in
      acpi_load_tables(). And since the default region handlers should always be
      installed before loading the tables, this patch also removes useless
      acpi_gbl_group_module_level_code check accordingly. Reported by Chris
      Bainbridge, Fixed by Lv Zheng.
      
      Fixes: efaed9be (ACPICA: Events: Enhance acpi_ev_execute_reg_method() to ensure no _REG evaluations can happen during OS early boot stages)
      Reported-and-tested-by: NChris Bainbridge <chris.bainbridge@gmail.com>
      Signed-off-by: NLv Zheng <lv.zheng@intel.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5508df89
  7. 09 3月, 2016 2 次提交
  8. 24 2月, 2016 6 次提交