1. 30 8月, 2013 4 次提交
  2. 29 8月, 2013 4 次提交
  3. 28 8月, 2013 1 次提交
  4. 27 8月, 2013 2 次提交
  5. 23 8月, 2013 8 次提交
  6. 18 8月, 2013 1 次提交
    • R
      ACPI / hotplug / PCI: Fix NULL pointer dereference in cleanup_bridge() · 1aaac071
      Rafael J. Wysocki 提交于
      After commit bbd34fcd (ACPI / hotplug / PCI: Register all devices
      under the given bridge) register_slot() is called for all PCI
      devices under a given bridge that have corresponding objects in
      the ACPI namespace, but it calls acpiphp_register_hotplug_slot()
      only for devices satisfying specific criteria.  Still,
      cleanup_bridge() calls acpiphp_unregister_hotplug_slot() for all
      objects created by register_slot(), although it should only call it
      for the ones that acpiphp_register_hotplug_slot() has been called
      for (successfully).  This causes a NULL pointer to be dereferenced
      by the acpiphp_unregister_hotplug_slot() executed by cleanup_bridge()
      if the object it is called for has not been passed to
      acpiphp_register_hotplug_slot().
      
      To fix this problem, check if the 'slot' field of the object passed
      to acpiphp_unregister_hotplug_slot() in cleanup_bridge() is not NULL,
      which only is the case if acpiphp_register_hotplug_slot() has been
      executed for that object.  In addition to that, make register_slot()
      reset the 'slot' field to NULL if acpiphp_register_hotplug_slot() has
      failed for the given object to prevent stale pointers from being
      used by acpiphp_unregister_hotplug_slot().
      Reported-and-tested-by: NYinghai Lu <yinghai@kernel.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      1aaac071
  7. 16 8月, 2013 1 次提交
  8. 15 8月, 2013 7 次提交
  9. 13 8月, 2013 5 次提交
  10. 10 8月, 2013 1 次提交
  11. 08 8月, 2013 1 次提交
    • R
      ACPI: Try harder to resolve _ADR collisions for bridges · 60f75b8e
      Rafael J. Wysocki 提交于
      In theory, under a given ACPI namespace node there should be only
      one child device object with _ADR whose value matches a given bus
      address exactly.  In practice, however, there are systems in which
      multiple child device objects under a given parent have _ADR matching
      exactly the same address.  In those cases we use _STA to determine
      which of the multiple matching devices is enabled, since some systems
      are known to indicate which ACPI device object to associate with the
      given physical (usually PCI) device this way.
      
      Unfortunately, as it turns out, there are systems in which many
      device objects under the same parent have _ADR matching exactly the
      same bus address and none of them has _STA, in which case they all
      should be regarded as enabled according to the spec.  Still, if
      those device objects are supposed to represent bridges (e.g. this
      is the case for device objects corresponding to PCIe ports), we can
      try harder and skip the ones that have no child device objects in the
      ACPI namespace.  With luck, we can avoid using device objects that we
      are not expected to use this way.
      
      Although this only works for bridges whose children also have ACPI
      namespace representation, it is sufficient to address graphics
      adapter detection issues on some systems, so rework the code finding
      a matching device ACPI handle for a given bus address to implement
      this idea.
      
      Introduce a new function, acpi_find_child(), taking three arguments:
      the ACPI handle of the device's parent, a bus address suitable for
      the device's bus type and a bool indicating if the device is a
      bridge and make it work as outlined above.  Reimplement the function
      currently used for this purpose, acpi_get_child(), as a call to
      acpi_find_child() with the last argument set to 'false' and make
      the PCI subsystem use acpi_find_child() with the bridge information
      passed as the last argument to it.  [Lan Tianyu notices that it is
      not sufficient to use pci_is_bridge() for that, because the device's
      subordinate pointer hasn't been set yet at this point, so use
      hdr_type instead.]
      
      This change fixes a regression introduced inadvertently by commit
      33f767d7 (ACPI: Rework acpi_get_child() to be more efficient) which
      overlooked the fact that for acpi_walk_namespace() "post-order" means
      "after all children have been visited" rather than "on the way back",
      so for device objects without children and for namespace walks of
      depth 1, as in the acpi_get_child() case, the "post-order" callbacks
      ordering is actually the same as the ordering of "pre-order" ones.
      Since that commit changed the namespace walk in acpi_get_child() to
      terminate after finding the first matching object instead of going
      through all of them and returning the last one, it effectively
      changed the result returned by that function in some rare cases and
      that led to problems (the switch from a "pre-order" to a "post-order"
      callback was supposed to prevent that from happening, but it was
      ineffective).
      
      As it turns out, the systems where the change made by commit
      33f767d7 actually matters are those where there are multiple ACPI
      device objects representing the same PCIe port (which effectively
      is a bridge).  Moreover, only one of them, and the one we are
      expected to use, has child device objects in the ACPI namespace,
      so the regression can be addressed as described above.
      
      References: https://bugzilla.kernel.org/show_bug.cgi?id=60561Reported-by: NPeter Wu <lekensteyn@gmail.com>
      Tested-by: NVladimir Lalov <mail@vlalov.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: 3.9+ <stable@vger.kernel.org> # 3.9+
      60f75b8e
  12. 07 8月, 2013 1 次提交
  13. 06 8月, 2013 1 次提交
  14. 03 8月, 2013 3 次提交